From 94f9c0b2a7ab86c4d4687b3d132b870b5f9f3bb8 Mon Sep 17 00:00:00 2001 From: "Hoa V. DINH" Date: Tue, 25 Jun 2013 01:02:33 -0700 Subject: Improved dependencies fetching. --- scripts/get-prebuilt.sh | 46 +++++++++++++++++++++++++++++---------- scripts/prepare-libetpan-ios.sh | 2 +- scripts/prepare-libetpan-macos.sh | 2 +- 3 files changed, 37 insertions(+), 13 deletions(-) (limited to 'scripts') diff --git a/scripts/get-prebuilt.sh b/scripts/get-prebuilt.sh index 75eccb45..3bfb244a 100755 --- a/scripts/get-prebuilt.sh +++ b/scripts/get-prebuilt.sh @@ -1,18 +1,42 @@ #!/bin/sh +url_prefix="https://github.com/MailCore/mailcore2-deps/raw/master" + if test x$1 != xskipprebuilt ; then - if test ! -d ../Externals/prebuilt ; then - mkdir -p ../Externals/builds/builds - mkdir -p ../Externals/prebuilt - pushd ../Externals/prebuilt - if test -d mailcore2-deps ; then - cd mailcore2-deps - git pull --rebase - cd .. - else - git clone --depth=1 https://github.com/MailCore/mailcore2-deps.git + file_timestamp=0 + if test -f prebuilt.list ; then + file_timestamp=`stat -f '%m' prebuilt.list` + fi + timestamp=`ruby -e 'puts Time.now.to_i'` + age=$((($timestamp-$file_timestamp)/3600)) # in hours + if test $age -gt 0 ; then + networkerror=no + #echo "$url_prefix/prebuilt.list" + curl -s -L "$url_prefix/prebuilt.list" > prebuilt.list.tmp + if test x$? != x0 ; then + networkerror=yes fi - cp mailcore2-deps/*.zip ../builds/builds + + if test x$networkerror = xyes ; then + echo WARNING: could not get prebuilt.list from repository + fi + + mv prebuilt.list.tmp prebuilt.list + fi + + if test -f prebuilt.list ; then + files=`cat prebuilt.list` + mkdir -p ../Externals/builds/builds + mkdir -p ../Externals/prebuilt/mailcore2-deps + pushd ../Externals/prebuilt/mailcore2-deps + rm -rf .git + for filename in $files ; do + if test ! -f $filename ; then + echo get $filename + curl -O "$url_prefix/$filename" + fi + done + rsync --exclude=.git -av ./ ../../builds/builds/ popd fi fi diff --git a/scripts/prepare-libetpan-ios.sh b/scripts/prepare-libetpan-ios.sh index e7ed4928..5ab8a8a6 100755 --- a/scripts/prepare-libetpan-ios.sh +++ b/scripts/prepare-libetpan-ios.sh @@ -2,7 +2,7 @@ sdkversion=6.1 url="https://github.com/dinhviethoa/libetpan.git" -rev=349d184dcf2008ee7b5396743580e32b3bf65689 +rev=fb889b032d5a5f7e7178a038918bcdcd5d19d6ec pushd `dirname $0` > /dev/null scriptpath=`pwd` diff --git a/scripts/prepare-libetpan-macos.sh b/scripts/prepare-libetpan-macos.sh index 3854ef22..1972bf84 100755 --- a/scripts/prepare-libetpan-macos.sh +++ b/scripts/prepare-libetpan-macos.sh @@ -1,7 +1,7 @@ #!/bin/sh url="https://github.com/dinhviethoa/libetpan.git" -rev=349d184dcf2008ee7b5396743580e32b3bf65689 +rev=fb889b032d5a5f7e7178a038918bcdcd5d19d6ec pushd `dirname $0` > /dev/null scriptpath=`pwd` -- cgit v1.2.3