summaryrefslogtreecommitdiffstats
path: root/config/upload-release.sh
diff options
context:
space:
mode:
Diffstat (limited to 'config/upload-release.sh')
-rwxr-xr-xconfig/upload-release.sh38
1 files changed, 33 insertions, 5 deletions
diff --git a/config/upload-release.sh b/config/upload-release.sh
index 320d1ada..a44d40c9 100755
--- a/config/upload-release.sh
+++ b/config/upload-release.sh
@@ -1,5 +1,10 @@
#!/bin/bash
+# Must be run in the source directory.
+# Should have passed make distcheck.
+# And all final changes should already have been pushed.
+# Backup copy will be created in $HOME/elfutils-$VERSION
+
# Any error is fatal
set -e
@@ -11,21 +16,44 @@ fi
VERSION="$1"
-# Check we are in the build dir already configured.
-ELFUTILS_VERSION=$(echo $VERSION | cut -f2 -d\.)
-grep $ELFUTILS_VERSION version.h \
- || (echo "Must be run in configured build dir for $VERSION"; exit -1)
+echo Make sure the git repo is tagged, signed and pushed
+echo git tag -s -m \"elfutils $VERSION release\" elfutils-$VERSION
+echo git push --tags
+
+# Create a temporary directoy and make sure it is cleaned up.
+tempdir=$(mktemp -d) || exit
+trap "rm -rf -- ${tempdir}" EXIT
+
+pushd "${tempdir}"
+
+# Checkout
+git clone git://sourceware.org/git/elfutils.git
+cd elfutils
+git checkout -b "$VERSION" "elfutils-${VERSION}"
+# Create dist
+autoreconf -v -f -i
+./configure --enable-maintainer-mode
make dist
+# Sign
mkdir $VERSION
cp elfutils-$VERSION.tar.bz2 $VERSION/
cd $VERSION/
gpg -b elfutils-$VERSION.tar.bz2
cd ..
-scp -r $VERSION sourceware.org:/sourceware/ftp/pub/elfutils/
+# Backup copy
+cp -r $VERSION $HOME/elfutils-$VERSION
+
+# Upload
+scp -r $VERSION sourceware.org:/sourceware/ftp/pub/elfutils/
ssh sourceware.org "(cd /sourceware/ftp/pub/elfutils \
&& ln -sf $VERSION/elfutils-$VERSION.tar.bz2 elfutils-latest.tar.bz2 \
&& ln -sf $VERSION/elfutils-$VERSION.tar.bz2.sig elfutils-latest.tar.bz2.sig \
&& ls -lah elfutils-latest*)"
+
+# Cleanup
+popd
+trap - EXIT
+exit