[pLog-svn] r6764 - plog/branches/lifetype-1.2/bin-devel

oscar at devel.lifetype.net oscar at devel.lifetype.net
Mon Dec 22 12:37:52 EST 2008


Author: oscar
Date: 2008-12-22 12:37:52 -0500 (Mon, 22 Dec 2008)
New Revision: 6764

Modified:
   plog/branches/lifetype-1.2/bin-devel/build-nightly.sh
   plog/branches/lifetype-1.2/bin-devel/build-svn.sh
Log:
script now working; cleaning up everything properly.  and doesn't have a hard-coded pathname

Modified: plog/branches/lifetype-1.2/bin-devel/build-nightly.sh
===================================================================
--- plog/branches/lifetype-1.2/bin-devel/build-nightly.sh	2008-12-22 16:58:11 UTC (rev 6763)
+++ plog/branches/lifetype-1.2/bin-devel/build-nightly.sh	2008-12-22 17:37:52 UTC (rev 6764)
@@ -1,42 +1,51 @@
 #!/bin/sh 
 
+set -e
+set -u
+
 # check parameters
 if [ $# -lt 2 ]; then
     echo "Generates a build and moves it to the specified folder"
     echo ""
     echo "Usage: build-nightly.sh label destination-folder"
     echo ""
+	echo "Use HEAD or TRUNK to indicate the main development branch"
+    echo ""
+    echo "Example:"
+    echo ""
+    echo "    $0 tags/lifetype-1.2.6 lifetype-1.2.6"
+    echo "    $0 TRUNK lifetype-trunk"
     exit -1
 fi
 
-echo "*** Build: starting process ***"
-date
-echo "***"
-
 SVNTAG=$1
 DESTFOLDER=$2
-BINPATH=/home/lifetype/bin
+BINPATH=`dirname $0`
+if [ ${BINPATH:0:1} != "/" ]; then
+  BINPATH=`pwd`/$BINPATH
+fi
+PACKAGENAME=lifetype-devel-`date +%Y%m%d`
 
-pwd
-echo $DESTFOLDER
-echo $SVNTAG
+echo "*** Build: starting process for $SVNTAG ***"
+echo "Destination: $DESTFOLDER"
+date
+echo "***"
 
 # make the package
-cd $BINPATH
-$BINPATH/build-svn.sh $SVNTAG
+mkdir -p $DESTFOLDER
+pushd $DESTFOLDER > /dev/null
+$BINPATH/build-svn.sh $SVNTAG $PACKAGENAME
 
-# move the file to the destination folder
-PACKAGENAME=lifetype-devel-`date +%Y%m%d`
-mv -f $BINPATH/$PACKAGENAME.zip $DESTFOLDER
-
 # remove everything else
-rm -f $BINPATH/$PACKAGENAME.zip
-rm -f $BINPATH/$PACKAGENAME.tar.gz
-rm -f $BINPATH/$PACKAGENAME.tar.bz2
+rm -f $PACKAGENAME.tar.gz
+rm -f $PACKAGENAME.tar.bz2
+rm -f lifetype.xml
 
 # make the softlink
-rm $DESTFOLDER/lifetype-devel-latest.zip
-ln -s $DESTFOLDER/$PACKAGENAME.zip $DESTFOLDER/lifetype-devel-latest.zip 
+rm -f lifetype-devel-latest.zip
+ln -s $PACKAGENAME.zip lifetype-devel-latest.zip 
 
+popd > /dev/null
+
 echo "*** Build: Nightly build complete!"
 echo "*** Build: build result available in $DESTFOLDER/$PACKAGENAME.zip"

Modified: plog/branches/lifetype-1.2/bin-devel/build-svn.sh
===================================================================
--- plog/branches/lifetype-1.2/bin-devel/build-svn.sh	2008-12-22 16:58:11 UTC (rev 6763)
+++ plog/branches/lifetype-1.2/bin-devel/build-svn.sh	2008-12-22 17:37:52 UTC (rev 6764)
@@ -45,13 +45,6 @@
  echo -e "\033[01;31m$*$NOCOLOR"
 }
 
-cleanup_exit()
-{
-	rm -rf $WORKDIR
-	rm -rf $WORKDIR-docs
-	exit $1
-}
-
 find_phpcli()
 {
     if [ -x /usr/bin/php5 ]; then
@@ -67,7 +60,7 @@
     echo ""
 	echo "Usage: build-svn.sh label package-name"
 	echo ""
-	echo "If package-name is omitted, the name will lifetype-devel-current_date"
+	echo "If package-name is omitted, the name will be lifetype-devel-<current_date>"
 	echo ""
 	echo "Use HEAD or TRUNK to indicate the main development branch"
     echo ""
@@ -142,7 +135,7 @@
 message "Removing unnecessary files...";
 for i in $TOREMOVE
 do
-  message "  -- removing $i"
+  echo "  -- removing $i"
   rm -rf $WORKDIR/$i
 done
 
@@ -162,8 +155,8 @@
 tar cjvf $BUILDLABEL.tar.bz2 $WORKDIR > /dev/null
 
 
-# calculate branche and version
-LTBRANCHE=`echo $VERNAME | sed 's_lifetype-\(.*\..*\)\.\(.*\)_\1_'`
+# calculate branch and version
+LTBRANCH=`echo $VERNAME | sed 's_lifetype-\(.*\..*\)\.\(.*\)_\1_'`
 LTVERSION=`echo $VERNAME | sed 's_lifetype-\(.*\)_\1_'`
 
 # create the lifetype core version feed xml file
@@ -180,16 +173,15 @@
 <description>Lifetype ${LTVERSION}</description>
 <lt:version>${LTVERSION}_r${REV}</lt:version>
 <lt:development>0</lt:development>
-<lt:branch>${LTBRANCHE}</lt:branch>
+<lt:branch>${LTBRANCH}</lt:branch>
 <lt:relnotes>http://wiki.lifetype.net/index.php/Release_notes_Lifetype_${LTVERSION}</lt:relnotes>
 </item>
 </channel>
 </rss>" > lifetype.xml
 
-
 # clean up the temporary folders
 message "Cleaning up..."
-cleanup_exit -1
+rm -rf $WORKDIR
 
 # done!
 message "Done!"



More information about the pLog-svn mailing list