From 7ed7977e6370989fb2de96b3e295109b1ed54b51 Mon Sep 17 00:00:00 2001 From: Aaron Griffin Date: Mon, 22 Jan 2007 08:45:12 +0000 Subject: makepkg file-type detection changes from James Rosten and Johannes Weiner This should fix FS#6246 --- scripts/makepkg | 20 ++++++++------------ 1 file changed, 8 insertions(+), 12 deletions(-) (limited to 'scripts/makepkg') diff --git a/scripts/makepkg b/scripts/makepkg index 7805822e..bbd3c73b 100755 --- a/scripts/makepkg +++ b/scripts/makepkg @@ -681,24 +681,20 @@ else 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 -- cgit v1.2.3-70-g09d2