diff options
author | David Macek <david.macek.0@gmail.com> | 2015-03-01 21:43:40 +0100 |
---|---|---|
committer | Allan McRae <allan@archlinux.org> | 2015-03-03 16:54:17 +1000 |
commit | ff8de12151047ccf9b0640480bfc624892a5ab7a (patch) | |
tree | 37fb52ae18761bc0aece535b3b805a1cb8a6a291 | |
parent | 965539adbf15449533bc5fcb353774f7a4b62277 (diff) | |
download | pacman-ff8de12151047ccf9b0640480bfc624892a5ab7a.tar.xz |
Allow UPX compression for DOS/Win executables
Hi. This change allows makepkg to UPX-compress executables on Windows, but will probably affect some Linux packages as well (I'm guessing gdbserver, wine, mingw-w64).
Signed-off-by: Allan McRae <allan@archlinux.org>
-rw-r--r-- | scripts/libmakepkg/tidy/upx.sh.in | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/scripts/libmakepkg/tidy/upx.sh.in b/scripts/libmakepkg/tidy/upx.sh.in index ec40b2e2..49104658 100644 --- a/scripts/libmakepkg/tidy/upx.sh.in +++ b/scripts/libmakepkg/tidy/upx.sh.in @@ -35,10 +35,12 @@ tidy_upx() { msg2 "$(gettext "Compressing binaries with %s...")" "UPX" local binary find . -type f -perm -u+w 2>/dev/null | while read -r binary ; do - if [[ $(file --brief --mime-type "$binary") = 'application/x-executable' ]]; then - upx "${UPXFLAGS[@]}" "$binary" &>/dev/null || + case "$(file --brief --mime-type "$binary")" in + 'application/x-executable' | 'application/x-dosexec') + upx "${UPXFLAGS[@]}" "$binary" &>/dev/null || warning "$(gettext "Could not compress binary : %s")" "${binary/$pkgdir\//}" - fi + ;; + esac done fi } |