diff options
author | Brent Cook <bcook@openbsd.org> | 2015-09-10 11:19:35 -0500 |
---|---|---|
committer | Brent Cook <bcook@openbsd.org> | 2015-09-10 11:50:16 -0500 |
commit | 1ea6203cbf2af3a83d723365ea7561fe62aabb4a (patch) | |
tree | b40b194728b4e312c58fc63e846cd1a23a5ac6be | |
parent | b6aded059f68306181216d1a5abc03a47d5eb1c5 (diff) | |
download | portable-1ea6203cbf2af3a83d723365ea7561fe62aabb4a.tar.gz portable-1ea6203cbf2af3a83d723365ea7561fe62aabb4a.tar.bz2 portable-1ea6203cbf2af3a83d723365ea7561fe62aabb4a.zip |
add openbsd tag sync script + release verifier
gen-openbsd-tags.sh synchronizes local tags from the portable tree with
the openbsd git mirror. It does this by matching commit timestamps,
which can handle rehashing due to modifications of the git import scope
if we need it later.
check-release.sh generates a release tarball and compares it to an
actual release. This has shown a few mistakes in past release, but we
can use it to ensure are no issues with future releases.
-rwxr-xr-x | check-release.sh | 70 | ||||
-rwxr-xr-x | gen-openbsd-tags.sh | 20 |
2 files changed, 90 insertions, 0 deletions
diff --git a/check-release.sh b/check-release.sh new file mode 100755 index 0000000..a7cf8ec --- /dev/null +++ b/check-release.sh | |||
@@ -0,0 +1,70 @@ | |||
1 | #!/bin/sh | ||
2 | set -e | ||
3 | |||
4 | ver=$1 | ||
5 | dir=libressl-$ver | ||
6 | tarball=$dir.tar.gz | ||
7 | tag=v$ver | ||
8 | |||
9 | if [ -z "$LIBRESSL_SSH" ]; then | ||
10 | if ! curl -v 1>/dev/null 2>&1; then | ||
11 | download="curl -O" | ||
12 | elif echo quit | ftp 1>/dev/null 2>&1; then | ||
13 | download=ftp | ||
14 | else | ||
15 | echo "need 'ftp' or 'curl' to verify" | ||
16 | exit | ||
17 | fi | ||
18 | fi | ||
19 | |||
20 | if [ "$ver" = "" ]; then | ||
21 | echo "please specify a version to check, e.g. $0 2.1.2" | ||
22 | exit | ||
23 | fi | ||
24 | |||
25 | if [ ! -e releases/$tarball ]; then | ||
26 | mkdir -p releases | ||
27 | rm -f $tarball | ||
28 | if [ -z "$LIBRESSL_SSH" ]; then | ||
29 | $download http://ftp.openbsd.org/pub/OpenBSD/LibreSSL/$tarball releases/ | ||
30 | mv $tarball releases | ||
31 | else | ||
32 | scp $LIBRESSL_SSH/$tarball releases | ||
33 | fi | ||
34 | (cd releases; tar zxvf $tarball) | ||
35 | fi | ||
36 | |||
37 | if [ ! -e gen-releases/$tarball ]; then | ||
38 | rm -fr tests man include ssl crypto libtls-standalone/VERSION INSTALL | ||
39 | git checkout OPENBSD_BRANCH update.sh tests man include ssl crypto | ||
40 | git checkout $tag | ||
41 | echo "libressl-$tag" > OPENBSD_BRANCH | ||
42 | sed -i 's/git pull --rebase//' update.sh | ||
43 | ./autogen.sh | ||
44 | ./configure --enable-libtls | ||
45 | make dist | ||
46 | |||
47 | mkdir -p gen-releases | ||
48 | mv $tarball gen-releases | ||
49 | |||
50 | git checkout OPENBSD_BRANCH update.sh | ||
51 | git checkout master | ||
52 | fi | ||
53 | |||
54 | (cd gen-releases; rm -fr $dir; tar zxf $tarball) | ||
55 | (cd releases; rm -fr $dir; tar zxf $tarball) | ||
56 | |||
57 | echo "differences between release and regenerated release tag:" | ||
58 | diff -urN \ | ||
59 | -x *.3 \ | ||
60 | -x Makefile.in \ | ||
61 | -x aclocal.m4 \ | ||
62 | -x compile \ | ||
63 | -x config.guess \ | ||
64 | -x config.sub \ | ||
65 | -x configure \ | ||
66 | -x depcomp \ | ||
67 | -x install-sh \ | ||
68 | -x missing \ | ||
69 | -x test-driver \ | ||
70 | releases/$dir gen-releases/$dir | ||
diff --git a/gen-openbsd-tags.sh b/gen-openbsd-tags.sh new file mode 100755 index 0000000..a500c76 --- /dev/null +++ b/gen-openbsd-tags.sh | |||
@@ -0,0 +1,20 @@ | |||
1 | #!/bin/sh | ||
2 | set -e | ||
3 | |||
4 | for tag in `git tag`; do | ||
5 | branch=master | ||
6 | if [[ $tag = v2.0* ]]; then | ||
7 | branch=OPENBSD_5_6 | ||
8 | elif [[ $tag = v2.1* ]]; then | ||
9 | branch=OPENBSD_5_7 | ||
10 | elif [[ $tag = v2.2* ]]; then | ||
11 | branch=OPENBSD_5_8 | ||
12 | elif [[ $tag = v2.3* ]]; then | ||
13 | branch=OPENBSD_5_9 | ||
14 | fi | ||
15 | # adjust for 9 hour timezone delta between trees | ||
16 | release_ts=$((`git show -s --format=%ct $tag|tail -n1` + 32400)) | ||
17 | commit=`git -C openbsd rev-list -n 1 --before=$release_ts $branch` | ||
18 | git -C openbsd tag -f libressl-$tag $commit | ||
19 | echo Tagged $tag as $commit in openbsd | ||
20 | done | ||