summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorPaul Phillips <paulp@improving.org>2012-02-02 14:41:13 -0800
committerPaul Phillips <paulp@improving.org>2012-02-02 14:41:13 -0800
commit355792e85c5b237e5defa6c156336bfbcbf57223 (patch)
tree3bf5538a2557466d59bf58cc5d35f5860a2f3c4c /tools
parent3aebe255b87f534239f0c46a2a6e0d696c8a31d4 (diff)
downloadscala-355792e85c5b237e5defa6c156336bfbcbf57223.tar.gz
scala-355792e85c5b237e5defa6c156336bfbcbf57223.tar.bz2
scala-355792e85c5b237e5defa6c156336bfbcbf57223.zip
Extremely hacky tweak to deal with printf portability failure.
No leading zeros for %016s on some platforms, yes on others.
Diffstat (limited to 'tools')
-rwxr-xr-xtools/get-scala-revision5
1 files changed, 4 insertions, 1 deletions
diff --git a/tools/get-scala-revision b/tools/get-scala-revision
index 8d48c8cb78..eac512a010 100755
--- a/tools/get-scala-revision
+++ b/tools/get-scala-revision
@@ -16,9 +16,12 @@ tag=$(git describe --abbrev=0)
# the full string - padding correctness depends on abbrev=10.
described=$(git describe --abbrev=10 --always --tags)
+suffix="${described##${tag}-}"
+counter=$(echo $suffix | cut -d - -f 1)
+hash=$(echo $suffix | cut -d - -f 2)
# 016 is rocket-surgically-calibrated to pad the distance from the
# tag to the current commit into a 4-digit number - since maven
# will be treating this as a string, the ide depends on
# 10 being greater than 9 (thus 0010 and 00009.)
-printf "%s-%016s-%s\n" "$tag" "${described##${tag}-}" $(date "+%Y-%m-%d")
+printf "%s-%04d-%10s-%s\n" "$tag" "$counter" "$hash" $(date "+%Y-%m-%d")