diff options
author | Aaron Griffin <aaron@archlinux.org> | 2007-01-22 08:45:12 +0000 |
---|---|---|
committer | Aaron Griffin <aaron@archlinux.org> | 2007-01-22 08:45:12 +0000 |
commit | 7ed7977e6370989fb2de96b3e295109b1ed54b51 (patch) | |
tree | 16a2e4339294433825f0971297b23ce13a87e5c3 | |
parent | 35a9f3e7d0ffd6bfc6b8fa8d65ed5184eeadaaa4 (diff) |
makepkg file-type detection changes from James Rosten <seinfeld90@gmail.com>
and Johannes Weiner <hannes@saeurebad.de>
This should fix FS#6246
-rwxr-xr-x | scripts/makepkg | 20 |
1 files changed, 8 insertions, 12 deletions
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 |