X-Git-Url: http://git.freeside.biz/gitweb/?p=freeside.git;a=blobdiff_plain;f=bin%2Ffreeside-debian-releases.sh;h=4e42c231fd2f00f8f8329ad4445a7a3e56c58762;hp=82465266f3905b54181572f0e8dc67ef3deaed79;hb=368ed08e24400e9d1faf401a1e4e23ea54d2c969;hpb=917ff4fd80bac4f492d30ab251d626095f4dd939 diff --git a/bin/freeside-debian-releases.sh b/bin/freeside-debian-releases.sh index 82465266f..4e42c231f 100755 --- a/bin/freeside-debian-releases.sh +++ b/bin/freeside-debian-releases.sh @@ -10,9 +10,9 @@ if [[ $# -ne 3 ]] exit; fi -DATE=`date +"%Y%m%d"` -DIR="/home/autobuild/packages/staging/freeside$FS_VERSION/$FS_REPO" -TARGET="/home/jeremyd/public_html/freeside$FS_VERSION-$DISTRO-$FS_REPO" +DATE=`date +"%Y%m%d%H"` +DIR="/home/autobuild/packages/staging/freeside$FS_VERSION/$DISTRO/$FS_REPO" +TARGET="/home/autobuild/public_html/freeside$FS_VERSION-$DISTRO-$FS_REPO" if [ ! -d "$DIR" -a -d $TARGET ]; then @@ -22,23 +22,26 @@ fi GIT_VERSION=`grep '^$VERSION' $DIR/freeside/FS/FS.pm | cut -d\' -f2` -# Clean configuration file -rm -fr $DIR/freeside/debian/freeside-ng-selfservice.conffiles - # Pull any changes cd $DIR/freeside -STATUS=`git pull` +git checkout -- debian/changelog + +LOCAL=`git rev-parse FREESIDE_${FS_VERSION}_BRANCH` +REMOTE=`git ls-remote origin -h refs/heads/FREESIDE_${FS_VERSION}_BRANCH | cut -f1` -#Assign the proper config files for freeside-ng-selfservice -if [ $DISTRO = "wheezy" ]; then - ln -s $DIR/freeside/debian/freeside-ng-selfservice.deb7 $DIR/freeside/debian/freeside-ng-selfservice.conffiles -else - ln -s $DIR/freeside/debian/freeside-ng-selfservice.deb8 $DIR/freeside/debian/freeside-ng-selfservice.conffiles +if [ $LOCAL = $REMOTE ]; then + echo "No new changes in git; aborting build." + exit #there's no new changes fi +echo "New changes in git since last build; building new packages." -# Add the build information to changelog +git pull +#STATUS=`git pull` -dch -b --newversion $GIT_VERSION~$DATE "Auto-Build" +# Add the build information to changelog +if [ $FS_REPO != "stable" ]; then + dch -b --newversion $GIT_VERSION-$DATE "Auto-Build" +fi # Using pbuilder and pdebuild in chroot instead of building directly : dpkg-buildpackage -b -rfakeroot -uc -us @@ -46,7 +49,14 @@ pdebuild --pbuilderroot sudo --debbuildopts "-b -rfakeroot -uc -us" --buildresul #--buildresult gets the file where it needs to be, may need to clean up DIR -cd $DIR; rm -f freeside_* -cd $TARGET; rm -f *.gz - -$TARGET/APT +cd $DIR && rm -f freeside_* +cd $TARGET && rm -f *.gz + +apt-ftparchive -qq packages ./ >Packages +gzip -c Packages >Packages.gz +#bzip2 -c Packages >Packagez.bz2 +apt-ftparchive -qq sources ./ >Sources +gzip -c Sources >Sources.gz +#bzip2 -c Sources >Sources.bz2 +rm *bz2 || true +apt-ftparchive -qq release ./ >Release