diff options
author | Zac Medico <zmedico@gentoo.org> | 2009-06-25 06:35:25 +0000 |
---|---|---|
committer | Zac Medico <zmedico@gentoo.org> | 2009-06-25 06:35:25 +0000 |
commit | 2c5986b35f24c235a518aefa4ba3e5fed5cadd77 (patch) | |
tree | 9e88df9909b1b93b5b66dcd3c00e5cafc2e179c8 | |
parent | eb64481dcd1de381405b39a4c843e1d17c30aaba (diff) | |
download | portage-2c5986b35f24c235a518aefa4ba3e5fed5cadd77.tar.gz portage-2c5986b35f24c235a518aefa4ba3e5fed5cadd77.tar.bz2 portage-2c5986b35f24c235a518aefa4ba3e5fed5cadd77.zip |
Add a Package.metadata.restrict attribute containing a list of enabled
RESTRICT values.
svn path=/main/trunk/; revision=13693
-rw-r--r-- | pym/_emerge/EbuildFetchonly.py | 3 | ||||
-rw-r--r-- | pym/_emerge/Package.py | 4 | ||||
-rw-r--r-- | pym/_emerge/depgraph.py | 14 |
3 files changed, 7 insertions, 14 deletions
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 |