diff options
author | Brent Cook <busterb@gmail.com> | 2023-03-26 21:05:08 -0500 |
---|---|---|
committer | Brent Cook <busterb@gmail.com> | 2023-03-26 21:13:58 -0500 |
commit | 2692b2f1ddca8bb7bddf2f94640ea589600d008f (patch) | |
tree | 0a97ee82aa3ff08fd1d6f1256c80b4de0fbbc719 | |
parent | 190b47b09e63382d9d9bb5b55c48ca0d6c084c17 (diff) | |
download | portable-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-x | update.sh | 25 |
1 files changed, 21 insertions, 4 deletions
@@ -12,10 +12,27 @@ if [ ! -d openbsd ]; then | |||
12 | git clone $LIBRESSL_GIT/openbsd | 12 | git clone $LIBRESSL_GIT/openbsd |
13 | fi | 13 | fi |
14 | fi | 14 | fi |
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 | 17 | set +e |
18 | git pull --rebase) | 18 | tag=`git describe --exact-match --tags HEAD 2>/dev/null` |
19 | is_tag=$? | ||
20 | # adjust for 9 hour time delta between trees | ||
21 | release_ts=$((`git show -s --format=%ct $tag|tail -n1` + 32400)) | ||
22 | commit=`git -C openbsd rev-list -n 1 --before=$release_ts $openbsd_branch` | ||
23 | git -C openbsd fetch | ||
24 | if [ $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 | ||
30 | else | ||
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 | ||
34 | fi | ||
35 | set -e | ||
19 | 36 | ||
20 | # setup source paths | 37 | # setup source paths |
21 | CWD=`pwd` | 38 | CWD=`pwd` |