diff options
author | mmoss@chromium.org <mmoss@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-03-24 20:07:45 +0000 |
---|---|---|
committer | mmoss@chromium.org <mmoss@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-03-24 20:07:45 +0000 |
commit | 8a0098f59d6170cf0050d3ebd25b45ee77919137 (patch) | |
tree | 12f7fc56463fac407303d5f5d2b4ce6bbdb05e80 /chrome | |
parent | d511f8444a98574e343d56fd4fda22b0f5c83a84 (diff) | |
download | chromium_src-8a0098f59d6170cf0050d3ebd25b45ee77919137.zip chromium_src-8a0098f59d6170cf0050d3ebd25b45ee77919137.tar.gz chromium_src-8a0098f59d6170cf0050d3ebd25b45ee77919137.tar.bz2 |
Include version information in Linux chrome.
This makes use of, and scons-enables, the Linux version header in Issue 45028.
BUG=8132
Review URL: http://codereview.chromium.org/42542
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@12387 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome')
-rwxr-xr-x | chrome/tools/build/linux/version.sh | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/chrome/tools/build/linux/version.sh b/chrome/tools/build/linux/version.sh index 2b6bb61..22fa30a 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 |