Add -k (keep) option to the bunzip2/xz commands and make gunzip
decompressing to stdout, because it does not offer something like a
-k option.

Signed-off-by: Cedric Staniewski <[email protected]>
---
 scripts/makepkg.sh.in |   12 ++++++------
 1 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/scripts/makepkg.sh.in b/scripts/makepkg.sh.in
index 56ad2c0..2f1db38 100644
--- a/scripts/makepkg.sh.in
+++ b/scripts/makepkg.sh.in
@@ -644,13 +644,13 @@ extract_sources() {
                local cmd=''
                case "$file_type" in
                        
*application/x-tar*|*application/zip*|*application/x-zip*|*application/x-cpio*)
-                               cmd="bsdtar -x -f" ;;
+                               cmd="bsdtar -x -f '$file'" ;;
                        *application/x-gzip*)
-                               cmd="gunzip -d -f" ;;
+                               cmd="gunzip -c -f '$file' > '${file%.*}'" ;;
                        *application/x-bzip*)
-                               cmd="bunzip2 -f" ;;
+                               cmd="bunzip2 -f -k '$file'" ;;
                        *application/x-xz*)
-                               cmd="xz -d -f" ;;
+                               cmd="xz -d -f -k '$file'" ;;
                        *)
                                # Don't know what to use to extract this file,
                                # skip to the next file
@@ -658,8 +658,8 @@ extract_sources() {
                esac
 
                local ret=0
-               msg2 '%s' "$cmd \"$file\""
-               $cmd "$file" || ret=$?
+               msg2 '%s' "$cmd"
+               eval $cmd || ret=$?
                if [ $ret -ne 0 ]; then
                        error "$(gettext "Failed to extract %s")" "$file"
                        plain "$(gettext "Aborting...")"
-- 
1.6.4

_______________________________________________
pacman-dev mailing list
[email protected]
http://www.archlinux.org/mailman/listinfo/pacman-dev

Reply via email to