summaryrefslogtreecommitdiffstats
path: root/build/cache.sh
diff options
context:
space:
mode:
authorStefan K. Berg <stefan.k.berg@ericsson.com>2016-01-17 19:18:58 +0000
committerGerrit Code Review <gerrit@172.30.200.206>2016-01-17 19:18:59 +0000
commit58ab9100f56b4252578c9c13cb8060d87285f1ba (patch)
tree8294e825620f38d7be12875b0bb3e7db0aa7683e /build/cache.sh
parent76aa5bd1daf9568ab91f7586b0627062ffb26fb0 (diff)
parent8e599759ede512a773eccef59eb2824940307564 (diff)
Merge "Fuel 8 uplift"
Diffstat (limited to 'build/cache.sh')
-rwxr-xr-xbuild/cache.sh13
1 files changed, 13 insertions, 0 deletions
diff --git a/build/cache.sh b/build/cache.sh
index 07361d28a..52d28fa33 100755
--- a/build/cache.sh
+++ b/build/cache.sh
@@ -34,6 +34,13 @@ errorexit () {
exit 1
}
+# Generate a unique number every two weeks - a service routine that
+# can be used when generating the SHA1 to make sure that the cache is
+# rebuilt bi-weekly even if no pruning of the cache is taking place.
+getbiweek () {
+ echo "$(date +'%G')$[$(date +'%V')/2]"
+}
+
# Get a SHA1 based on what's piped into the cache command
getid() {
debugmsg "Generating sha1sum"
@@ -133,6 +140,12 @@ getcommitid() {
}
case $1 in
+ getbiweek)
+ if [ $# -ne 1 ]; then
+ errorexit "No arguments can be given to getbiweek!"
+ fi
+ getbiweek
+ ;;
getcommitid)
if [ $# -ne 3 ]; then
errorexit "Arg 1 needs to be URI and arg 2 tag/branch/commit"