summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarius Mauch <genone@gentoo.org>2008-09-28 19:15:43 +0000
committerMarius Mauch <genone@gentoo.org>2008-09-28 19:15:43 +0000
commitceb5fc5058cc7595ac30f08d912ff3544d0639fb (patch)
tree9332b26e30a8415ae10f4cd469d33a7c150ff7f4
parente894f214209ef25ece3cbf6369f053dc7e9754bc (diff)
downloadportage-ceb5fc5058cc7595ac30f08d912ff3544d0639fb.tar.gz
portage-ceb5fc5058cc7595ac30f08d912ff3544d0639fb.tar.bz2
portage-ceb5fc5058cc7595ac30f08d912ff3544d0639fb.zip
add support for slot dependencies (original patch by Robert Buchholz <rbu@gentoo.org>)
svn path=/main/trunk/; revision=11593
-rw-r--r--pym/portage/glsa.py11
1 files changed, 8 insertions, 3 deletions
diff --git a/pym/portage/glsa.py b/pym/portage/glsa.py
index f0d99c8c1..33d3cf027 100644
--- a/pym/portage/glsa.py
+++ b/pym/portage/glsa.py
@@ -226,6 +226,8 @@ def makeAtom(pkgname, versionNode):
rValue = opMapping[versionNode.getAttribute("range")] \
+ pkgname \
+ "-" + getText(versionNode, format="strip")
+ if "slot" in versionNode.attributes and versionNode.getAttribute("slot") != "*":
+ rValue += ":"+versionNode.getAttribute("slot")
return str(rValue)
def makeVersion(versionNode):
@@ -239,8 +241,11 @@ def makeVersion(versionNode):
@rtype: String
@return: the version string
"""
- return opMapping[versionNode.getAttribute("range")] \
+ rValue = opMapping[versionNode.getAttribute("range")] \
+ getText(versionNode, format="strip")
+ if "slot" in versionNode.attributes and versionNode.getAttribute("slot") != "*":
+ rValue += ":"+versionNode.getAttribute("slot")
+ return rValue
def match(atom, dbapi, match_type="default"):
"""
@@ -283,9 +288,9 @@ def revisionMatch(revisionAtom, dbapi, match_type="default"):
@return: a list with the matching versions
"""
if match_type == "default" or not hasattr(dbapi, "xmatch"):
- mylist = dbapi.match(re.sub("-r[0-9]+$", "", revisionAtom[2:]))
+ mylist = dbapi.match(re.sub(r'-r[0-9]+(:[^ ]+)?$', r'\1', revisionAtom[2:]))
else:
- mylist = dbapi.xmatch(match_type, re.sub("-r[0-9]+$", "", revisionAtom[2:]))
+ mylist = dbapi.xmatch(match_type, re.sub(r'-r[0-9]+(:[^ ]+)?$', r'\1', revisionAtom[2:]))
rValue = []
for v in mylist:
r1 = pkgsplit(v)[-1][1:]