diff options
author | Matt Johnston <matt@ucc.asn.au> | 2021-03-30 22:08:14 +0800 |
---|---|---|
committer | Matt Johnston <matt@ucc.asn.au> | 2021-03-30 22:08:14 +0800 |
commit | 924d5a06a673d23d2ba8bf5e80cbc3c615a526e6 (patch) | |
tree | 717505402237d4b4cb8ad1545bb9f1d6a18369a5 | |
parent | 1bf7acc5bd8ca7829e6f96df922ab1590a839df9 (diff) |
Make releases tarballs more deterministic
Not fully tested on different systems yet
-rwxr-xr-x | release.sh | 15 |
1 files changed, 13 insertions, 2 deletions
@@ -1,4 +1,7 @@ #!/bin/sh + +set -e + VERSION=$(echo '#include "sysoptions.h"\necho DROPBEAR_VERSION' | cpp - | sh) echo Releasing version "$VERSION" ... if ! head -n1 CHANGES | grep -q $VERSION ; then @@ -13,7 +16,11 @@ fi head -n1 CHANGES -#sleep 3 +if tar --version | grep -q 'GNU tar'; then + TAR=tar +else + TAR=gtar +fi RELDIR=$PWD/../dropbear-$VERSION ARCHIVE=${RELDIR}.tar.bz2 @@ -35,7 +42,11 @@ rm -r "$RELDIR/autom4te.cache" || exit 2 rm "$RELDIR/.hgtags" -(cd "$RELDIR/.." && tar cjf $ARCHIVE `basename "$RELDIR"`) || exit 2 +RELDATE=$(head -n1 CHANGES | cut -d - -f 2) + +# from https://reproducible-builds.org/docs/archives/ +TAROPTS="--sort=name --owner=0 --group=0 --numeric-owner" +(cd "$RELDIR/.." && $TAR cjf $ARCHIVE $TAROPTS --mtime="$RELDATE" `basename "$RELDIR"`) || exit 2 ls -l $ARCHIVE openssl sha256 $ARCHIVE |