aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrian Dolbec <dolsen@gentoo.org>2012-12-15 13:24:53 -0800
committerBrian Dolbec <dolsen@gentoo.org>2012-12-15 13:24:53 -0800
commit0bf5677196fcca080b2ad61dbf2d08da537912e9 (patch)
tree3d5f4be89250c469b67a9eb1898c9215069db6b8
parentAdd the manpage to be updated with the new version (diff)
downloadmirrorselect-0bf5677196fcca080b2ad61dbf2d08da537912e9.tar.gz
mirrorselect-0bf5677196fcca080b2ad61dbf2d08da537912e9.tar.bz2
mirrorselect-0bf5677196fcca080b2ad61dbf2d08da537912e9.zip
add eprefix comapatibility code.
-rwxr-xr-xmirrorselect/main.py8
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: