summaryrefslogtreecommitdiffhomepage
path: root/patches/bzip2/bzip2-1.0.4-POSIX-shell.patch
diff options
context:
space:
mode:
authorLucio Andrés Illanes Albornoz (arab, vxp) <l.illanes@gmx.de>2017-01-23 18:11:59 +0000
committerLucio Andrés Illanes Albornoz (arab, vxp) <l.illanes@gmx.de>2017-01-23 18:12:18 +0000
commit854ef8a8887d586e747ec625e4e80970eedc04d2 (patch)
treecd323d83489bd5a9fdf45fcacec813c44677d7f6 /patches/bzip2/bzip2-1.0.4-POSIX-shell.patch
parentb5933a508096cb77de8e1fedab23c97aec9d4626 (diff)
downloadmidipix_build-854ef8a8887d586e747ec625e4e80970eedc04d2.tar.bz2
midipix_build-854ef8a8887d586e747ec625e4e80970eedc04d2.tar.xz
patches/bzip2/*: integrates patches from <http://git.alpinelinux.org/cgit/aports/tree/main/bzip2> (via Redfoxmoon.)
Diffstat (limited to 'patches/bzip2/bzip2-1.0.4-POSIX-shell.patch')
-rw-r--r--patches/bzip2/bzip2-1.0.4-POSIX-shell.patch21
1 files changed, 21 insertions, 0 deletions
diff --git a/patches/bzip2/bzip2-1.0.4-POSIX-shell.patch b/patches/bzip2/bzip2-1.0.4-POSIX-shell.patch
new file mode 100644
index 00000000..a5916eaf
--- /dev/null
+++ b/patches/bzip2/bzip2-1.0.4-POSIX-shell.patch
@@ -0,0 +1,21 @@
+bzgrep uses !/bin/sh but then uses the bashism ${var//} so replace those
+with calls to sed so POSIX shells work
+
+http://bugs.gentoo.org/193365
+
+--- ./bzgrep
++++ ./bzgrep
+@@ -63,10 +63,9 @@
+ bzip2 -cdfq "$i" | $grep $opt "$pat"
+ r=$?
+ else
+- j=${i//\\/\\\\}
+- j=${j//|/\\|}
+- j=${j//&/\\&}
+- j=`printf "%s" "$j" | tr '\n' ' '`
++ # the backslashes here are doubled up as we have to escape each one for the
++ # shell and then escape each one for the sed expression
++ j=`printf "%s" "${i}" | sed -e 's:\\\\:\\\\\\\\:g' -e 's:[|]:\\\\|:g' -e 's:[&]:\\\\&:g' | tr '\n' ' '`
+ bzip2 -cdfq "$i" | $grep $opt "$pat" | sed "s|^|${j}:|"
+ r=$?
+ fi