[pacman-dev] [PATCH 1/2] makepkg: always keep sources symlinks

Cedric Staniewski cedric at gmx.ca
Wed Aug 5 10:12:46 EDT 2009


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 <cedric at gmx.ca>
---
 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



More information about the pacman-dev mailing list