Add a Package.metadata.restrict attribute containing a list of enabled
authorZac Medico <zmedico@gentoo.org>
Thu, 25 Jun 2009 06:35:25 +0000 (06:35 -0000)
committerZac Medico <zmedico@gentoo.org>
Thu, 25 Jun 2009 06:35:25 +0000 (06:35 -0000)
RESTRICT values.

svn path=/main/trunk/; revision=13693

pym/_emerge/EbuildFetchonly.py
pym/_emerge/Package.py
pym/_emerge/depgraph.py

index 1a8eb6e8d02382e35537577f671eec7dc715feb5..82e11065af8d9a1925000451fdff0365f4c33223 100644 (file)
@@ -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",
index 6763f8e168f7cbef1e1e781680dfd22347d1fdcc..1b8a90c8b4d69acce78a396681f716c6e1890a80 100644 (file)
@@ -241,3 +241,7 @@ class _PackageMetadataWrapper(_PackageMetadataWrapperBase):
        @property
        def properties(self):
                return self['PROPERTIES'].split()
+
+       @property
+       def restrict(self):
+               return self['RESTRICT'].split()
index 2d9c5040584bff28a31b1dbaad00b5731dd9d54e..9e5ddac288c0c442522943c1a887026c3c8f7712 100644 (file)
@@ -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