aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog9
-rwxr-xr-xbin/emerge30
-rw-r--r--pym/portage.py36
3 files changed, 56 insertions, 19 deletions
diff --git a/ChangeLog b/ChangeLog
index 671f4e5..763f027 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,6 +1,13 @@
# ChangeLog for Portage; the Gentoo Linux ports system
# Copyright 2000-2003 Gentoo Technologies, Inc.; Distributed under the GPL v2
-# $Id: ChangeLog,v 1.472 2003/09/02 17:31:40 carpaski Exp $
+# $Id: ChangeLog,v 1.473 2003/09/11 03:36:18 carpaski Exp $
+
+*portage-2.0.49-r4 (10 Sep 2003): Fixes
+
+ 10 Sep 2003; Nicholas Jones <carpaski@gentoo.org> *: Added the facility
+ to incorporate binary package use flags when calculating deps. Changes in
+ -r2 and -r3 included quick fixes to SELinux code and the addition of
+ LINGUAS to USE_EXPAND.
*portage-2.0.49-r1 (25 Aug 2003): Fixes
diff --git a/bin/emerge b/bin/emerge
index 22f44f7..700fb98 100755
--- a/bin/emerge
+++ b/bin/emerge
@@ -1,7 +1,7 @@
#!/usr/bin/env python2.2
# Copyright 1999-2003 Gentoo Technologies, Inc.
# Distributed under the terms of the GNU General Public License v2
-# $Header: /local/data/ulm/cvs/history/var/cvsroot/gentoo-src/portage/bin/emerge,v 1.225 2003/09/02 17:31:40 carpaski Exp $
+# $Header: /local/data/ulm/cvs/history/var/cvsroot/gentoo-src/portage/bin/emerge,v 1.226 2003/09/11 03:36:21 carpaski Exp $
import os
os.environ["PORTAGE_CALLER"]="emerge"
@@ -586,8 +586,13 @@ class depgraph:
return 1
update_spinner()
+
+ myuse=portage.settings["USE"]
+ if len(mybigkey) == 3:
+ mytype,myroot,mykey=mybigkey
+ else:
+ mytype,myroot,mykey,myuse=mybigkey
- mytype,myroot,mykey=mybigkey
# select the correct /var database that we'll be checking against
vardbapi=portage.db[myroot]["vartree"].dbapi
@@ -603,7 +608,11 @@ class depgraph:
if myparent and (self.mydbapi[myroot].match(mykey) or vardbapi.match(mykey)):
# otherwise, encode parent information where we would normally
# write "(no)merge" and continue:
- parenttype,parentroot,parentkey,mergeme=string.split(myparent)
+ mypsplit=string.split(myparent)
+ parenttype=mypsplit[0]
+ parentroot=mypsplit[1]
+ parentkey=mypsplit[2]
+ mergeme=mypsplit[-1]
mykexp=portage.dep_expand(mykey,self.mydbapi[myroot])
pakexp=portage.dep_expand(parentkey,self.mydbapi[myroot])
myrealkey=portage.dep_getkey(mykexp)
@@ -681,20 +690,20 @@ class depgraph:
if myroot=="/":
mydep["/"]=edepend["DEPEND"]+" "+edepend["RDEPEND"]
- if not self.select_dep("/",mydep["/"],myparent=mp):
+ if not self.select_dep("/",mydep["/"],myparent=mp,myuse=myuse):
return 0
else:
mydep["/"]=edepend["DEPEND"]
mydep[myroot]=edepend["RDEPEND"]
- if not self.select_dep("/",mydep["/"],myparent=mp):
+ if not self.select_dep("/",mydep["/"],myparent=mp,myuse=myuse):
return 0
- elif not self.select_dep(myroot,mydep[myroot],myparent=mp):
+ elif not self.select_dep(myroot,mydep[myroot],myparent=mp,myuse=myuse):
return 0
if edepend.has_key("PDEPEND") and edepend["PDEPEND"]:
# Post Depend -- Add to the list without a parent, as it depends
# on a package being present AND must be built after that package.
- if not self.select_dep(myroot,edepend["PDEPEND"]):
+ if not self.select_dep(myroot,edepend["PDEPEND"],myuse=myuse):
return 0
return 1
@@ -771,7 +780,7 @@ class depgraph:
break
alleb.remove(cand)
- def select_dep(self,myroot,depstring,myparent=None,arg=None):
+ def select_dep(self,myroot,depstring,myparent=None,arg=None,myuse=None):
"given a dependency string, create the appropriate depgraph and return 1 on success and 0 on failure"
if "--debug" in myopts:
print
@@ -779,7 +788,7 @@ class depgraph:
print "Depstring:",depstring
if not arg:
#processing dependencies
- mycheck=portage.dep_check(depstring,self.mydbapi[myroot])
+ mycheck=portage.dep_check(depstring,self.mydbapi[myroot],myuse=myuse)
if not mycheck[0]:
return 0
mymerge=mycheck[1]
@@ -846,7 +855,8 @@ class depgraph:
if myeb:
myk=["ebuild",myroot,myeb]
elif myeb_pkg:
- myk=["binary",myroot,myeb_pkg]
+ pkguseflags=portage.db[portage.root]["bintree"].get_use(myeb_pkg)
+ myk=["binary",myroot,myeb_pkg,pkguseflags]
else:
sys.stderr.write("!!! Confused... Don't know what I'm using for dependency info. :(\n")
sys.exit(1)
diff --git a/pym/portage.py b/pym/portage.py
index 5471244..0a9d99e 100644
--- a/pym/portage.py
+++ b/pym/portage.py
@@ -1,7 +1,7 @@
# portage.py -- core Portage functionality
# Copyright 1998-2003 Daniel Robbins, Gentoo Technologies, Inc.
# Distributed under the GNU Public License v2
-# $Header: /local/data/ulm/cvs/history/var/cvsroot/gentoo-src/portage/pym/portage.py,v 1.338 2003/09/02 17:31:40 carpaski Exp $
+# $Header: /local/data/ulm/cvs/history/var/cvsroot/gentoo-src/portage/pym/portage.py,v 1.339 2003/09/11 03:36:21 carpaski Exp $
VERSION="2.0.49"
@@ -2602,18 +2602,30 @@ def dep_expand(mydep,mydb=None):
mydep=mydep[1:]
return prefix+cpv_expand(mydep,mydb)+postfix
-def dep_check(depstring,mydbapi,use="yes",mode=None):
+def dep_check(depstring,mydbapi,use="yes",mode=None,myuse=None):
"""Takes a depend string and parses the condition."""
global usesplit
+
if use=="all":
#enable everything (for repoman)
myusesplit=["*"]
elif use=="yes":
- #default behavior
- myusesplit=usesplit
+ if myuse==None:
+ #default behavior
+ myusesplit=usesplit
+ else:
+ myusesplit = string.split(myuse)
+ # We've been given useflags to use.
+ #print "USE FLAGS PASSED IN."
+ #print myuse
+ #if "bindist" in myusesplit:
+ # print "BINDIST is set!"
+ #else:
+ # print "BINDIST NOT set."
else:
#we are being run by autouse(), don't consult USE vars yet.
myusesplit=[]
+
mysplit=string.split(depstring)
#convert parenthesis to sublists
mysplit=dep_parenreduce(mysplit)
@@ -2692,8 +2704,8 @@ class packagetree:
nolist.remove(x)
return nolist
- def depcheck(self,mycheck,use="yes"):
- return dep_check(mycheck,self.dbapi,use=use)
+ def depcheck(self,mycheck,use="yes",myusesplit=None):
+ return dep_check(mycheck,self.dbapi,use=use,myusesplit=myusesplit)
def populate(self):
"populates the tree with values"
@@ -2769,8 +2781,8 @@ class portagetree:
mykey=mykey+"-"+cps[3]
return mykey
- def depcheck(self,mycheck,use="yes"):
- return dep_check(mycheck,self.dbapi,use=use)
+ def depcheck(self,mycheck,use="yes",myusesplit=None):
+ return dep_check(mycheck,self.dbapi,use=use,myusesplit=myusesplit)
class dbapi:
@@ -4031,6 +4043,14 @@ class binarytree(packagetree):
remote = (not os.path.exists(self.getname(pkgname))) and self.remotepkgs.has_key(mysplit[1]+".tbz2")
return remote
+ def get_use(self,pkgname):
+ mysplit=string.split(pkgname,"/")
+ if self.isremote(pkgname):
+ return string.split(self.remotepkgs[mysplit[1]+".tbz2"]["USE"][:])
+ tbz2=xpak.tbz2(self.getname(pkgname))
+ return tbz2.getfile("USE")
+
+
def gettbz2(self,pkgname):
"fetches the package from a remote site, if necessary."
print "Fetching '"+str(pkgname)+"'"