From abb0acde413e9c15b5b57c452037204d9525c2a5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Janiszewski?= Date: Mon, 28 Sep 2015 23:15:10 +0200 Subject: [PATCH] sha256 versioning of library zip --- build.sh | 6 +++--- install.sh | 4 +++- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/build.sh b/build.sh index acf81627f5..378ddf7dd6 100755 --- a/build.sh +++ b/build.sh @@ -13,7 +13,7 @@ if [[ ! -d build ]]; then fi # keep in sync with version in install.sh -libversion=3 +sha256sum=0a7b5ea46e9cb4b19000b69690eae0b75929752f7db192c78bd7ffb61d696835 libVFile="./libversion" libdir="./lib" currentversion=0 @@ -26,7 +26,7 @@ if [ -f $libVFile ]; then done < $libVFile fi -if [ $currentversion -ge $libversion ]; then +if [ "z$currentversion" == "z$sha256sum" ]; then needsdownload="false" fi @@ -35,6 +35,7 @@ if [ ! -d $libdir ]; then fi if [[ "$needsdownload" = "true" ]]; then + echo "Found library had sha256sum $currentversion, expected $sha256sum" echo "New libraries need to be downloaded. Clearing cache and calling ./install.sh" rm -rf ./lib if [[ -f $cachedir/orctlibs.zip ]]; then @@ -47,7 +48,6 @@ if [[ "$needsdownload" = "true" ]]; then rm -rf $cachedir/orctlibs fi ./install.sh - echo $libversion > $libVFile fi pushd build diff --git a/install.sh b/install.sh index 2a841af795..90e20fc449 100755 --- a/install.sh +++ b/install.sh @@ -166,7 +166,6 @@ elif [[ `uname` == "Linux" ]]; then fi else # prevent build.sh from re-doing all the steps again - echo $libversion > $libVFile case "$TARGET" in "linux") sudo dpkg --add-architecture i386 @@ -195,6 +194,9 @@ elif [[ `uname` == "Linux" ]]; then fi download_libs +# mind the gap (trailing space) +sha256sum $cachedir/orctlibs.zip | cut -f1 -d\ > $libVFile +echo "Downloaded library with sha256sum: $(cat $libVFile)" # Local libs are required for all targets install_local_libs