2014-07-27 14:55:29 +00:00
|
|
|
#!/bin/sh
|
2021-03-30 14:08:14 +00:00
|
|
|
|
|
|
|
set -e
|
|
|
|
|
2014-07-27 14:55:29 +00:00
|
|
|
VERSION=$(echo '#include "sysoptions.h"\necho DROPBEAR_VERSION' | cpp - | sh)
|
|
|
|
echo Releasing version "$VERSION" ...
|
|
|
|
if ! head -n1 CHANGES | grep -q $VERSION ; then
|
|
|
|
echo "CHANGES needs updating"
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
|
|
|
if ! head -n1 debian/changelog | grep -q $VERSION ; then
|
2015-01-28 14:54:23 +00:00
|
|
|
echo "debian/changelog needs updating"
|
2014-07-27 14:55:29 +00:00
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
|
|
|
head -n1 CHANGES
|
|
|
|
|
2021-03-30 14:08:14 +00:00
|
|
|
if tar --version | grep -q 'GNU tar'; then
|
|
|
|
TAR=tar
|
|
|
|
else
|
|
|
|
TAR=gtar
|
|
|
|
fi
|
2014-07-27 14:55:29 +00:00
|
|
|
|
|
|
|
RELDIR=$PWD/../dropbear-$VERSION
|
|
|
|
ARCHIVE=${RELDIR}.tar.bz2
|
|
|
|
if test -e $RELDIR; then
|
|
|
|
echo "$RELDIR exists"
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
|
|
|
if test -e $ARCHIVE; then
|
|
|
|
echo "$ARCHIVE exists"
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
|
|
|
hg archive "$RELDIR" || exit 2
|
|
|
|
|
2015-08-03 13:05:42 +00:00
|
|
|
rm "$RELDIR/.hgtags"
|
2021-03-31 15:31:26 +00:00
|
|
|
# .hg_archival.txt seems to differ between hg versions, isn't good for reproducibility
|
|
|
|
rm "$RELDIR/.hg_archival.txt"
|
2015-08-03 13:05:42 +00:00
|
|
|
|
2021-03-30 14:08:14 +00:00
|
|
|
RELDATE=$(head -n1 CHANGES | cut -d - -f 2)
|
2021-03-31 15:23:14 +00:00
|
|
|
# timezone keeps it consistent, choose a plausible release time
|
|
|
|
RELTIME="22:30:00 +0800"
|
2021-03-30 14:08:14 +00:00
|
|
|
|
|
|
|
# from https://reproducible-builds.org/docs/archives/
|
|
|
|
TAROPTS="--sort=name --owner=0 --group=0 --numeric-owner"
|
2021-03-31 15:23:14 +00:00
|
|
|
(cd "$RELDIR/.." && $TAR cjf $ARCHIVE $TAROPTS --mtime="$RELDATE $RELTIME" `basename "$RELDIR"`) || exit 2
|
2014-07-27 14:55:29 +00:00
|
|
|
|
|
|
|
ls -l $ARCHIVE
|
2019-03-23 13:45:00 +00:00
|
|
|
openssl sha256 $ARCHIVE
|
2015-11-25 15:30:56 +00:00
|
|
|
echo Done to
|
|
|
|
echo "$ARCHIVE"
|
|
|
|
echo Sign it with
|
|
|
|
echo gpg2 --detach-sign -a -u F29C6773 "$ARCHIVE"
|