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 /upx.sh.in | |
parent | fc17140a252dfd8e720394262a2f771fe9b12398 (diff) | |
download | aur-f4159befcaefc1b585c7fb5b5d9ee6fee0f8a559.tar.gz |
Warn about skipping binaries with filetypes that may not support UPX compression.
Diffstat (limited to 'upx.sh.in')
-rw-r--r-- | upx.sh.in | 16 |
1 files changed, 11 insertions, 5 deletions
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 } |