Revert tar error handling changes from bug #309001 since we can't necessarily
authorZac Medico <zmedico@gentoo.org>
Sun, 14 Mar 2010 10:00:46 +0000 (10:00 -0000)
committerZac Medico <zmedico@gentoo.org>
Sun, 14 Mar 2010 10:00:46 +0000 (10:00 -0000)
trust tar exist status alone (reverts r15820 and r15821).

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

bin/ebuild.sh
pym/_emerge/BinpkgExtractorAsync.py

index d3470498d4d00411fb19c23d25749819a6fb396b..60c8f5e2297ecf8bc1ec54f1ad05d919f0c88563 100755 (executable)
@@ -356,7 +356,8 @@ unpack() {
 
                _unpack_tar() {
                        if [ "${y}" == "tar" ]; then
-                               $1 -dc "$srcdir$x" | tar xof - || die "$myfail"
+                               $1 -dc "$srcdir$x" | tar xof -
+                               assert "$myfail"
                        else
                                $1 -dc "${srcdir}${x}" > ${x%.*} || die "$myfail"
                        fi
@@ -371,7 +372,8 @@ unpack() {
                                tar xozf "$srcdir$x" || die "$myfail"
                                ;;
                        tbz|tbz2)
-                               bzip2 -dc "$srcdir$x" | tar xof - || die "$myfail"
+                               bzip2 -dc "$srcdir$x" | tar xof -
+                               assert "$myfail"
                                ;;
                        ZIP|zip|jar)
                                unzip -qo "${srcdir}${x}" || die "$myfail"
index 0c6e89196f07ea692135efc7d66bec1fa9ddbdb3..d9416643a2f2a81aff54cc8d1f73120f64fb6344 100644 (file)
@@ -14,7 +14,13 @@ class BinpkgExtractorAsync(SpawnProcess):
 
        def _start(self):
                self.args = [self._shell_binary, "-c",
-                       ("bzip2 -dqc -- %s | tar -xp -C %s -f -") % \
+                       ("bzip2 -dqc -- %s | tar -xp -C %s -f - ; " + \
+                       "p=(${PIPESTATUS[@]}) ; " + \
+                       "if [ ${p[0]} != 0 ] ; then " + \
+                       "echo bzip2 failed with status ${p[0]} ; exit ${p[0]} ; fi ; " + \
+                       "if [ ${p[1]} != 0 ] ; then " + \
+                       "echo tar failed with status ${p[1]} ; exit ${p[1]} ; fi ; " + \
+                       "exit 0 ;") % \
                        (portage._shell_quote(self.pkg_path),
                        portage._shell_quote(self.image_dir))]