Hello community,

here is the log from the commit of package bzip2 for openSUSE:Factory checked 
in at 2016-04-03 23:04:53
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/bzip2 (Old)
 and      /work/SRC/openSUSE:Factory/.bzip2.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "bzip2"

Changes:
--------
--- /work/SRC/openSUSE:Factory/bzip2/bzip2.changes      2016-01-21 
23:40:19.000000000 +0100
+++ /work/SRC/openSUSE:Factory/.bzip2.new/bzip2.changes 2016-04-03 
23:04:54.000000000 +0200
@@ -1,0 +2,7 @@
+Thu Mar 24 15:44:52 UTC 2016 - kstreit...@suse.com
+
+- add bzip2-1.0.6-bzgrep_return_value.patch to fix bzgrep wrapper
+  that always returns 0 as an exit code when grepping multiple
+  archives [bsc#970260]
+
+-------------------------------------------------------------------

New:
----
  bzip2-1.0.6-bzgrep_return_value.patch

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ bzip2.spec ++++++
--- /var/tmp/diff_new_pack.ymrmD9/_old  2016-04-03 23:04:55.000000000 +0200
+++ /var/tmp/diff_new_pack.ymrmD9/_new  2016-04-03 23:04:55.000000000 +0200
@@ -35,6 +35,8 @@
 Patch2:         bzip2-unsafe_strcpy.patch
 Patch3:         bzip2-point-to-doc-pkg.patch
 Patch4:         bzip2-ocloexec.patch
+# PATCH-FIX-UPSTREAM bnc#970260 kstreit...@suse.comĀ -- fix a wrong exit code 
when grepping multiple archives
+Patch5:         bzip2-1.0.6-bzgrep_return_value.patch
 BuildRequires:  autoconf >= 2.57
 BuildRequires:  libtool
 BuildRequires:  pkg-config
@@ -80,6 +82,7 @@
 %patch2
 %patch3 -p1
 %patch4
+%patch5 -p1
 autoreconf -fiv
 
 %build

++++++ bzip2-1.0.6-bzgrep_return_value.patch ++++++
Index: bzip2-1.0.6/bzgrep
===================================================================
--- bzip2-1.0.6.orig/bzgrep
+++ bzip2-1.0.6/bzgrep
@@ -65,8 +65,20 @@ for i do
   else
     j=$(echo "$i" | sed 's/\\/&&/g;s/|/\\&/g;s/&/\\&/g')
     j=`printf "%s" "$j" | tr '\n' ' '`
-    bzip2 -cdfq "$i" | $grep $opt "$pat" | sed "s|^|${j}:|"
-    r=$?
+    # A trick adapted from
+    # 
https://groups.google.com/forum/#!original/comp.unix.shell/x1345iu10eg/Nn1n-1r1uU0J
+    # that has the same effect as the following bash code:
+    # bzip2 -cdfq "$i" | $grep $opt "$pat" | sed "s|^|${j}:|"
+    # r=${PIPESTATUS[1]}
+    exec 3>&1
+    eval `
+      exec 4>&1 >&3 3>&-
+      {
+        bzip2 -cdfq "$i" 4>&-
+      } | {
+        $grep $opt "$pat" 4>&-; echo "r=$?;" >&4
+      } | sed "s|^|${j}:|"
+    `
   fi
   test "$r" -ne 0 && res="$r"
 done



Reply via email to