Skip to content

Commit

Permalink
update release script
Browse files Browse the repository at this point in the history
- fix paths for src/
- check for dirty git
- remove mercurial support
  • Loading branch information
mkj committed Apr 4, 2024
1 parent 82f5932 commit cedbbc8
Showing 1 changed file with 7 additions and 11 deletions.
18 changes: 7 additions & 11 deletions release.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,19 @@ else
TESTREL=0
fi

VERSION=$(echo '#include "default_options.h"\n#include "sysoptions.h"\necho DROPBEAR_VERSION' | cpp -DHAVE_CRYPT - | sh)
VERSION=$(echo '#include "src/default_options.h"\n#include "src/sysoptions.h"\necho DROPBEAR_VERSION' | cpp -DHAVE_CRYPT - | sh)

if [ $TESTREL -eq 1 ]; then
echo Making test tarball for "$VERSION" ...
echo Not checking version mismatches.
WORKDIR=$(mktemp -d)
TARSUFFIX="-testrel"
else
if ! git diff -s --exit-code; then
echo "Git isn't clean"
exit 1
fi

echo Releasing version "$VERSION" ...
if ! head -n1 CHANGES | grep -q $VERSION ; then
echo "CHANGES needs updating"
Expand Down Expand Up @@ -52,16 +57,7 @@ if test -e $ARCHIVE; then
exit 1
fi

if [ -d .hg ]; then
hg archive "$RELDIR" || exit 2
# .hg_archival.txt seems to differ between hg versions, isn't good for reproducibility
rm "$RELDIR/.hg_archival.txt"
elif [ -d .git ]; then
git -c tar.umask=0022 archive --format tar -o /dev/stdout --prefix=dropbear-$VERSION/ HEAD | tar xf - -C $WORKDIR || exit 2
else
echo "This isn't a hg or git checkout"
exit 1
fi
git -c tar.umask=0022 archive --format tar -o /dev/stdout --prefix=dropbear-$VERSION/ HEAD | tar xf - -C $WORKDIR || exit 2

chmod -R a+rX $RELDIR

Expand Down

0 comments on commit cedbbc8

Please sign in to comment.