summarylogtreecommitdiffstats
path: root/optipng.sh.in
diff options
context:
space:
mode:
authorbartus2019-10-30 21:52:41 +0100
committerQue Quotion2019-11-01 12:33:36 +0900
commit7c79bfe21813f5403980a5aec5138fd6c6ae0d01 (patch)
treef59931398f0a37e09515163365973eb0ba47d8b8 /optipng.sh.in
parent2be3b9630a14a3fac26a51b9eda94e311c377bf0 (diff)
downloadaur-7c79bfe21813f5403980a5aec5138fd6c6ae0d01.tar.gz
Add multiprocessing to upx/png/svg and fix upx case statement.
Diffstat (limited to 'optipng.sh.in')
-rw-r--r--optipng.sh.in6
1 files changed, 4 insertions, 2 deletions
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
}