diff options
author | Patrick Williams <iawillia@us.ibm.com> | 2012-03-01 13:52:34 -0600 |
---|---|---|
committer | A. Patrick Williams III <iawillia@us.ibm.com> | 2012-03-07 12:41:00 -0600 |
commit | 7838a7409307f1106aaa6df42f1909e6824de197 (patch) | |
tree | 72876fb20f15d8749fcb6c50635710b2ee49f29c /src/build/tools/hb | |
parent | 630f7ba9928d0cd9a6e80a0635269dc83c9ecd64 (diff) | |
download | talos-hostboot-7838a7409307f1106aaa6df42f1909e6824de197.tar.gz talos-hostboot-7838a7409307f1106aaa6df42f1909e6824de197.zip |
Tools for managing binary files in git.
Change-Id: I420803b36707e877a4ba35f6f484c74c9ed4eb43
Reviewed-on: http://gfw160.austin.ibm.com:8080/gerrit/711
Tested-by: Jenkins Server
Reviewed-by: Terry J. Opie <opiet@us.ibm.com>
Reviewed-by: Thi N. Tran <thi@us.ibm.com>
Reviewed-by: A. Patrick Williams III <iawillia@us.ibm.com>
Diffstat (limited to 'src/build/tools/hb')
-rwxr-xr-x | src/build/tools/hb | 76 |
1 files changed, 75 insertions, 1 deletions
diff --git a/src/build/tools/hb b/src/build/tools/hb index 9179966e9..0ea3cdad7 100755 --- a/src/build/tools/hb +++ b/src/build/tools/hb @@ -175,6 +175,26 @@ hb_helptext() echo " Prepares a copy of FipS errl tool that is hostboot aware," echo " places it in simics directory." ;; + cachesync) + echo " Topic 'cachesync'" + echo + echo " Usage:" + echo " hb cachesync" + echo + echo " Synchronizes the repository's binary file cache with the" + echo " project repository." + ;; + cacheadd) + echo " Topic 'cacheadd'" + echo + echo " Usage:" + echo " hb cacheadd [--local] <file> \"<msg>\"" + echo + echo " Inserts a file into the project binary file cache." + echo + echo " Options:" + echo " --local: Indicates file should be put only in local cache." + ;; customrc) echo " Topic 'customrc'" echo @@ -205,7 +225,7 @@ hb_helptext() echo echo " Available Commands:" echo " workon, simsetup, prime, startsimics, rsync, objsizes," - echo " copyright_check, errlparser" + echo " copyright_check, errlparser, cachesync, cacheadd" echo echo " Additional Help Topics:" echo " customrc" @@ -474,10 +494,58 @@ hb_errlparser() ln -sf ../obj/x86.nfp/errl/nfp/tool/errl } +hb_cachesync() +{ + [ -z "${HOSTBOOTROOT}" ] && echo "Missing HOSTBOOTROOT." && exit -1 + + rsync -av /gsa/ausgsa/projects/h/hostboot/.binary_cache/ \ + ${HOSTBOOTROOT}/.git/hb_cache + + failure=0 + for files in ${HOSTBOOTROOT}/.git/hb_cache/data/*; do + echo "`basename $files` $files" | sha1sum --check >> /dev/null + if [ $? -ne 0 ]; then + echo "Failed SHA1 verification! $files" + failure=-1 + fi + done + + exit $failure +} + +hb_cacheadd() +{ + [ -z "${HOSTBOOTROOT}" ] && echo "Missing HOSTBOOTROOT." && exit -1 + + CACHE_PATH=/gsa/ausgsa/projects/h/hostboot/.binary_cache/ + FILE=$1 + shift + if [ $FILE == "--local" ]; then + echo "Adding as local copy." + CACHE_PATH=${HOSTBOOTROOT}/.git/hb_cache/ + + FILE=$1 + shift + fi + MESSAGE=$* + [ ! -e "${FILE}" ] && echo "File $FILE does not exist." && exit -1 + [ -z "${MESSAGE}" ] && echo "No message given." && exit -1 + FILE_BASE=`basename $FILE` + SHA1SUM=`sha1sum -b $FILE | sed 's/ .*//'` + + echo $FILE $SHA1SUM + + cp $FILE $CACHE_PATH/data/$SHA1SUM + echo $SHA1SUM : `whoami` : `date` : $MESSAGE \ + >> $CACHE_PATH/files/$FILE_BASE + + echo "Added $FILE_BASE as $SHA1SUM" + +} @@ -514,6 +582,12 @@ copyright_check) errlparser) hb_errlparser $* ;; +cachesync) + hb_cachesync $* + ;; +cacheadd) + hb_cacheadd $* + ;; *) hb_helptext $* exit -1 |