1#!/bin/bash
2
3if [ $# != 2 ]; then
4    echo "Usage: $0 last-release-date package-to-update"
5    echo "  e.g. $0 20131030 sepolgen"
6    exit 1
7fi
8
9TAG=$1
10PKG=$2
11
12DEST=../update-$TAG
13mkdir -p $DEST
14
15if [ \! -d $PKG ]; then
16    echo "$PKG does not exist."
17    exit 1
18fi
19
20cd $PKG
21VERS=`cat VERSION`
22ARCHIVE=$PKG-$VERS.tar.gz
23git tag $PKG-$VERS
24git archive --format=tar --prefix=$PKG-$VERS/ $PKG-$VERS | gzip > ../$DEST/$ARCHIVE
25cd ..
26
27cd $DEST
28
29echo "Copy $ARCHIVE from $DEST to the server and update its download link and checksum on the Releases wiki page:"
30
31echo ""
32
33echo "[http://userspace.selinuxproject.org/releases/$TAG/$ARCHIVE $ARCHIVE]"
34echo ""
35echo "`sha256sum $ARCHIVE`"
36echo ""
37