[pLog-svn] r1906 - templates/trunk/bin

oscar at devel.plogworld.net oscar at devel.plogworld.net
Mon Apr 25 17:34:29 GMT 2005


Author: oscar
Date: 2005-04-25 17:34:29 +0000 (Mon, 25 Apr 2005)
New Revision: 1906

Modified:
   templates/trunk/bin/build.sh
Log:
now we can easily create packages of template sets. Just run this script from the 'templates/trunk' folder, using the name of the template set as the only parameter or 'all' if you'd like to create a package including all template sets. It is important to have an up-to-date version of the trunk/ folder or else the packages will not include the newest version of all files!!


Modified: templates/trunk/bin/build.sh
===================================================================
--- templates/trunk/bin/build.sh	2005-04-25 16:51:35 UTC (rev 1905)
+++ templates/trunk/bin/build.sh	2005-04-25 17:34:29 UTC (rev 1906)
@@ -1,9 +1,89 @@
 #!/bin/sh
 
-for i in *
+#
+# Script to generate distribution builds of pLog
+#
+# (c) 27-08-2004, the pLog Team
+#
+#
+# Requires two parameters: the name of the output package and the
+# CVS tag label that will be used to fetch the contents of the build. Therefore,
+# contents must be tagged _before_ running this script. 
+# The same CVS label must be used for both the plog_devel and plog_docs module.
+#
+
+#
+# server and repository path
+#
+SVNSERVER=http://devel.plogworld.net
+SVNREPO=/svn/plog/templates
+
+#
+# array with the files that we are going to remove before
+# making the package... Wildcards, complete paths, whatever
+# can be used here
+#
+TOREMOVE="unported/"
+WORKFOLDER="/tmp/"
+
+#
+# helper functions to print things in different colors
+#
+NOCOLOR='\e[0m'
+message()
+{
+ echo -e "\033[01;32m$*$NOCOLOR"
+}
+
+warning()
+{
+ echo -e "\033[01;33m$*$NOCOLOR"
+}
+
+error()
+{
+ echo -e "\033[01;31m$*$NOCOLOR"
+}
+
+# check parameters
+if [ $# -lt 1 ]; then
+    echo "Makes a zip package of a given template folder"
+    echo ""
+	echo "Usage: build.sh template"
+	echo ""
+	echo "Use 'all' in order to generate a package of all the template sets"
+	exit -1
+fi
+
+# get the name of the template that we're trying to build
+TEMPLATENAME=$1
+
+# a temporary working folder like any other...
+TMPFOLDER=${WORKFOLDER}`date | md5`
+CURFOLDER=`pwd`
+
+# export the current folder
+message "Exporting folder..."
+svn export . $TMPFOLDER
+
+# remove whatever we don't need
+message "Removing unnecessary files...";
+for i in ${TOREMOVE}
 do
-  if [ -d $i ]; then
-     echo Zipping $i...
-     zip -r $i.zip $i
-  fi
+  message "  -- removing $i"
+  rm -rf ${TMPFOLDER}/$i
 done
+
+# build the correct template package, or all of them if that's what we were requested to do...
+cd $TMPFOLDER
+message "Creating ZIP package..."
+if [ $TEMPLATENAME == "all" ]; then
+    zip -r ${CURFOLDER}/_all_templates.zip *
+else
+    zip -r ${CURFOLDER}/${TEMPLATENAME}.zip ${TEMPLATENAME}/
+fi
+
+message "Done!"
+
+# cleanup
+rm -rf $TMPFOLDER




More information about the pLog-svn mailing list