diff options
author | Stefan Berg <sfb@consultron.com> | 2016-01-29 14:44:43 +0100 |
---|---|---|
committer | Stefan Berg <sfb@consultron.com> | 2016-01-29 14:44:43 +0100 |
commit | 1a560c19021ff232b7869b3057af4bcc46145b40 (patch) | |
tree | 14cd014dac38ffca567b3e2611a20fc05754f998 /build/cache.sh | |
parent | 65c164021cb356b3d4e6888488fb62c3395da4f5 (diff) |
Brahmaputra master sync
Signed-off-by: Stefan Berg <sfb@consultron.com>
Diffstat (limited to 'build/cache.sh')
-rwxr-xr-x | build/cache.sh | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/build/cache.sh b/build/cache.sh index 7c2f2109c..b5f090210 100755 --- a/build/cache.sh +++ b/build/cache.sh @@ -33,6 +33,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" @@ -138,6 +145,12 @@ if [ -z "$CACHEBASE" ]; then fi 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" |