exit;
fi
-DATE=`date +"%Y%m%d"`
-DIR="/home/autobuild/packages/staging/freeside$FS_VERSION/$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
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
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`
+
+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."
+
git pull
#STATUS=`git pull`
apt-ftparchive -qq sources ./ >Sources
gzip -c Sources >Sources.gz
#bzip2 -c Sources >Sources.bz2
-rm *bz2
+rm *bz2 || true
apt-ftparchive -qq release ./ >Release