[pacman-dev] [PATCH] Allow UPX compression for DOS/Win executables
David Macek
david.macek.0 at gmail.com
Sun Mar 1 20:43:40 UTC 2015
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).
---
scripts/libmakepkg/tidy/upx.sh.in | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/scripts/libmakepkg/tidy/upx.sh.in b/scripts/libmakepkg/tidy/upx.sh.in
index ec40b2e..d699f0f 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
+ 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
}
--
1.9.4.msysgit.2
--
David Macek
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 4234 bytes
Desc: S/MIME Cryptographic Signature
URL: <https://lists.archlinux.org/pipermail/pacman-dev/attachments/20150301/915dc11c/attachment.p7s>
More information about the pacman-dev
mailing list