summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorQue Quotion2019-02-14 18:03:32 +0900
committerQue Quotion2019-02-14 18:03:32 +0900
commitf4159befcaefc1b585c7fb5b5d9ee6fee0f8a559 (patch)
tree51e3f5baa8281d9739ff93bde72455e9a72904ba
parentfc17140a252dfd8e720394262a2f771fe9b12398 (diff)
downloadaur-f4159befcaefc1b585c7fb5b5d9ee6fee0f8a559.tar.gz
Warn about skipping binaries with filetypes that may not support UPX compression.
-rw-r--r--.SRCINFO2
-rw-r--r--PKGBUILD2
-rw-r--r--upx.sh.in16
3 files changed, 13 insertions, 7 deletions
diff --git a/.SRCINFO b/.SRCINFO
index 3241dc355854..c83f5089c74c 100644
--- a/.SRCINFO
+++ b/.SRCINFO
@@ -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
diff --git a/PKGBUILD b/PKGBUILD
index a02d2e1e0bd2..25eb0b00cc4a 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -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
}