+svn)
+ case "$2" in
+ update|up)
+ clear
+ echo -n "Load the latest source files..."
+ svn update >> $PWD/log/_build.svn.update.log
+ if [ $? -eq 0 ]; then
+ echo ".Done!"
+ else
+ echo ".Fail!"
+ exit 1
+ fi
+ echo -n "Write the svn info to a file..."
+ svn info > $PWD/svn_status
+ if [ "$?" -eq "0" ]; then
+ echo ".Done!"
+ else
+ echo ".Fail!"
+ exit 1
+ fi
+ ;;
+ commit|ci)
+ clear
+ echo "Upload the changed files..."
+ sleep 1
+ svn commit
+ $0 svn up
+ ;;
+ dist)
+ $0 svn up
+ echo -ne "Download source package from svn..."
+ svn export http://svn.ipfire.eu/svn/ipfire ipfire-source/ --force > /dev/null
+ if [ "$?" -eq "0" ]; then
+ echo ".Done!"
+ else
+ echo ".Fail!"
+ exit 1
+ fi
+ echo -n "Compress files..."
+ tar cfz ipfire-source-`date +'%Y-%m-%d'`-r`svn info | grep Revision | cut -c 11-`.tar.gz ipfire-source
+ if [ "$?" -eq "0" ]; then
+ echo ".Done!"
+ else
+ echo ".Fail!"
+ exit 1
+ fi
+ echo -n "Cleanup..."
+ rm ipfire-source/ -r
+ if [ "$?" -eq "0" ]; then
+ echo ".Done!"
+ else
+ echo ".Fail!"
+ exit 1
+ fi
+ ;;
+ diff)
+ echo -ne "Make a local diff to last svn revision..."
+ svn diff > ipfire-diff-`date +'%Y-%m-%d-%H:%M'`-r`svn info | grep Revision | cut -c 11-`.diff
+ if [ "$?" -eq "0" ]; then
+ echo ".Done!"
+ else
+ echo ".Fail!"
+ exit 1
+ fi
+ echo "Diff was successfully saved to ipfire-diff-`date +'%Y-%m-%d-%H:%M'`-r`svn info | grep Revision | cut -c 11-`.diff"
+ ;;
+ esac
+ ;;
+sync)
+ echo -e "Syncing Cache to FTP:"
+ if [ -f .pass ]; then
+ PASS="`cat .pass`"
+ else
+ echo -ne "Password for mirror.ipfire.org: "; read PASS
+ fi
+ rm -f doc/packages-to-remove-from-ftp
+ ncftpls -u web3 -p $PASS ftp://mirror.ipfire.org/html/source-packages/source/ > ftplist
+ for i in `ls -w1 cache/`; do
+ grep $i ftplist
+ if [ "$?" -ne "0" ]; then
+ ncftpput -u web3 -p $PASS mirror.ipfire.org /html/source-packages/source cache/$i
+ if [ "$?" -eq "0" ]; then
+ echo -e "$i was successfully uploaded to the ftp server."
+ else
+ echo -e "There was an error while uploading $i to the ftp server."
+ fi
+ fi
+ done
+ for i in `cat ftplist`; do
+ ls -w1 cache/ | grep $i
+ if [ "$?" -eq "1" ]; then
+ echo $i | grep -v toolchain >> doc/packages-to-remove-from-ftp
+ fi
+ done
+ rm -f ftplist
+ ;;
+pub-iso)
+ echo -e "Upload the ISO to the beta-mirror!"
+ if [ -f .pass ]; then
+ PASS="`cat .pass`"
+ else
+ echo -ne "Password for mirror.ipfire.org: "; read PASS
+ fi
+ ncftpls -u web3 -p $PASS ftp://mirror.ipfire.org/html/source-packages/beta/ | grep `svn info | grep Revision | cut -c 11-`
+ if [ "$?" -eq "1" ]; then
+ cp $BASEDIR/ipfire-install-1.4.i386.iso $BASEDIR/ipfire-install-1.4.i386-r`svn info | grep Revision | cut -c 11-`.iso
+ md5sum ipfire-install-1.4.i386-r`svn info | grep Revision | cut -c 11-`.iso > ipfire-install-1.4.i386-r`svn info | grep Revision | cut -c 11-`.iso.md5
+ ncftpput -u web3 -p $PASS mirror.ipfire.org /html/source-packages/beta/ ipfire-install-1.4.i386-r`svn info | grep Revision | cut -c 11-`.iso
+ ncftpput -u web3 -p $PASS mirror.ipfire.org /html/source-packages/beta/ ipfire-install-1.4.i386-r`svn info | grep Revision | cut -c 11-`.iso.md5
+ if [ "$?" -eq "0" ]; then
+ echo -e "The ISO of Revision `svn info | grep Revision | cut -c 11-` was successfully uploaded to the ftp server."
+ else
+ echo -e "There was an error while uploading the ISO to the ftp server."
+ fi
+ else
+ echo -e "File with name ipfire-install-1.4.i386-r`svn info | grep Revision | cut -c 11-`.iso already exists on the ftp server!"
+ fi
+ rm -f ipfire-install-1.4.i386-r`svn info | grep Revision | cut -c 11-`.iso{,.md5}
+ ;;
+pub-paks)
+ echo -e "Upload the packages to the beta-mirror!"
+ if [ -f .pass ]; then
+ PASS="`cat .pass`"
+ else
+ echo -ne "Password for mirror.ipfire.org: "; read PASS
+ fi
+ ncftpput -z -u web3 -p $PASS mirror.ipfire.org /html/source-packages/packages/ packages/*
+ if [ "$?" -eq "0" ]; then
+ echo -e "The packages were successfully uploaded to the ftp server."
+ else
+ echo -e "There was an error while uploading the packages to the ftp server."
+ fi
+ ;;
+build-only)
+ rm -f $BASEDIR/log/$2*
+ BUILDMACHINE=`uname -m`
+ prepareenv
+ ipcopmake $2
+ ;;
+build-silent)
+ screen -dmS ipfire $0 build
+ echo "Build started... This will take a while!"
+ echo "You can see the status with 'screen -x ipfire'."
+ ;;