c7c6ba1ff6
Copy from Base:System/gzip based on submit request 30400 from user mseben OBS-URL: https://build.opensuse.org/request/show/30400 OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/gzip?expand=0&rev=13
25 lines
612 B
Diff
25 lines
612 B
Diff
Index: zgrep.in
|
|
===================================================================
|
|
--- zgrep.in.orig
|
|
+++ zgrep.in
|
|
@@ -148,10 +148,18 @@ res=0
|
|
|
|
for i
|
|
do
|
|
+ case $i in
|
|
+ *.bz2)
|
|
+ uncompress=bzip2
|
|
+ ;;
|
|
+ *)
|
|
+ uncompress=gzip
|
|
+ ;;
|
|
+ esac
|
|
# Fail if gzip or grep (or sed) fails.
|
|
gzip_status=$(
|
|
exec 5>&1
|
|
- (gzip -cdfq -- "$i" 5>&-; echo $? >&5) 3>&- |
|
|
+ ($uncompress -cdfq -- "$i" 5>&-; echo $? >&5) 3>&- |
|
|
if test $files_with_matches -eq 1; then
|
|
eval "$grep" >/dev/null && { printf '%s\n' "$i" || exit 2; }
|
|
elif test $files_without_matches -eq 1; then
|