As landry@ discovered, the bzgrep script contains a bashism.  I've
lifted a portable replacement from a newer version of GNU gzip's
zgrep script.

ok?

Index: Makefile
===================================================================
RCS file: /cvs/ports/archivers/bzip2/Makefile,v
retrieving revision 1.63
diff -u -p -r1.63 Makefile
--- Makefile    19 Mar 2014 13:40:59 -0000      1.63
+++ Makefile    23 May 2014 21:23:34 -0000
@@ -4,7 +4,7 @@ COMMENT=        block-sorting file compressor, 
 
 VERSION=       1.0.6
 DISTNAME=      bzip2-${VERSION}
-REVISION=      0
+REVISION=      1
 CATEGORIES=    archivers
 MASTER_SITES=  ${HOMEPAGE}${VERSION}/
 SHARED_LIBS=   bz2     10.4
Index: patches/patch-bzgrep
===================================================================
RCS file: patches/patch-bzgrep
diff -N patches/patch-bzgrep
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ patches/patch-bzgrep        23 May 2014 21:23:34 -0000
@@ -0,0 +1,20 @@
+$OpenBSD$
+--- bzgrep.orig        Wed Jan  3 03:00:55 2007
++++ bzgrep     Fri May 23 23:23:11 2014
+@@ -63,10 +63,12 @@ for i do
+     bzip2 -cdfq "$i" | $grep $opt "$pat"
+     r=$?
+   else
+-    j=${i//\\/\\\\}
+-    j=${j//|/\\|}
+-    j=${j//&/\\&}
+-    j=`printf "%s" "$j" | tr '\n' ' '`
++    j=$(printf '%s\n' "$i" |
++        sed '
++          $!N
++          $s/[&\|]/\\&/g
++          $s/\n/ /g
++        ')
+     bzip2 -cdfq "$i" | $grep $opt "$pat" | sed "s|^|${j}:|"
+     r=$?
+   fi
-- 
Christian "naddy" Weisgerber                          na...@mips.inka.de

Reply via email to