elif mydep[:1] in "=<>~!":
prefix=mydep[:1]
mydep=mydep[1:]
+ colon = mydep.rfind(":")
+ if colon != -1:
+ postfix = mydep[colon:]
+ mydep = mydep[:colon]
return prefix + cpv_expand(
mydep, mydb=mydb, use_cache=use_cache, settings=settings) + postfix
def match(self,origdep,use_cache=1):
mydep = dep_expand(origdep, mydb=self, settings=self.settings)
mykey=dep_getkey(mydep)
- mycat=mykey.split("/")[0]
- return match_from_list(mydep,self.cp_list(mykey,use_cache=use_cache))
+ mylist = match_from_list(mydep,self.cp_list(mykey,use_cache=use_cache))
+ myslot = portage_dep.dep_getslot(mydep)
+ if myslot is not None:
+ mylist = [cpv for cpv in mylist \
+ if self.aux_get(cpv, ["SLOT"])[0] == myslot]
+ return mylist
def match2(self,mydep,mykey,mylist):
writemsg("DEPRECATED: dbapi.match2\n")
if self.matchcache.has_key(mycat):
del self.mtdircache[mycat]
del self.matchcache[mycat]
- return match_from_list(mydep,self.cp_list(mykey,use_cache=use_cache))
+ mymatch = match_from_list(mydep,
+ self.cp_list(mykey, use_cache=use_cache))
+ myslot = portage_dep.dep_getslot(mydep)
+ if myslot is not None:
+ mymatch = [cpv for cpv in mymatch \
+ if self.aux_get(cpv, ["SLOT"])[0] == myslot]
+ return mymatch
try:
curmtime=os.stat(self.root+VDB_PATH+"/"+mycat)[stat.ST_MTIME]
except SystemExit, e:
self.matchcache[mycat]={}
if not self.matchcache[mycat].has_key(mydep):
mymatch=match_from_list(mydep,self.cp_list(mykey,use_cache=use_cache))
+ myslot = portage_dep.dep_getslot(mydep)
+ if myslot is not None:
+ mymatch = [cpv for cpv in mymatch \
+ if self.aux_get(cpv, ["SLOT"])[0] == myslot]
self.matchcache[mycat][mydep]=mymatch
return self.matchcache[mycat][mydep][:]
else:
print "ERROR: xmatch doesn't handle",level,"query!"
raise KeyError
+ myslot = portage_dep.dep_getslot(mydep)
+ if myslot is not None:
+ myval = [cpv for cpv in myval \
+ if self.aux_get(cpv, ["SLOT"])[0] == myslot]
if self.frozen and (level not in ["match-list","bestmatch-list"]):
self.xcache[level][mydep]=myval
return myval
mydep = mydep[2:]
elif mydep[:1] in "=<>~":
mydep = mydep[1:]
+ colon = mydep.rfind(":")
+ if colon != -1:
+ return mydep[:colon]
return mydep
+def dep_getslot(mydep):
+ colon = mydep.rfind(":")
+ if colon != -1:
+ return mydep[colon+1:]
+ return None
+
def isvalidatom(atom):
mycpv_cps = catpkgsplit(dep_getcpv(atom))
operator = get_operator(atom)
mycpv = dep_getcpv(mydep)
mycpv_cps = catpkgsplit(mycpv) # Can be None if not specific
+ slot = None
if not mycpv_cps:
cat, pkg = catsplit(mycpv)
ver = None
rev = None
+ slot = dep_getslot(mydep)
else:
cat, pkg, ver, rev = mycpv_cps
if mydep == mycpv:
for x in candidate_list:
xs = pkgsplit(x)
if xs is None:
- if x != mycpv:
+ xcpv = dep_getcpv(x)
+ if slot is not None:
+ xslot = dep_getslot(x)
+ if xslot is not None and xslot != slot:
+ """ This function isn't given enough information to
+ reject atoms based on slot unless *both* compared atoms
+ specify slots."""
+ continue
+ if xcpv != mycpv:
continue
elif xs[0] != mycpv:
continue