aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrent Cook <busterb@gmail.com>2023-03-26 21:05:08 -0500
committerBrent Cook <busterb@gmail.com>2023-03-26 21:13:58 -0500
commit2692b2f1ddca8bb7bddf2f94640ea589600d008f (patch)
tree0a97ee82aa3ff08fd1d6f1256c80b4de0fbbc719
parent190b47b09e63382d9d9bb5b55c48ca0d6c084c17 (diff)
downloadportable-2692b2f1ddca8bb7bddf2f94640ea589600d008f.tar.gz
portable-2692b2f1ddca8bb7bddf2f94640ea589600d008f.tar.bz2
portable-2692b2f1ddca8bb7bddf2f94640ea589600d008f.zip
Checkout openbsd tag or closest commit when on a release tag
This is a compromise needed to support building from non-stable tags. This incorporates the same logic used to generate openbsd tags in the first place, which are unstable because the CVS to git conversion does not have stable commit hashes.
-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`