From 60a1dfe187dbe11e61e7f867e4c04454a9d3a5e6 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Remko=20Tron=C3=A7on?= <git@el-tramo.be>
Date: Wed, 2 Jun 2010 21:44:09 +0200
Subject: Make package script more foolproof.


diff --git a/Swift/Packaging/Debian/package.sh b/Swift/Packaging/Debian/package.sh
index cc657b2..5e93ee9 100755
--- a/Swift/Packaging/Debian/package.sh
+++ b/Swift/Packaging/Debian/package.sh
@@ -4,10 +4,20 @@ export PYTHONPATH=../../../BuildTools/SCons
 VERSION=`../../../BuildTools/GetBuildVersion.py swift`
 DIRNAME=swift-$VERSION
 
+if [ -z "$VERSION" ]; then
+	echo "Unable to determine version"
+	exit -1
+fi
+
+echo "Cleaning up old packages ..."
+rm swift_*
+
+echo "Checking out a fresh copy ..."
 rm -rf $DIRNAME
 git clone ../../../.git $DIRNAME
 ln -s Swift/Packaging/Debian/debian $DIRNAME/debian
 
+echo "Building ..."
 cd $DIRNAME
 echo $PWD
 dpkg-buildpackage -rfakeroot -i -I
-- 
cgit v0.10.2-6-g49f6