diff options
author | Zac Medico <zmedico@gentoo.org> | 2008-11-20 02:40:33 +0000 |
---|---|---|
committer | Zac Medico <zmedico@gentoo.org> | 2008-11-20 02:40:33 +0000 |
commit | 68e08c0e8da12147e84938f59e72fbb93014120a (patch) | |
tree | a2918ec357a13def4e63a796e8f87f7f3caade73 /pym/_emerge | |
parent | 273b8f499f2e24b840f1efe96c63892d3919a009 (diff) | |
download | portage-68e08c0e8da12147e84938f59e72fbb93014120a.tar.gz portage-68e08c0e8da12147e84938f59e72fbb93014120a.tar.bz2 portage-68e08c0e8da12147e84938f59e72fbb93014120a.zip |
Bug #247370 - Use a private PORTAGE_TMPDIR for --fetchonly mode in order
do avoid locking the normal build dir location (similar to bug #245231).
The EbuildFetchPretend class is renamed to EbuildFetchonly and it's used
for --fetchonly mode regardless of whether --pretend is enabled. Also,
fix stdout/stderr flushing in JobStatusDisplay.displayMessage() and
portage.spawn() to ensure output always occurs in the correct order when
displaying pkg_nofetch() output in --fetchonly mode. (trunk r12006)
svn path=/main/branches/2.1.6/; revision=12007
Diffstat (limited to 'pym/_emerge')
-rw-r--r-- | pym/_emerge/__init__.py | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/pym/_emerge/__init__.py b/pym/_emerge/__init__.py index cf4569f54..d2a798608 100644 --- a/pym/_emerge/__init__.py +++ b/pym/_emerge/__init__.py @@ -1564,9 +1564,9 @@ class _PackageMetadataWrapper(_PackageMetadataWrapperBase): v = 0 self._pkg.mtime = v -class EbuildFetchPretend(SlotObject): +class EbuildFetchonly(SlotObject): - __slots__ = ("fetch_all", "pkg", "settings") + __slots__ = ("fetch_all", "pkg", "pretend", "settings") def execute(self): # To spawn pkg_nofetch requires PORTAGE_BUILDDIR for @@ -1602,9 +1602,13 @@ class EbuildFetchPretend(SlotObject): retval = portage.doebuild(ebuild_path, "fetch", self.settings["ROOT"], self.settings, debug=debug, - listonly=1, fetchonly=1, fetchall=self.fetch_all, + listonly=self.pretend, fetchonly=1, fetchall=self.fetch_all, mydbapi=portdb, tree="porttree") + if retval != os.EX_OK: + msg = "Fetch failed for '%s'" % (pkg.cpv,) + eerror(msg, phase="unpack", key=pkg.cpv) + portage.elog.elog_process(self.pkg.cpv, self.settings) return retval @@ -2474,10 +2478,11 @@ class EbuildBuild(CompositeTask): pkg = self.pkg settings = self.settings - if opts.fetchonly and opts.pretend: - fetcher = EbuildFetchPretend( + if opts.fetchonly: + fetcher = EbuildFetchonly( fetch_all=opts.fetch_all_uri, - pkg=pkg, settings=settings) + pkg=pkg, pretend=opts.pretend, + settings=settings) retval = fetcher.execute() self.returncode = retval self.wait() @@ -8900,6 +8905,7 @@ class JobStatusDisplay(object): self._erase() self.out.write(self._format_msg(msg) + self._term_codes['newline']) + self.out.flush() self._displayed = False if was_displayed: |