diff options
author | Que Quotion | 2019-02-14 18:03:32 +0900 |
---|---|---|
committer | Que Quotion | 2019-02-14 18:03:32 +0900 |
commit | f4159befcaefc1b585c7fb5b5d9ee6fee0f8a559 (patch) | |
tree | 51e3f5baa8281d9739ff93bde72455e9a72904ba | |
parent | fc17140a252dfd8e720394262a2f771fe9b12398 (diff) | |
download | aur-f4159befcaefc1b585c7fb5b5d9ee6fee0f8a559.tar.gz |
Warn about skipping binaries with filetypes that may not support UPX compression.
-rw-r--r-- | .SRCINFO | 2 | ||||
-rw-r--r-- | PKGBUILD | 2 | ||||
-rw-r--r-- | upx.sh.in | 16 |
3 files changed, 13 insertions, 7 deletions
@@ -1,6 +1,6 @@ pkgbase = makepkg-optimize pkgdesc = Supplemental build and packaging optimizations for makepkg - pkgver = 5 + pkgver = 6 pkgrel = 1 url = https://wiki.archlinux.org/index.php/Makepkg-optimize arch = any @@ -2,7 +2,7 @@ # Contributor: bartus ( aur\at\bartus.33mail.com ) pkgname=makepkg-optimize -pkgver=5 +pkgver=6 pkgrel=1 pkgdesc='Supplemental build and packaging optimizations for makepkg' arch=('any') diff --git a/upx.sh.in b/upx.sh.in index 4cfaeb0d692b..6b45565a1928 100644 --- a/upx.sh.in +++ b/upx.sh.in @@ -19,12 +19,18 @@ 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 - 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\//}" + if [[ $(file --brief --mime-type "$binary") == application* ]] ; then + case "$(file --brief --mime-type "$binary")" in + 'application/x-executable' | 'application/x-dosexec') # | 'application/x-pie-executable') + upx "${UPXFLAGS[@]}" "$binary" &>/dev/null || + warning "$(gettext "Could not compress binary : %s")" "${binary/$pkgdir\//}" ;; - esac + *) + warning "$(gettext "Not compressing %s, $(file --brief --mime-type "$binary")")" \ + "${binary/$pkgdir\//}" + ;; + esac + fi done fi } |