diff options
author | Brian Dolbec <dolsen@gentoo.org> | 2012-12-15 13:24:53 -0800 |
---|---|---|
committer | Brian Dolbec <dolsen@gentoo.org> | 2012-12-15 13:24:53 -0800 |
commit | 0bf5677196fcca080b2ad61dbf2d08da537912e9 (patch) | |
tree | 3d5f4be89250c469b67a9eb1898c9215069db6b8 | |
parent | Add the manpage to be updated with the new version (diff) | |
download | mirrorselect-0bf5677196fcca080b2ad61dbf2d08da537912e9.tar.gz mirrorselect-0bf5677196fcca080b2ad61dbf2d08da537912e9.tar.bz2 mirrorselect-0bf5677196fcca080b2ad61dbf2d08da537912e9.zip |
add eprefix comapatibility code.
-rwxr-xr-x | mirrorselect/main.py | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/mirrorselect/main.py b/mirrorselect/main.py index 55c1cb0..cbff890 100755 --- a/mirrorselect/main.py +++ b/mirrorselect/main.py @@ -46,6 +46,12 @@ from mirrorselect.output import Output, ColoredFormatter from mirrorselect.selectors import Deep, Shallow, Extractor, Interactive from mirrorselect.version import version +# eprefix compatibility +try: + from portage.const import rootuid +except ImportError: + rootuid = 0 + # establish the eprefix, initially set so eprefixify can # set it on install @@ -319,7 +325,7 @@ class MirrorSelect(object): 'You do not appear to have netselect on your system. ' 'You must use the -D flag') - if (os.getuid() != 0) and not options.output: + if (os.getuid() != rootuid) and not options.output: self.output.print_err('Must be root to write to %s!\n' % config_path) if args: |