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

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

pym/_emerge/Package.py
pym/_emerge/Scheduler.py
pym/_emerge/depgraph.py

index 88adbf55fff79f496b6efc00f381ce630d26b5e9..6763f8e168f7cbef1e1e781680dfd22347d1fdcc 100644 (file)
@@ -237,3 +237,7 @@ class _PackageMetadataWrapper(_PackageMetadataWrapperBase):
                        except ValueError:
                                v = 0
                self._pkg.mtime = v
+
+       @property
+       def properties(self):
+               return self['PROPERTIES'].split()
index b63245cda47e927fe5ad77429eb2da59f5f1e50a..34476d86c5a0296f8b856717934e691476549a1f 100644 (file)
@@ -328,14 +328,7 @@ class Scheduler(PollScheduler):
                        if not (isinstance(task, Package) and \
                                task.operation == "merge"):
                                continue
-                       try:
-                               properties = flatten(use_reduce(paren_reduce(
-                                       task.metadata["PROPERTIES"]), uselist=task.use.enabled))
-                       except portage.exception.InvalidDependString, e:
-                               show_invalid_depstring_notice(task,
-                                       task.metadata["PROPERTIES"], str(e))
-                               raise self._unknown_internal_error()
-                       if "interactive" in properties:
+                       if 'interactive' in task.metadata.properties:
                                interactive_tasks.append(task)
                return interactive_tasks
 
index e69a2027859f72d803f80ff4b69e4420319a3557..2d9c5040584bff28a31b1dbaad00b5731dd9d54e 100644 (file)
@@ -4007,18 +4007,8 @@ class depgraph(object):
                                                else:
                                                        return colorize("PKG_NOMERGE", pkg_str)
 
-                               try:
-                                       properties = flatten(use_reduce(paren_reduce(
-                                               pkg.metadata["PROPERTIES"]), uselist=pkg.use.enabled))
-                               except portage.exception.InvalidDependString, e:
-                                       if not pkg.installed:
-                                               show_invalid_depstring_notice(pkg,
-                                                       pkg.metadata["PROPERTIES"], str(e))
-                                               del e
-                                               return 1
-                                       properties = []
-                               interactive = "interactive" in properties
-                               if interactive and pkg.operation == "merge":
+                               if 'interactive' in pkg.metadata.properties and \
+                                       pkg.operation == 'merge':
                                        addl = colorize("WARN", "I") + addl[1:]
                                        if ordered:
                                                counters.interactive += 1