[pacman-dev] FS #6246 - makepkg fails if the extensions is wrong on the archive

Johannes Weiner hannes at saeurebad.de
Mon Jan 22 12:52:31 EST 2007


Hi,

Signed-off-by: Johannes Weiner <hannes at saeurebad.de>
-------------- next part --------------
diff -Naur pacman-lib.old/scripts/makepkg pacman-lib/scripts/makepkg
--- pacman-lib.old/scripts/makepkg	2007-01-22 18:47:24.000000000 +0100
+++ pacman-lib/scripts/makepkg	2007-01-22 18:50:13.000000000 +0100
@@ -682,21 +682,25 @@
 		unziphack=0
 		file=$(strip_url "$netfile")
 		# fix flyspray #6246
-		file_type=$(file -biz "$file")
 		unset cmd
-		case "$file_type" in
-			*application/x-tar*)
+		case $(file -biz $netfile) in
+		    application/x-tar*)
 			cmd="tar -xf $file" ;;
-			*application/x-zip*)
+		    *application/x-zip*)
 			unziphack=1
 			cmd="unzip -qqo $file" ;;
-			*application/x-cpio*)
-			cmd="bsdtar -x -f $file" ;;
-			*application/x-gzip*)
-			cmd="gunzip -f $file" ;;
-			*application/x-bzip*)
-			cmd="bunzip2 -f $file" ;;
+		    application/x-cpio)
+			cmd="cpio --quiet -i < $file" ;;
+		    appcication/x-cpio*x-bzip2)
+			cmd="bunzip2 -c $file | cpio --quiet -i" ;;
+		    application/x-cpio*x-gzip)
+			cmd="gunzip -c $file | cpio --quiet -i" ;;
+		    application/x-bzip2)
+			cmd="bunzip2 $file" ;;
+		    application/x-gzip)
+			cmd="gunzip $file" ;;
 		esac
+
 		if [ "$cmd" != "" ]; then
 			msg2 "$cmd"
 			$cmd


More information about the pacman-dev mailing list