From: Zac Medico Date: Thu, 9 Jun 2011 18:19:38 +0000 (-0700) Subject: SubProcess: fix status for _set_returncode caller X-Git-Tag: v2.2.0_alpha39~3 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=501eef33b5ac990ae4b164a27e635be34cb9d14d;p=portage.git SubProcess: fix status for _set_returncode caller These callers don't intend to make WIFSIGNALED return True, so they need to shift their codes 8 bits to the left. This ensures that commit 88f5bf84e2fd23125910b2ecaffc035971445696 behaves as intended. --- diff --git a/pym/_emerge/AbstractEbuildProcess.py b/pym/_emerge/AbstractEbuildProcess.py index 434878887..0d1d991d4 100644 --- a/pym/_emerge/AbstractEbuildProcess.py +++ b/pym/_emerge/AbstractEbuildProcess.py @@ -57,7 +57,7 @@ class AbstractEbuildProcess(SpawnProcess): "since PORTAGE_BUILDIR does not exist: '%s'") % \ (self.phase, self.settings['PORTAGE_BUILDDIR']) self._eerror(textwrap.wrap(msg, 72)) - self._set_returncode((self.pid, 1)) + self._set_returncode((self.pid, 1 << 8)) self.wait() return diff --git a/pym/_emerge/BinpkgFetcher.py b/pym/_emerge/BinpkgFetcher.py index 12544d1be..6c1dde93e 100644 --- a/pym/_emerge/BinpkgFetcher.py +++ b/pym/_emerge/BinpkgFetcher.py @@ -65,7 +65,7 @@ class BinpkgFetcher(SpawnProcess): if pretend: portage.writemsg_stdout("\n%s\n" % uri, noiselevel=-1) - self._set_returncode((self.pid, os.EX_OK)) + self._set_returncode((self.pid, os.EX_OK << 8)) self.wait() return diff --git a/pym/_emerge/EbuildFetcher.py b/pym/_emerge/EbuildFetcher.py index 0ea8dc775..c9a107dac 100644 --- a/pym/_emerge/EbuildFetcher.py +++ b/pym/_emerge/EbuildFetcher.py @@ -38,13 +38,13 @@ class EbuildFetcher(SpawnProcess): (self.pkg.cpv, e) msg_lines.append(msg) self._eerror(msg_lines) - self._set_returncode((self.pid, 1)) + self._set_returncode((self.pid, 1 << 8)) self.wait() return if not uri_map: # Nothing to fetch. - self._set_returncode((self.pid, os.EX_OK)) + self._set_returncode((self.pid, os.EX_OK << 8)) self.wait() return @@ -59,7 +59,7 @@ class EbuildFetcher(SpawnProcess): if self.prefetch and \ self._prefetch_size_ok(uri_map, settings, ebuild_path): self.config_pool.deallocate(settings) - self._set_returncode((self.pid, os.EX_OK)) + self._set_returncode((self.pid, os.EX_OK << 8)) self.wait() return diff --git a/pym/_emerge/EbuildMetadataPhase.py b/pym/_emerge/EbuildMetadataPhase.py index 5925ec462..284622d69 100644 --- a/pym/_emerge/EbuildMetadataPhase.py +++ b/pym/_emerge/EbuildMetadataPhase.py @@ -46,7 +46,7 @@ class EbuildMetadataPhase(SubProcess): if not portage.eapi_is_supported(eapi): self.metadata_callback(self.cpv, self.ebuild_path, self.repo_path, {'EAPI' : eapi}, self.ebuild_mtime) - self._set_returncode((self.pid, os.EX_OK)) + self._set_returncode((self.pid, os.EX_OK << 8)) self.wait() return @@ -98,7 +98,7 @@ class EbuildMetadataPhase(SubProcess): if isinstance(retval, int): # doebuild failed before spawning self._unregister() - self._set_returncode((self.pid, retval)) + self._set_returncode((self.pid, retval << 8)) self.wait() return diff --git a/pym/_emerge/SubProcess.py b/pym/_emerge/SubProcess.py index da2b301db..b99cf0bb1 100644 --- a/pym/_emerge/SubProcess.py +++ b/pym/_emerge/SubProcess.py @@ -87,7 +87,7 @@ class SubProcess(AbstractPollTask): if e.errno != errno.ECHILD: raise del e - self._set_returncode((self.pid, 1)) + self._set_returncode((self.pid, 1 << 8)) else: if wait_retval[0] != 0: self._set_returncode(wait_retval) @@ -98,7 +98,7 @@ class SubProcess(AbstractPollTask): if e.errno != errno.ECHILD: raise del e - self._set_returncode((self.pid, 1)) + self._set_returncode((self.pid, 1 << 8)) else: self._set_returncode(wait_retval)