* [gentoo-commits] portage r11768 - in main/trunk/pym/portage: . dbapi
@ 2008-10-31 21:37 99% Zac Medico (zmedico)
0 siblings, 0 replies; 1+ results
From: Zac Medico (zmedico) @ 2008-10-31 21:37 UTC (permalink / raw
To: gentoo-commits
Author: zmedico
Date: 2008-10-31 21:37:18 +0000 (Fri, 31 Oct 2008)
New Revision: 11768
Modified:
main/trunk/pym/portage/__init__.py
main/trunk/pym/portage/dbapi/__init__.py
Log:
Bug #244947 - Add basic repoman support for checking masked and forced flags
when verifying USE deps. TODO: Add repoman support in dep_check() for
evaluation of conditional USE deps based on forced/masked flags.
masked flags, so that repoman can also
Modified: main/trunk/pym/portage/__init__.py
===================================================================
--- main/trunk/pym/portage/__init__.py 2008-10-31 20:40:51 UTC (rev 11767)
+++ main/trunk/pym/portage/__init__.py 2008-10-31 21:37:18 UTC (rev 11768)
@@ -2001,45 +2001,13 @@
if defaults != self.configdict["defaults"].get("USE",""):
self.configdict["defaults"]["USE"] = defaults
has_changed = True
- useforce = []
- pos = 0
- for i in xrange(len(self.profiles)):
- cpdict = self.puseforce_list[i].get(cp, None)
- if cpdict:
- keys = cpdict.keys()
- while keys:
- best_match = best_match_to_list(cpv_slot, keys)
- if best_match:
- keys.remove(best_match)
- useforce.insert(pos, cpdict[best_match])
- else:
- break
- del keys
- if self.useforce_list[i]:
- useforce.insert(pos, self.useforce_list[i])
- pos = len(useforce)
- useforce = set(stack_lists(useforce, incremental=True))
+
+ useforce = self._getUseForce(cpv_slot)
if useforce != self.useforce:
self.useforce = useforce
has_changed = True
- usemask = []
- pos = 0
- for i in xrange(len(self.profiles)):
- cpdict = self.pusemask_list[i].get(cp, None)
- if cpdict:
- keys = cpdict.keys()
- while keys:
- best_match = best_match_to_list(cpv_slot, keys)
- if best_match:
- keys.remove(best_match)
- usemask.insert(pos, cpdict[best_match])
- else:
- break
- del keys
- if self.usemask_list[i]:
- usemask.insert(pos, self.usemask_list[i])
- pos = len(usemask)
- usemask = set(stack_lists(usemask, incremental=True))
+
+ usemask = self._getUseMask(cpv_slot)
if usemask != self.usemask:
self.usemask = usemask
has_changed = True
@@ -2207,6 +2175,52 @@
iuse_implicit.add("bootstrap")
return iuse_implicit
+ def _getUseMask(self, pkg):
+ cp = getattr(pkg, "cp", None)
+ if cp is None:
+ cp = dep_getkey(pkg)
+ usemask = []
+ pos = 0
+ for i in xrange(len(self.profiles)):
+ cpdict = self.pusemask_list[i].get(cp, None)
+ if cpdict:
+ keys = cpdict.keys()
+ while keys:
+ best_match = best_match_to_list(pkg, keys)
+ if best_match:
+ keys.remove(best_match)
+ usemask.insert(pos, cpdict[best_match])
+ else:
+ break
+ del keys
+ if self.usemask_list[i]:
+ usemask.insert(pos, self.usemask_list[i])
+ pos = len(usemask)
+ return set(stack_lists(usemask, incremental=True))
+
+ def _getUseForce(self, pkg):
+ cp = getattr(pkg, "cp", None)
+ if cp is None:
+ cp = dep_getkey(pkg)
+ useforce = []
+ pos = 0
+ for i in xrange(len(self.profiles)):
+ cpdict = self.puseforce_list[i].get(cp, None)
+ if cpdict:
+ keys = cpdict.keys()
+ while keys:
+ best_match = best_match_to_list(pkg, keys)
+ if best_match:
+ keys.remove(best_match)
+ useforce.insert(pos, cpdict[best_match])
+ else:
+ break
+ del keys
+ if self.useforce_list[i]:
+ useforce.insert(pos, self.useforce_list[i])
+ pos = len(useforce)
+ return set(stack_lists(useforce, incremental=True))
+
def _getMaskAtom(self, cpv, metadata):
"""
Take a package and return a matching package.mask atom, or None if no
Modified: main/trunk/pym/portage/dbapi/__init__.py
===================================================================
--- main/trunk/pym/portage/dbapi/__init__.py 2008-10-31 20:40:51 UTC (rev 11767)
+++ main/trunk/pym/portage/dbapi/__init__.py 2008-10-31 21:37:18 UTC (rev 11768)
@@ -150,7 +150,7 @@
self._iuse_implicit = self.settings._get_implicit_iuse()
for cpv in cpv_iter:
try:
- iuse, use = self.aux_get(cpv, ["IUSE", "USE"])
+ iuse, slot, use = self.aux_get(cpv, ["IUSE", "SLOT", "USE"])
except KeyError:
continue
use = use.split()
@@ -169,6 +169,20 @@
continue
if atom.use.disabled.intersection(use):
continue
+ else:
+ # Check masked and forced flags for repoman.
+ mysettings = getattr(self, "mysettings", None)
+ if mysettings is not None and not mysettings.local_config:
+
+ pkg = "%s:%s" % (cpv, slot)
+ usemask = mysettings._getUseMask(pkg)
+ if usemask.intersection(atom.use.enabled):
+ continue
+
+ useforce = mysettings._getUseForce(pkg).difference(usemask)
+ if useforce.intersection(atom.use.disabled):
+ continue
+
yield cpv
def invalidentry(self, mypath):
^ permalink raw reply [relevance 99%]
Results 1-1 of 1 | reverse | options above
-- pct% links below jump to the message on this page, permalinks otherwise --
2008-10-31 21:37 99% [gentoo-commits] portage r11768 - in main/trunk/pym/portage: . dbapi Zac Medico (zmedico)
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox