diff options
-rw-r--r-- | .SRCINFO | 6 | ||||
-rw-r--r-- | PKGBUILD | 6 | ||||
-rw-r--r-- | optipng.sh.in | 6 | ||||
-rw-r--r-- | svgo.sh.in | 6 | ||||
-rw-r--r-- | upx.sh.in | 25 |
5 files changed, 27 insertions, 22 deletions
@@ -39,9 +39,9 @@ pkgbase = makepkg-optimize sha1sums = a893c32f2a3fff8b279025ec60f0c3d88143dc1e sha1sums = 9270b5e33d4508a959688a10c20dec3732763937 sha1sums = 34a33b47a8b667f9dc810737c0f598660b962d4c - sha1sums = 68292bac87e22885069330dbdc198e13be88ab95 - sha1sums = 5801de7cd6e2bd462b7e051aa3aa818a30dc7af5 - sha1sums = 368342c7891345bdbcc4c21e79aa4840ab5b76b9 + sha1sums = fb3ab1f7d341efc421e5def39b48eb67f25e93a4 + sha1sums = 3f961ecc06c5bf24b5439be902f7eadbfcf0a629 + sha1sums = 038b4c0a36ba06614ae3205338e970e678efb6d8 sha1sums = 4d11331aeff1c1ec3de3759710acc060769ef274 sha1sums = 83a6d62b19184cac1de02c957cd4ea7bbdac9ddb sha1sums = dea4d727d81ac040846555e59ac7c34eb0978233 @@ -26,9 +26,9 @@ sha1sums=('a9af81c30f57b7db6a9a52796d79399a4e754791' 'a893c32f2a3fff8b279025ec60f0c3d88143dc1e' '9270b5e33d4508a959688a10c20dec3732763937' '34a33b47a8b667f9dc810737c0f598660b962d4c' - '68292bac87e22885069330dbdc198e13be88ab95' - '5801de7cd6e2bd462b7e051aa3aa818a30dc7af5' - '368342c7891345bdbcc4c21e79aa4840ab5b76b9' + 'fb3ab1f7d341efc421e5def39b48eb67f25e93a4' + '3f961ecc06c5bf24b5439be902f7eadbfcf0a629' + '038b4c0a36ba06614ae3205338e970e678efb6d8' '4d11331aeff1c1ec3de3759710acc060769ef274' '83a6d62b19184cac1de02c957cd4ea7bbdac9ddb' 'dea4d727d81ac040846555e59ac7c34eb0978233' diff --git a/optipng.sh.in b/optipng.sh.in index 9fb6c7ded6c7..39136cb167d6 100644 --- a/optipng.sh.in +++ b/optipng.sh.in @@ -19,10 +19,12 @@ tidy_optipng() { msg2 "$(gettext "Optimizing PNG images...")" local png find . -type f -iname "*.png" 2>/dev/null | while read -r png ; do + [ $(jobs -p|wc -l) -gt $(nproc) ] && wait -n if [[ $(file --brief --mime-type "$png") = 'image/png' ]]; then - optipng "${OPTIPNGFLAGS[@]}" "$png" &>/dev/null || - warning "$(gettext "Could not optimize PNG image : %s")" "${png/$pkgdir\//}" + { optipng "${OPTIPNGFLAGS[@]}" "$png" &>/dev/null || + warning "$(gettext "Could not optimize PNG image : %s")" "${png/$pkgdir\//}"; } & fi done + wait fi } diff --git a/svgo.sh.in b/svgo.sh.in index f997a855a0bc..13b46c1fd168 100644 --- a/svgo.sh.in +++ b/svgo.sh.in @@ -19,10 +19,12 @@ tidy_svgo() { msg2 "$(gettext "Optimizing SVG images...")" local svg find . -type f -iname "*.svg" 2>/dev/null | while read -r svg ; do + [ $(jobs -p|wc -l) -gt $(nproc) ] && wait -n if [[ $(file --brief --mime-type "$svg") = 'image/svg' ]]; then - svgo "${SVGOFLAGS[@]}" "$svg" &>/dev/null || - warning "$(gettext "Could not optimize SVG image : %s")" "${svg/$pkgdir\//}" + { svgo "${SVGOFLAGS[@]}" "$svg" &>/dev/null || + warning "$(gettext "Could not optimize SVG image : %s")" "${svg/$pkgdir\//}"; } & fi done + wait fi } diff --git a/upx.sh.in b/upx.sh.in index 340df6c8d66b..6d03d1fb7cd7 100644 --- a/upx.sh.in +++ b/upx.sh.in @@ -19,18 +19,19 @@ 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* ]] ; 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\//}" - ;; - *) - warning "$(gettext "Not compressing %s, $(file --brief --mime-type "$binary")")" \ - "${binary/$pkgdir\//}" - ;; - esac - fi + [ $(jobs -p|wc -l) -gt $(nproc) ] && wait -n + mime=$(file --brief --mime-type "$binary") + case "$mime" in + application/x-executable | application/x-dosexec ) + { upx "${UPXFLAGS[@]}" "$binary" &>/dev/null || + warning "$(gettext "Could not compress binary : %s")" "${binary/$pkgdir\//}"; } & + ;; + application* ) + warning "$(gettext "Not compressing %s, $(file --brief --mime-type "$binary")")" \ + "${binary/$pkgdir\//}" + ;; + esac done + wait fi } |