aboutsummaryrefslogtreecommitdiff
path: root/update.sh
diff options
context:
space:
mode:
Diffstat (limited to 'update.sh')
-rwxr-xr-xupdate.sh25
1 files changed, 21 insertions, 4 deletions
diff --git a/update.sh b/update.sh
index 15d5006..e4fac1d 100755
--- a/update.sh
+++ b/update.sh
@@ -12,10 +12,27 @@ if [ ! -d openbsd ]; then
12 git clone $LIBRESSL_GIT/openbsd 12 git clone $LIBRESSL_GIT/openbsd
13 fi 13 fi
14fi 14fi
15(cd openbsd 15
16 git fetch 16# pull either the latest or if on a tag, the matching tag
17 git checkout $openbsd_branch 17set +e
18 git pull --rebase) 18tag=`git describe --exact-match --tags HEAD 2>/dev/null`
19is_tag=$?
20# adjust for 9 hour time delta between trees
21release_ts=$((`git show -s --format=%ct $tag|tail -n1` + 32400))
22commit=`git -C openbsd rev-list -n 1 --before=$release_ts $openbsd_branch`
23git -C openbsd fetch
24if [ $is_tag -eq 0 ]; then
25 echo "This is tag $tag, trying OpenBSD tag libressl-$tag"
26 if ! git -C openbsd checkout "libressl-$tag"; then
27 echo "No matching OpenBSD tag found trying nearest commit $commit"
28 git -C openbsd checkout -q $commit
29 fi
30else
31 echo "Not on a tag, grabbing latest (NOTE: this may be broken from time to time)"
32 git -C openbsd checkout $openbsd_branch
33 git -C openbsd pull
34fi
35set -e
19 36
20# setup source paths 37# setup source paths
21CWD=`pwd` 38CWD=`pwd`