Update sx-build-release
[invirt/packages/invirt-dev.git] / sx-build-release
1 #!/bin/bash
2 svnuri=file:///afs/sipb.mit.edu/project/xen/svn
3
4 set -e
5 if  [ $# -ne 1 ] ; then
6         echo " usage: sx-build-release trunk/packages/package_name"
7         exit 1
8 fi
9
10 if [ -d build-release ] ; then
11     echo "a previous build release directory exists; please clean up"
12     exit 1
13     fi
14
15 package=$1
16 svn co $svnuri/$package build-release
17 olddir=`pwd`
18 cd build-release/`basename $package`
19 eval  `perl '-F:\s+' -lane 'print  $F[0]."=".$F[1] if /^Version|^Source|^Distribution/' \
20     <(dpkg-parsechangelog)`
21
22
23 dpkg-buildpackage -us -uc -rfakeroot
24 svn mkdir $svnuri/package_tags/$Source -m "Create package tags directory" ||true
25 svn cp  $svnuri/$package $svnuri/package_tags/$Source/$Version -m "Tag $Version of $Source"
26 echo reprepro-env include $Distribution  ../${Source}_*${Version}.changes
27
28 cd $olddir
29 rm -rf build-release