From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) by finch.gentoo.org (Postfix) with ESMTP id C08991381F3 for ; Sat, 15 Dec 2012 21:25:45 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 6958121C068; Sat, 15 Dec 2012 21:25:33 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) (using TLSv1 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id E38FD21C068 for ; Sat, 15 Dec 2012 21:25:32 +0000 (UTC) Received: from hornbill.gentoo.org (hornbill.gentoo.org [94.100.119.163]) (using TLSv1 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id DFCB433DC94 for ; Sat, 15 Dec 2012 21:25:31 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by hornbill.gentoo.org (Postfix) with ESMTP id 76BFDE543C for ; Sat, 15 Dec 2012 21:25:30 +0000 (UTC) From: "Brian Dolbec" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Brian Dolbec" Message-ID: <1355606693.0bf5677196fcca080b2ad61dbf2d08da537912e9.dol-sen@gentoo> Subject: [gentoo-commits] proj/mirrorselect:master commit in: mirrorselect/ X-VCS-Repository: proj/mirrorselect X-VCS-Files: mirrorselect/main.py X-VCS-Directories: mirrorselect/ X-VCS-Committer: dol-sen X-VCS-Committer-Name: Brian Dolbec X-VCS-Revision: 0bf5677196fcca080b2ad61dbf2d08da537912e9 X-VCS-Branch: master Date: Sat, 15 Dec 2012 21:25:30 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Archives-Salt: fe557250-d74f-4492-8c05-d79720f1ae9a X-Archives-Hash: 8805487673e4002d2a7a6a978e37105e commit: 0bf5677196fcca080b2ad61dbf2d08da537912e9 Author: Brian Dolbec gentoo org> AuthorDate: Sat Dec 15 21:24:53 2012 +0000 Commit: Brian Dolbec gmail com> CommitDate: Sat Dec 15 21:24:53 2012 +0000 URL: http://git.overlays.gentoo.org/gitweb/?p=proj/mirrorselect.git;a=commit;h=0bf56771 add eprefix comapatibility code. --- 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: