Skip to content

Commit

Permalink
add openbsd tag sync script + release verifier
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
busterb committed Sep 10, 2015
1 parent b6aded0 commit 1ea6203
Show file tree
Hide file tree
Showing 2 changed files with 90 additions and 0 deletions.
70 changes: 70 additions & 0 deletions check-release.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
#!/bin/sh
set -e

ver=$1
dir=libressl-$ver
tarball=$dir.tar.gz
tag=v$ver

if [ -z "$LIBRESSL_SSH" ]; then
if ! curl -v 1>/dev/null 2>&1; then
download="curl -O"
elif echo quit | ftp 1>/dev/null 2>&1; then
download=ftp
else
echo "need 'ftp' or 'curl' to verify"
exit
fi
fi

if [ "$ver" = "" ]; then
echo "please specify a version to check, e.g. $0 2.1.2"
exit
fi

if [ ! -e releases/$tarball ]; then
mkdir -p releases
rm -f $tarball
if [ -z "$LIBRESSL_SSH" ]; then
$download http://ftp.openbsd.org/pub/OpenBSD/LibreSSL/$tarball releases/
mv $tarball releases
else
scp $LIBRESSL_SSH/$tarball releases
fi
(cd releases; tar zxvf $tarball)
fi

if [ ! -e gen-releases/$tarball ]; then
rm -fr tests man include ssl crypto libtls-standalone/VERSION INSTALL
git checkout OPENBSD_BRANCH update.sh tests man include ssl crypto
git checkout $tag
echo "libressl-$tag" > OPENBSD_BRANCH
sed -i 's/git pull --rebase//' update.sh
./autogen.sh
./configure --enable-libtls
make dist

mkdir -p gen-releases
mv $tarball gen-releases

git checkout OPENBSD_BRANCH update.sh
git checkout master
fi

(cd gen-releases; rm -fr $dir; tar zxf $tarball)
(cd releases; rm -fr $dir; tar zxf $tarball)

echo "differences between release and regenerated release tag:"
diff -urN \
-x *.3 \
-x Makefile.in \
-x aclocal.m4 \
-x compile \
-x config.guess \
-x config.sub \
-x configure \
-x depcomp \
-x install-sh \
-x missing \
-x test-driver \
releases/$dir gen-releases/$dir
20 changes: 20 additions & 0 deletions gen-openbsd-tags.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
#!/bin/sh
set -e

for tag in `git tag`; do
branch=master
if [[ $tag = v2.0* ]]; then
branch=OPENBSD_5_6
elif [[ $tag = v2.1* ]]; then
branch=OPENBSD_5_7
elif [[ $tag = v2.2* ]]; then
branch=OPENBSD_5_8
elif [[ $tag = v2.3* ]]; then
branch=OPENBSD_5_9
fi
# adjust for 9 hour timezone delta between trees
release_ts=$((`git show -s --format=%ct $tag|tail -n1` + 32400))
commit=`git -C openbsd rev-list -n 1 --before=$release_ts $branch`
git -C openbsd tag -f libressl-$tag $commit
echo Tagged $tag as $commit in openbsd
done

0 comments on commit 1ea6203

Please sign in to comment.