From: Zac Medico Date: Tue, 27 Nov 2012 05:34:24 +0000 (-0800) Subject: Package: add defined_phases, properties, restrict X-Git-Tag: v2.2.0_alpha143~9 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=b56487d85a1dbfce3d286c3c22774655f7fdbf06;p=portage.git Package: add defined_phases, properties, restrict --- diff --git a/pym/_emerge/EbuildBuild.py b/pym/_emerge/EbuildBuild.py index 2da09e7f3..cec63d992 100644 --- a/pym/_emerge/EbuildBuild.py +++ b/pym/_emerge/EbuildBuild.py @@ -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 diff --git a/pym/_emerge/Package.py b/pym/_emerge/Package.py index 7950ffb81..602fea80e 100644 --- a/pym/_emerge/Package.py +++ b/pym/_emerge/Package.py @@ -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", diff --git a/pym/_emerge/Scheduler.py b/pym/_emerge/Scheduler.py index 72f1943e8..708af12c6 100644 --- a/pym/_emerge/Scheduler.py +++ b/pym/_emerge/Scheduler.py @@ -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" diff --git a/pym/_emerge/resolver/output.py b/pym/_emerge/resolver/output.py index 1fdc08def..3d6af66d4 100644 --- a/pym/_emerge/resolver/output.py +++ b/pym/_emerge/resolver/output.py @@ -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: