Merged from trunk -r15815:15825
authorFabian Groffen <grobian@gentoo.org>
Sat, 20 Mar 2010 18:30:18 +0000 (18:30 -0000)
committerFabian Groffen <grobian@gentoo.org>
Sat, 20 Mar 2010 18:30:18 +0000 (18:30 -0000)
   | 15820   | Bug #309001 - Only trust tar exit status (ignore             |
   | zmedico | decompressor exit status) when unpacking tar files.          |

   | 15821   | Trust tar exit status and ignore bzip2 exit status as in bug |
   | zmedico | #309001.                                                     |

   | 15822   | Simplyfy the virtual.exists check, and avoid deprecation     |
   | zmedico | warning triggered by cpv_getkey called on an empty string.   |

   | 15823   | Bug #309001 - Use signal(signal.SIGPIPE, signal.SIG_DFL) for |
   | zmedico | quiet killing of subprocesses by SIGPIPE (as emerge has for  |
   |         | a long time). Thanks to Harald van Dijk truedfx@g.o for this |
   |         | patch.                                                       |

   | 15824   | Add references to bug #309001 in comments about SIGPIPE      |
   | zmedico | handling.                                                    |

   | 15825   | Bug #309001 - Install a SIGPIPE handler inside _exec for all |
   | zmedico | forked processes.                                            |

svn path=/main/branches/prefix/; revision=15836

bin/ebuild
bin/ebuild.sh
bin/emerge
bin/repoman
pym/_emerge/BinpkgExtractorAsync.py
pym/portage/process.py

index 9b64f42cd9ef2a95a543cfa191e910be7da9e113..9c6b8fefb921f62a150498b0d65c9d70af5363fe 100755 (executable)
@@ -17,6 +17,8 @@ try:
 
        signal.signal(signal.SIGINT, exithandler)
        signal.signal(signal.SIGTERM, exithandler)
+       # Quiet killing of subprocesses by SIGPIPE (see bug #309001).
+       signal.signal(signal.SIGPIPE, signal.SIG_DFL)
 
 except KeyboardInterrupt:
        sys.exit(1)
index 3d6f2ef289c4ff6513fb0f196c022b774cd1a7e2..5e217b7311f59dc9c4e75eba7aac49caafcec082 100755 (executable)
@@ -362,8 +362,7 @@ unpack() {
 
                _unpack_tar() {
                        if [ "${y}" == "tar" ]; then
-                               $1 -dc "$srcdir$x" | tar xof -
-                               assert "$myfail"
+                               $1 -dc "$srcdir$x" | tar xof - || die "$myfail"
                        else
                                $1 -dc "${srcdir}${x}" > ${x%.*} || die "$myfail"
                        fi
@@ -378,8 +377,7 @@ unpack() {
                                tar xozf "$srcdir$x" || die "$myfail"
                                ;;
                        tbz|tbz2)
-                               bzip2 -dc "$srcdir$x" | tar xof -
-                               assert "$myfail"
+                               bzip2 -dc "$srcdir$x" | tar xof - || die "$myfail"
                                ;;
                        ZIP|zip|jar)
                                unzip -qo "${srcdir}${x}" || die "$myfail"
index 05ed9ae91de9d4031b5912daf8d4e1f90a04b02a..e88d43e04f7642d734bdad6713b520508889db70 100755 (executable)
@@ -17,6 +17,7 @@ try:
 
        signal.signal(signal.SIGINT, exithandler)
        signal.signal(signal.SIGTERM, exithandler)
+       # Quiet killing of subprocesses by SIGPIPE (see bug #309001).
        signal.signal(signal.SIGPIPE, signal.SIG_DFL)
 
 except KeyboardInterrupt:
index 4cdeae5de7e1894115b136b86a573f6643fa2e4f..13beaa29e5f01fbec55f89a3419600b21af72d54 100755 (executable)
@@ -1419,9 +1419,7 @@ for x in scanlist:
                        if prov_cp != myprovide:
                                stats["virtual.versioned"]+=1
                                fails["virtual.versioned"].append(x+"/"+y+".ebuild: "+myprovide)
-                       prov_pkg = portage.cpv_getkey(
-                               portage.best(portdb.xmatch("match-all", prov_cp)))
-                       if prov_cp == prov_pkg:
+                       if portdb.cp_list(prov_cp):
                                stats["virtual.exists"]+=1
                                fails["virtual.exists"].append(x+"/"+y+".ebuild: "+prov_cp)
 
index 45af54136be44b610273b59c3bb89314f3782ba1..e646d9c1b03e29d28726c6a27244ba13d4426a51 100644 (file)
@@ -20,13 +20,7 @@ class BinpkgExtractorAsync(SpawnProcess):
 
        def _start(self):
                self.args = [self._shell_binary, "-c",
-                       ("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 ;") % \
+                       ("bzip2 -dqc -- %s | tar -xp -C %s -f -") % \
                        (portage._shell_quote(self.pkg_path),
                        portage._shell_quote(self.image_dir))]
 
index e7f09cd2d212a5c37b10a17746a0ad1b5b77ec0c..703e7cc9f0acadfa9187a800381e8f4307ae5c86 100644 (file)
@@ -343,6 +343,9 @@ def _exec(binary, mycommand, opt_name, fd_pipes, env, gid, groups, uid, umask,
        myargs = [opt_name]
        myargs.extend(mycommand[1:])
 
+       # Quiet killing of subprocesses by SIGPIPE (see bug #309001).
+       signal.signal(signal.SIGPIPE, signal.SIG_DFL)
+
        # Set up the command's pipes.
        my_fds = {}
        # To protect from cases where direct assignment could