Gentoo Archives: gentoo-dev

From: Terje Kvernes <terjekv@××××××××.no>
To: gentoo-dev@g.o
Subject: Re: [gentoo-dev] pretend requires root?
Date: Sat, 20 Apr 2002 21:05:13
Message-Id: wxxr8l9bycs.fsf@nommo.uio.no
In Reply to: Re: [gentoo-dev] pretend requires root? by Terje Kvernes
1 Terje Kvernes <terjekv@××××××××.no> writes:
2
3 > Yannick Koehler <yannick.koehler@××××××××.com> writes:
4 >
5 > > Is it possible to make portage not require 'root' level when only
6 > > doing --pretend stuff?
7 >
8 > this is hardwired in /usr/bin/emerge. look at the section starting
9 > on line 104 and so on.
10
11 for the record, just adding a clause for --pretend to be allowed for
12 non-root users should work. something like this is all you need:
13
14 --- /usr/bin/emerge Sun Apr 21 03:59:19 2002
15 +++ /usr/bin/emerge.orig Sun Apr 21 03:57:53 2002
16 @@ -102,7 +102,7 @@
17 myfiles.append(x)
18
19 # check if root user is the current user for the actions where emerge needs this
20 -if os.getuid()!=0 and ("--help" not in myopts) and ("--version" not in myopts) and ("search"!=myaction) and ("--pretend" not in myopts):
21 +if os.getuid()!=0 and ("--help" not in myopts) and ("--version" not in myopts) and ("search"!=myaction):
22 print "!!! to be able to perform the requested action, emerge must be run by root."
23 sys.exit(1)
24
25 --
26 Terje - who was at a party earlier, and was a tad too busy to provide
27 more info at that time. :)

Replies

Subject Author
Re: [gentoo-dev] pretend requires root? "Preston A. Elder" <prez@××××.net>