git » libjio » commit bc045cb

Add a release script.

author Alberto Bertogli
2005-03-10 05:28:55 UTC
committer Alberto Bertogli
2007-07-15 13:48:58 UTC
parent c4a58f8e10f23429e95350e84387d35396abaf4d

Add a release script.

Signed-off-by: Alberto Bertogli <albertito@gmail.com>

utils/release +47 -0

diff --git a/utils/release b/utils/release
new file mode 100644
index 0000000..72000dd
--- /dev/null
+++ b/utils/release
@@ -0,0 +1,47 @@
+#!/bin/bash
+
+PKG=libjio
+
+if [ "$1" == "" -o "$2" == "" ]; then
+	echo "Use: release OLDREL NEWREL"
+	echo "Run from the repo root"
+	exit
+fi
+
+OLDREL=$1
+NEWREL=$2
+
+TARGZBALL="$PKG-$NEWREL.tar.gz"
+TARBZBALL="$PKG-$NEWREL.tar.bz2"
+RELDIR="../$NEWREL"
+
+if [ -d $RELDIR ]; then
+	echo "$RELDIR already exists!"
+	exit
+fi
+
+echo "* making $RELDIR"
+mkdir $RELDIR > /dev/null 2> /dev/null
+
+echo "* darcs dist"
+darcs dist -d $PKG-$NEWREL
+mv $TARGZBALL $RELDIR
+
+echo "* darcs changes"
+darcs changes --from-tag $OLDREL > $RELDIR/Changelog-$NEWREL
+
+echo "* darcs diff"
+darcs diff -u --from-tag $OLDREL > $RELDIR/$PKG-$NEWREL.patch
+
+echo "* export patches"
+mkdir $RELDIR/$PKG-$NEWREL-broken-out
+darcs changes --xml-output --from-tag $OLDREL | \
+	./utils/exporter - export $RELDIR/$PKG-$NEWREL-broken-out/
+
+echo "* unpack"
+cd $RELDIR
+tar -zxf $TARGZBALL
+
+echo "* tar.bz2"
+tar -cjf $TARBZBALL $PKG-$NEWREL
+