Package: add defined_phases, properties, restrict
authorZac Medico <zmedico@gentoo.org>
Tue, 27 Nov 2012 05:34:24 +0000 (21:34 -0800)
committerZac Medico <zmedico@gentoo.org>
Tue, 27 Nov 2012 05:34:24 +0000 (21:34 -0800)
pym/_emerge/EbuildBuild.py
pym/_emerge/Package.py
pym/_emerge/Scheduler.py
pym/_emerge/resolver/output.py

index 2da09e7f3f93f01eb2b6e6672115bc69b71710df..cec63d992b841a44dae1c80fce1fc81e77bc774a 100644 (file)
@@ -260,8 +260,8 @@ class EbuildBuild(CompositeTask):
                # to be displayed for problematic packages even though they do
                # not set RESTRICT=fetch (bug #336499).
 
-               if 'fetch' not in self.pkg._metadata.restrict and \
-                       'nofetch' not in self.pkg._metadata.defined_phases:
+               if 'fetch' not in self.pkg.restrict and \
+                       'nofetch' not in self.pkg.defined_phases:
                        self._unlock_builddir()
                        self.wait()
                        return
index 7950ffb815fd7ce7b444ce54f74e416e0f113a53..602fea80ef3fa30fbd20b9ff58ecefd48103ac33 100644 (file)
@@ -108,6 +108,18 @@ class Package(Task):
        def eapi(self):
                return self._metadata["EAPI"]
 
+       @property
+       def defined_phases(self):
+               return self._metadata.defined_phases
+
+       @property
+       def properties(self):
+               return self._metadata.properties
+
+       @property
+       def restrict(self):
+               return self._metadata.restrict
+
        @property
        def metadata(self):
                warnings.warn("_emerge.Package.Package.metadata is deprecated",
index 72f1943e8d29358427bc4f80a6ecc0d5a5a8881e..708af12c610b445e574113539d0c62ac66c1525e 100644 (file)
@@ -409,7 +409,7 @@ class Scheduler(PollScheduler):
                        if not (isinstance(task, Package) and \
                                task.operation == "merge"):
                                continue
-                       if 'interactive' in task._metadata.properties:
+                       if 'interactive' in task.properties:
                                interactive_tasks.append(task)
                return interactive_tasks
 
@@ -786,7 +786,7 @@ class Scheduler(PollScheduler):
                        if x.eapi in ("0", "1", "2", "3"):
                                continue
 
-                       if "pretend" not in x._metadata.defined_phases:
+                       if "pretend" not in x.defined_phases:
                                continue
 
                        out_str =">>> Running pre-merge checks for " + colorize("INFORM", x.cpv) + "\n"
index 1fdc08def0e3920383f1fc0245a756221d46f9a9..3d6af66d4dcb246eb2a7265cc36cef60ed1c24be 100644 (file)
@@ -651,7 +651,7 @@ class Display(object):
                        pkg_info.repo_path_real = self.portdb.getRepositoryPath(pkg.repo)
                pkg_info.use = list(self.conf.pkg_use_enabled(pkg))
                if not pkg.built and pkg.operation == 'merge' and \
-                       'fetch' in pkg._metadata.restrict:
+                       'fetch' in pkg.restrict:
                        if pkg_info.ordered:
                                self.counters.restrict_fetch += 1
                        pkg_info.attr_display.fetch_restrict = True
@@ -853,7 +853,7 @@ class Display(object):
                                pkg_info.oldbest = self.convert_myoldbest(pkg, pkg_info)
                                pkg_info.system, pkg_info.world = \
                                        self.check_system_world(pkg)
-                               if 'interactive' in pkg._metadata.properties and \
+                               if 'interactive' in pkg.properties and \
                                        pkg.operation == 'merge':
                                        pkg_info.attr_display.interactive = True
                                        if ordered: