Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1054)

Unified Diff: build/sanitize-png-files.sh

Issue 15970004: Fix a couple of minor bugs with build/sanitize-png-files.sh (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: build/sanitize-png-files.sh
diff --git a/build/sanitize-png-files.sh b/build/sanitize-png-files.sh
index 2270e72527aa6de650b8f2d5a62871778b688c17..ddcfe55c7d4b5b50ba57bee8ac088169b249f30f 100755
--- a/build/sanitize-png-files.sh
+++ b/build/sanitize-png-files.sh
@@ -374,7 +374,7 @@ done
# Make sure we have all necessary commands installed.
install_if_not_installed pngcrush
-if [ $OPTIMIZE_LEVEL != 2 ]; then
+if [ $OPTIMIZE_LEVEL == 2 ]; then
install_if_not_installed optipng
install_if_not_installed advancecomp
@@ -401,10 +401,15 @@ for d in $DIRS; do
done
# Print the results.
-let diff=$TOTAL_OLD_BYTES-$TOTAL_NEW_BYTES
-let percent=$diff*100/$TOTAL_OLD_BYTES
-echo "Processed $PROCESSED_FILE files (out of $TOTAL_FILE files)" \
- "in $(date -u -d @$SECONDS +%T)s"
-echo "Result : $TOTAL_OLD_BYTES => $TOTAL_NEW_BYTES bytes" \
- "($diff bytes : $percent %)"
-
+if [ $PROCESSED_FILE == 0 ]; then
+ echo "Did not find any files (out of $TOTAL_FILE files)" \
+ "that could be optimized" \
+ "in $(date -u -d @$SECONDS +%T)s"
+else
+ let diff=$TOTAL_OLD_BYTES-$TOTAL_NEW_BYTES
+ let percent=$diff*100/$TOTAL_OLD_BYTES
+ echo "Processed $PROCESSED_FILE files (out of $TOTAL_FILE files)" \
+ "in $(date -u -d @$SECONDS +%T)s"
+ echo "Result : $TOTAL_OLD_BYTES => $TOTAL_NEW_BYTES bytes" \
+ "($diff bytes : $percent %)"
+fi
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698