[pacman-dev] CVS update of pacman-lib/scripts (makepkg)

Aaron Griffin aaron at archlinux.org
Mon Jan 22 03:45:12 EST 2007


    Date: Monday, January 22, 2007 @ 03:45:12
  Author: aaron
    Path: /home/cvs-pacman/pacman-lib/scripts

Modified: makepkg (1.29 -> 1.30)

makepkg file-type detection changes from James Rosten <seinfeld90 at gmail.com>
    and Johannes Weiner <hannes at saeurebad.de>

This should fix FS#6246


---------+
 makepkg |   20 ++++++++------------
 1 file changed, 8 insertions(+), 12 deletions(-)


Index: pacman-lib/scripts/makepkg
diff -u pacman-lib/scripts/makepkg:1.29 pacman-lib/scripts/makepkg:1.30
--- pacman-lib/scripts/makepkg:1.29	Wed Jan 17 00:29:54 2007
+++ pacman-lib/scripts/makepkg	Mon Jan 22 03:45:12 2007
@@ -681,24 +681,20 @@
 	for netfile in "${source[@]}"; do
 		unziphack=0
 		file=$(strip_url "$netfile")
+		# fix flyspray #6246
+		file_type=$(file -biz "$file")
 		unset cmd
-		case "$(echo $file |tr "A-Z" "a-z")" in
-			*.tar.gz|*.tar.z|*.tgz)
-			cmd="tar --use-compress-program=gzip -xf $file" ;;
-			*.tar.bz2|*.tbz2)
-			cmd="tar --use-compress-program=bzip2 -xf $file" ;;
-			*.tar)
+		case "$file_type" in
+			*application/x-tar*)
 			cmd="tar -xf $file" ;;
-			*.zip)
+			*application/x-zip*)
 			unziphack=1
 			cmd="unzip -qqo $file" ;;
-			*.cpio.gz)
+			*application/x-cpio*)
 			cmd="bsdtar -x -f $file" ;;
-			*.cpio.bz2)
-			cmd="bsdtar -x -f $file" ;;
-			*.gz)
+			*application/x-gzip*)
 			cmd="gunzip -f $file" ;;
-			*.bz2)
+			*application/x-bzip*)
 			cmd="bunzip2 -f $file" ;;
 		esac
 		if [ "$cmd" != "" ]; then




More information about the pacman-dev mailing list