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

Unified Diff: chrome/tools/build/linux/version.sh

Issue 42542: Include version information in Linux chrome. (Closed)
Patch Set: enabled AlwaysBuild Created 11 years, 9 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 | « base/file_version_info_linux.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/tools/build/linux/version.sh
diff --git a/chrome/tools/build/linux/version.sh b/chrome/tools/build/linux/version.sh
index 2b6bb616272034d57f6aa849ac1452f5319165dc..22fa30af1ff0c3dc8d9dcd6462a0cfa28fe35f3a 100755
--- a/chrome/tools/build/linux/version.sh
+++ b/chrome/tools/build/linux/version.sh
@@ -35,6 +35,14 @@ if [ "$CHROME_BUILD_TYPE" = "_official" ]; then
OFFICIAL_BUILD="true"
fi
+# Write to a temp file and only overwrite the target if it changes, to avoid
+# unnecessary compiles due to timestamp changes.
+TMPFILE=$(mktemp -q -t chromiumver-XXXX)
+if [ $? -ne 0 ]; then
+ # Oops, just use the target file and suffer possibly unnecessary compile.
+ TMPFILE="$OUTFILE"
+fi
+
# TODO(mmoss) Make sure no sed special chars in substitutions.
sed -e "s/@MAJOR@/$MAJOR/" \
-e "s/@MINOR@/$MINOR/" \
@@ -47,4 +55,11 @@ sed -e "s/@MAJOR@/$MAJOR/" \
-e "s/@PRODUCT_EXE@/$PRODUCT_EXE/" \
-e "s/@COPYRIGHT@/$COPYRIGHT/" \
-e "s/@OFFICIAL_BUILD@/$OFFICIAL_BUILD/" \
- -e "s/@LASTCHANGE@/$LASTCHANGE/" "$TMPL" > "$OUTFILE"
+ -e "s/@LASTCHANGE@/$LASTCHANGE/" "$TMPL" > "$TMPFILE"
+
+diff -q "$TMPFILE" "$OUTFILE" >/dev/null 2>&1
+if [ $? -ne 0 ]; then
+ mv -f "$TMPFILE" "$OUTFILE"
+else
+ rm "$TMPFILE"
+fi
« no previous file with comments | « base/file_version_info_linux.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698