Only call altlist() to validate blockers when necessary.
For userpriv, call setgroups with all groups that the portage user
belongs to (bug #137610).
Remove special case of --emptytree in depgraph.display(). Thanks to
Jason Stubbs for this patch from bug #152030.
Make dosed use sed -i instead of a temp file. Thanks to Tim Cera for
this patch from bug #152017.
svn path=/main/branches/prefix/; revision=4765
y="${D}${x}"
if [ -e "${y}" ] ; then
if [ -f "${y}" ] ; then
- mysrc="${T}/${y##*/}"
- cp "${y}" "${mysrc}"
- sed -e "${mysed}" "${mysrc}" > "${y}"
+ sed -i -e "${mysed}" "${y}"
else
echo "${y} is not a regular file!"
exit 1
self.blocker_digraph.addnode(node, blocker)
self.digraph.remove(blocker)
# Validate blockers that depend on merge order.
- self.altlist()
+ if not self.blocker_digraph.empty():
+ self.altlist()
def altlist(self, reversed=False):
mygraph=self.digraph.copy()
#we need to use "--emptrytree" testing here rather than "empty" param testing because "empty"
#param is used for -u, where you still *do* want to see when something is being upgraded.
myoldbest=""
- if "--emptytree" not in self.myopts and \
- self.trees[x[1]]["vartree"].exists_specific(x[2]):
+ if self.trees[x[1]]["vartree"].exists_specific(pkg_key):
addl=" "+yellow("R")+fetch+" "
- elif "--emptytree" not in self.myopts and \
- self.trees[x[1]]["vartree"].exists_specific_cat(x[2]):
+ elif self.trees[x[1]]["vartree"].exists_specific_cat(pkg_key):
mynewslot = mydbapi.aux_get(pkg_key, ["SLOT"])[0]
myoldlist = self.trees[x[1]]["vartree"].dbapi.match(
portage.pkgsplit(x[2])[0])
INCREMENTALS, EAPI, MISC_SH_BINARY
from portage_data import ostype, lchown, userland, secpass, uid, wheelgid, \
- portage_uid, portage_gid
+ portage_uid, portage_gid, userpriv_groups
from portage_manifest import Manifest
import portage_util
("userpriv" in string.split(mysettings["RESTRICT"]))))
if droppriv and not uid and portage_gid and portage_uid:
- keywords.update({"uid":portage_uid,"gid":portage_gid,"groups":[portage_gid],"umask":002})
+ keywords.update({"uid":portage_uid,"gid":portage_gid,"groups":userpriv_groups,"umask":002})
if not free:
free=((droppriv and "usersandbox" not in features) or \
spawn_keywords.update({
"uid" : portage_uid,
"gid" : portage_gid,
- "groups" : [portage_gid],
+ "groups" : userpriv_groups,
"umask" : 002})
try:
# Distributed under the terms of the GNU General Public License v2
# $Id: portage_data.py 4530 2006-09-25 21:16:32Z zmedico $
+if not hasattr(__builtins__, "set"):
+ from sets import Set as set
import os,pwd,grp
import portage_const
writemsg(red("*** Please add this user to the portage group if you wish to use portage.\n"))
writemsg("\n")
portage_group_warning()
+
+userpriv_groups = [portage_gid]
+if secpass >= 2:
+ for g in grp.getgrall():
+ if "portage" in g[3]:
+ userpriv_groups.append(g[2])
+ userpriv_groups = list(set(userpriv_groups))