From: Zac Medico Date: Thu, 25 Jun 2009 06:35:25 +0000 (-0000) Subject: Add a Package.metadata.restrict attribute containing a list of enabled X-Git-Tag: v2.2_rc34~148 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=2c5986b35f24c235a518aefa4ba3e5fed5cadd77;p=portage.git Add a Package.metadata.restrict attribute containing a list of enabled RESTRICT values. svn path=/main/trunk/; revision=13693 --- diff --git a/pym/_emerge/EbuildFetchonly.py b/pym/_emerge/EbuildFetchonly.py index 1a8eb6e8d..82e11065a 100644 --- a/pym/_emerge/EbuildFetchonly.py +++ b/pym/_emerge/EbuildFetchonly.py @@ -24,9 +24,8 @@ class EbuildFetchonly(SlotObject): ebuild_path = portdb.findname(pkg.cpv) settings.setcpv(pkg) debug = settings.get("PORTAGE_DEBUG") == "1" - restrict_fetch = 'fetch' in settings['PORTAGE_RESTRICT'].split() - if restrict_fetch: + if 'fetch' in pkg.metadata.restrict: rval = self._execute_with_builddir() else: rval = portage.doebuild(ebuild_path, "fetch", diff --git a/pym/_emerge/Package.py b/pym/_emerge/Package.py index 6763f8e16..1b8a90c8b 100644 --- a/pym/_emerge/Package.py +++ b/pym/_emerge/Package.py @@ -241,3 +241,7 @@ class _PackageMetadataWrapper(_PackageMetadataWrapperBase): @property def properties(self): return self['PROPERTIES'].split() + + @property + def restrict(self): + return self['RESTRICT'].split() diff --git a/pym/_emerge/depgraph.py b/pym/_emerge/depgraph.py index 2d9c50405..9e5ddac28 100644 --- a/pym/_emerge/depgraph.py +++ b/pym/_emerge/depgraph.py @@ -3709,18 +3709,8 @@ class depgraph(object): else: repo_path_real = portdb.getRepositoryPath(repo_name) pkg_use = list(pkg.use.enabled) - try: - restrict = flatten(use_reduce(paren_reduce( - pkg.metadata["RESTRICT"]), uselist=pkg_use)) - except portage.exception.InvalidDependString, e: - if not pkg.installed: - show_invalid_depstring_notice(x, - pkg.metadata["RESTRICT"], str(e)) - del e - return 1 - restrict = [] - if "ebuild" == pkg_type and x[3] != "nomerge" and \ - "fetch" in restrict: + if not pkg.built and pkg.operation == 'merge' and \ + 'fetch' in pkg.metadata.restrict: fetch = red("F") if ordered: counters.restrict_fetch += 1