[pLog-svn] r6777 - plog/branches/lifetype-1.2/bin-devel
oscar at devel.lifetype.net
oscar at devel.lifetype.net
Mon Dec 22 14:02:30 EST 2008
Author: oscar
Date: 2008-12-22 14:02:30 -0500 (Mon, 22 Dec 2008)
New Revision: 6777
Added:
plog/branches/lifetype-1.2/bin-devel/build-core-all-svn.sh
plog/branches/lifetype-1.2/bin-devel/build-core-diff.sh
plog/branches/lifetype-1.2/bin-devel/build-core-nightly.sh
plog/branches/lifetype-1.2/bin-devel/build-plugin-local.sh
plog/branches/lifetype-1.2/bin-devel/build-plugins-all-svn.sh
plog/branches/lifetype-1.2/bin-devel/build-plugins-nightly.sh
plog/branches/lifetype-1.2/bin-devel/build-template-local.sh
plog/branches/lifetype-1.2/bin-devel/build-templates-all-svn.sh
plog/branches/lifetype-1.2/bin-devel/build-templates-nightly.sh
plog/branches/lifetype-1.2/bin-devel/genpluginfeeds.php
Removed:
plog/branches/lifetype-1.2/bin-devel/build-diff.sh
plog/branches/lifetype-1.2/bin-devel/build-nightly.sh
plog/branches/lifetype-1.2/bin-devel/build-svn.sh
Log:
code sharing. how nice
Copied: plog/branches/lifetype-1.2/bin-devel/build-core-all-svn.sh (from rev 6776, plog/branches/lifetype-1.2/bin-devel/build-svn.sh)
===================================================================
--- plog/branches/lifetype-1.2/bin-devel/build-core-all-svn.sh (rev 0)
+++ plog/branches/lifetype-1.2/bin-devel/build-core-all-svn.sh 2008-12-22 19:02:30 UTC (rev 6777)
@@ -0,0 +1,187 @@
+
+#!/bin/bash
+
+# Script to generate distribution builds of LifeType
+#
+# (c) 27-08-2004, the LifeType 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.lifetype.net
+SVNREPO=/svn/plog/plog
+
+#
+# array with the files that we are going to remove before
+# making the package... Wildcards, complete paths, whatever
+# can be used here
+# NOTE: When changing this list, update the list in build-diff.sh as well
+
+TOREMOVE="include_files release/ locale/unported/ templates/LifeType/ templates/standard-with-plugins/ templates/grey-sf/ templates/plogworld docs-devel/ class/gallery/getid3/module.archive.rar.php class/gallery/getid3/module.archive.szip.php class/gallery/getid3/module.audio-video.bink.php class/gallery/getid3/module.audio-video.matroska.php class/gallery/getid3/module.audio-video.nsv.php class/gallery/getid3/module.audio.avr.php class/gallery/getid3/module.audio.bonk.php class/gallery/getid3/module.audio.la.php class/gallery/getid3/module.audio.lpac.php class/gallery/getid3/module.audio.monkey.php class/gallery/getid3/module.audio.optimfrog.php class/gallery/getid3/module.audio.rkau.php class/gallery/getid3/module.audio.shorten.php class/gallery/getid3/module.audio.tta.php class/gallery/getid3/module.audio.voc.php class/gallery/getid3/module.audio.vqf.php class/gallery/getid3/module.graphic.bmp.php class/gallery/getid3/module.graphpc.pcd.php class/gallery/getid3/module.mis
c.exe.php class/gallery/getid3/module.misc.iso.php class/gallery/getid3/extension.cache.dbm.php class/gallery/getid3/extension.cache.mysql.php class/gallery/getid3/write.apetag.php class/gallery/getid3/write.id3v1.php class/gallery/getid3/write.id3v2.php class/gallery/getid3/write.lyrics3.php class/gallery/getid3/write.metaflac.php class/gallery/getid3/write.php class/gallery/getid3/write.real.php class/gallery/getid3/write.vorbiscomment.php dbperf.php *.xcode tools/ runtests.php class/test/"
+
+#
+# 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"
+}
+
+find_phpcli()
+{
+ if [ -x /usr/bin/php5 ]; then
+ PHP=/usr/bin/php5
+ else
+ PHP=/usr/bin/php
+ fi
+}
+
+# check parameters
+if [ $# -lt 1 ]; then
+ echo "Makes a build off the latest SVN source code and packages it"
+ echo ""
+ echo "Usage: $0 label package-name"
+ echo ""
+ 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 ""
+ echo "Example:"
+ echo ""
+ echo " $0 tags/lifetype-1.2.6 lifetype-1.2.6"
+ exit -1
+fi
+
+SVNTAG=$1
+
+# if there was no package name parameter, then build one using the current date
+if [ $# -eq 1 ]; then
+ PACKAGENAME=lifetype-devel-`date +%Y%m%d`
+else
+ PACKAGENAME=$2
+fi
+
+message "Using $PACKAGENAME as the package name"
+WORKDIR=`basename $PACKAGENAME`
+BUILDLABEL=`basename $PACKAGENAME`
+
+# determine whether code should be fetched from
+# plog/trunk or plog/tags/xxxx
+if [ $SVNTAG == "HEAD" -o $SVNTAG == "TRUNK" -o $SVNTAG == "head" -o $SVNTAG == "trunk" ]; then
+ SVNREPO=${SVNREPO}/trunk
+else
+ SVNREPO=${SVNREPO}/${SVNTAG}
+fi
+
+# call the svn command with the correct parameters
+message "Fetching the source code using $SVNTAG label..."
+REV=`svn export $SVNSERVER$SVNREPO $WORKDIR | tail -n 1 | awk '{print $NF}' | tr -d . `
+if [ $? -eq 1 ]; then
+ echo "There was an error fetching the source code. Please try again."
+ exit 1
+fi
+
+# create the temp folder and give proper permissions to it
+message "Creating the temporary folders and setting permissions to 777..."
+if [ \! -d $WORKDIR/tmp ]; then
+ mkdir $WORKDIR/tmp
+fi
+chmod 777 $WORKDIR/tmp
+
+# create the gallery/ folder and make sure that it has the right permissions
+message "Creating the gallery/ folder and setting permissions to 777..."
+if [ \! -d $WORKDIR/gallery ]; then
+ mkdir $WORKDIR/gallery
+fi
+chmod 777 $WORKDIR/gallery
+
+# copy the generic config file and remove the dist/ folder since it is not needed
+message "Copying the generic config.properties.file..."
+cp -f $WORKDIR/release/config.properties.php.dist $WORKDIR/config/config.properties.php
+cp -f $WORKDIR/release/logging.properties.php.dist $WORKDIR/config/logging.properties.php
+cp -f $WORKDIR/release/cache.properties.php.dist $WORKDIR/config/cache.properties.php
+cp -f $WORKDIR/release/userdata.properties.php.dist $WORKDIR/config/userdata.properties.php
+rm -rf $WORKDIR/release
+
+# regular users want to use the wizard
+mv $WORKDIR/wizard $WORKDIR/wizard.php
+
+# update the version.php file
+message "Updating the version.php file..."
+VERNAME=`basename ${SVNTAG}`
+echo "<?php" > $WORKDIR/version.php
+echo "\$version = \"${VERNAME}_r${REV}\";" >> $WORKDIR/version.php
+echo "?>" >> $WORKDIR/version.php
+
+# and remove all unnecessary files
+message "Removing unnecessary files...";
+for i in $TOREMOVE
+do
+ echo " -- removing $i"
+ rm -rf $WORKDIR/$i
+done
+
+# generate install/file.properties.php with the MD5 hashes of most core files
+find_phpcli
+message "Generating MD5 hashes (using $PHP)..."
+$PHP $WORKDIR/bin-devel/genmd5.php
+# remove the bin-devel/ folder, we don't need it anymore
+rm -rf $WORKDIR/bin-devel
+
+# and create the .zip, tar.gz and .tar.bz2 packages
+message "Creating .zip package..."
+zip $BUILDLABEL.zip -r $WORKDIR > /dev/null
+message "Creating .tar.gz package..."
+tar czvf $BUILDLABEL.tar.gz $WORKDIR > /dev/null
+message "Creating .tar.bz2 package..."
+tar cjvf $BUILDLABEL.tar.bz2 $WORKDIR > /dev/null
+
+
+# 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
+echo "<?xml version=\"1.0\" encoding=\"iso-8859-1\" ?>
+<rss version=\"2.0\" xmlns:lt=\"http://www.lifetype.net\">
+<channel>
+<title>Lifetype version feed</title>
+<link>http://www.lifetype.net</link>
+<description>This feed contains the latest Lifetype version available</description>
+<item>
+<title>lifetype-${LTVERSION}_r${REV}</title>
+<link>http://downloads.sourceforge.net/lifetype/lifetype-${LTVERSION}.zip</link>
+<author>The Lifetype project</author>
+<description>Lifetype ${LTVERSION}</description>
+<lt:version>${LTVERSION}_r${REV}</lt:version>
+<lt:development>0</lt:development>
+<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..."
+rm -rf $WORKDIR
+
+# done!
+message "Done!"
Property changes on: plog/branches/lifetype-1.2/bin-devel/build-core-all-svn.sh
___________________________________________________________________
Added: svn:executable
+ *
Added: svn:mergeinfo
+
Copied: plog/branches/lifetype-1.2/bin-devel/build-core-diff.sh (from rev 6757, plog/branches/lifetype-1.2/bin-devel/build-diff.sh)
===================================================================
--- plog/branches/lifetype-1.2/bin-devel/build-core-diff.sh (rev 0)
+++ plog/branches/lifetype-1.2/bin-devel/build-core-diff.sh 2008-12-22 19:02:30 UTC (rev 6777)
@@ -0,0 +1,114 @@
+#!/bin/sh
+
+# This script is for building upgrade tar files, e.g. contain all the files
+# needed to upgrade a 1.2.5 installation to a 1.2.6 installation. The
+# wizard is not included, since this script is only for minor upgrades
+
+# where to find the svn repository
+SVNSERVER="http://devel.lifetype.net"
+SVNREPO="/svn/plog/plog"
+
+# check paramters
+if [ $# -ne 2 ]; then
+ echo "Creates a folder with the folders that were added or updated when comparing"
+ echo "two subversion folders or branches"
+ echo " "
+ echo "Usage: $0 branch1 branch2"
+ echo " "
+ echo "Where branch1 and branch2 are two different branches/tags from the repository"
+ echo " "
+ echo "Example:"
+ echo " "
+ echo " $0 tags/lifetype-1.2.5 tags/lifetype-1.2.6"
+ exit -1
+fi
+
+#
+# array with the files that we are going to remove before
+# making the package... Wildcards, complete paths, whatever
+# can be used here
+#
+# NOTE: the exact same list is also maintained in build-svn.sh, please make sure that
+# changes made here also propagated to the other script
+#
+TOREMOVE="include_files release/ locale/unported/ templates/LifeType/ templates/standard-with-plugins/ templates/grey-sf/ templates/plogworld docs-devel/ class/gallery/getid3/module.archive.rar.php class/gallery/getid3/module.archive.szip.php class/gallery/getid3/module.audio-video.bink.php class/gallery/getid3/module.audio-video.matroska.php class/gallery/getid3/module.audio-video.nsv.php class/gallery/getid3/module.audio.avr.php class/gallery/getid3/module.audio.bonk.php class/gallery/getid3/module.audio.la.php class/gallery/getid3/module.audio.lpac.php class/gallery/getid3/module.audio.monkey.php class/gallery/getid3/module.audio.optimfrog.php class/gallery/getid3/module.audio.rkau.php class/gallery/getid3/module.audio.shorten.php class/gallery/getid3/module.audio.tta.php class/gallery/getid3/module.audio.voc.php class/gallery/getid3/module.audio.vqf.php class/gallery/getid3/module.graphic.bmp.php class/gallery/getid3/module.graphpc.pcd.php class/gallery/getid3/module.mis
c.exe.php class/gallery/getid3/module.misc.iso.php class/gallery/getid3/extension.cache.dbm.php class/gallery/getid3/extension.cache.mysql.php class/gallery/getid3/write.apetag.php class/gallery/getid3/write.id3v1.php class/gallery/getid3/write.id3v2.php class/gallery/getid3/write.lyrics3.php class/gallery/getid3/write.metaflac.php class/gallery/getid3/write.php class/gallery/getid3/write.real.php class/gallery/getid3/write.vorbiscomment.php dbperf.php *.xcode tools/ runtests.php class/test/"
+
+# parameters with the branches
+BRANCH1=$1
+BRANCH2=$2
+
+# create our temporary folder
+WORKFOLDER=`date +%Y%m%d%H%M`
+DESTFOLDER="destination"
+rm -rf $WORKFOLDER
+mkdir $WORKFOLDER
+rm -rf $DESTFOLDER
+mkdir $DESTFOLDER
+
+# checkout the first branch
+echo "Checking out $BRANCH1..."
+svn checkout $SVNSERVER$SVNREPO/$BRANCH1 $WORKFOLDER > /dev/null
+# switch to the second one
+pushd $WORKFOLDER > /dev/null
+echo "Switching to $BRANCH2..."
+REV=`svn switch $SVNSERVER$SVNREPO/$BRANCH2 | tee files | tail -n 1 | cut -d ' ' -f 4 | tr -d . `
+popd > /dev/null
+
+# and remove all unnecessary files
+echo "Removing unnecessary files...";
+for i in $TOREMOVE
+do
+# echo " -- removing $i"
+ rm -rf $WORKFOLDER/$i
+done
+
+# remove files that shouldn't be included in upgrades
+rm -f $WORKFOLDER/wizard*
+rm -rf $WORKFOLDER/config/
+
+echo "Generating MD5 hash of files..."
+php $WORKFOLDER/bin-devel/genmd5.php
+
+echo "Copying new or updated files..."
+# need to change this. We should parse deleted files, and parse
+# this list in order because the same file could have been added
+# and deleted within the time range we are interested in, and
+# the current method will cause errors.
+for i in `grep "^[UA]" $WORKFOLDER/files | grep -v revision | awk '{print $2}'`
+do
+ if [ -f $WORKFOLDER/$i -o -d $WORKFOLDER/$i ]; then
+ echo Keeping: $i
+ FOLDER=`dirname $i`
+ mkdir -p $DESTFOLDER/$FOLDER
+ cp $WORKFOLDER/$i $DESTFOLDER/$FOLDER
+# else
+# echo Ignoring: $i
+ fi
+done
+
+# finally, update the version.php file
+echo "Updating the version.php file..."
+VERNAME=`basename ${BRANCH2}`
+echo "<?php" > $DESTFOLDER/version.php
+echo "\$version = \"${VERNAME}_r${REV}\";" >> $DESTFOLDER/version.php
+echo "?>" >> $DESTFOLDER/version.php
+
+# make sure that install/files.properties.php is included
+echo "Moving the updated files.properties.php to the destination package..."
+mkdir -p $DESTFOLDER/install
+cp $WORKFOLDER/install/files.properties.php $DESTFOLDER/install/files.properties.php
+
+# remove temporary folders
+rm -rf $WORKFOLDER
+
+# remove files that shouldn't be included in any release
+rm -rf $DESTFOLDER/bin-devel/
+rm -rf $DESTFOLDER/docs-devel/
+rm -rf $DESTFOLDER/plog.xcode/
+rm -rf $DESTFOLDER/release/
+rm -rf $DESTFOLDER/templates/LifeType
+rm -rf $DESTFOLDER/templates/grey-sf
+rm -rf $DESTFOLDER/templates/plogworld
+
+
+echo "Done! Output available under the $DESTFOLDER/ folder"
Property changes on: plog/branches/lifetype-1.2/bin-devel/build-core-diff.sh
___________________________________________________________________
Added: svn:executable
+ *
Added: svn:mergeinfo
+
Added: plog/branches/lifetype-1.2/bin-devel/build-core-nightly.sh
===================================================================
--- plog/branches/lifetype-1.2/bin-devel/build-core-nightly.sh (rev 0)
+++ plog/branches/lifetype-1.2/bin-devel/build-core-nightly.sh 2008-12-22 19:02:30 UTC (rev 6777)
@@ -0,0 +1 @@
+link build-plugins-nightly.sh
\ No newline at end of file
Property changes on: plog/branches/lifetype-1.2/bin-devel/build-core-nightly.sh
___________________________________________________________________
Added: svn:special
+ *
Deleted: plog/branches/lifetype-1.2/bin-devel/build-diff.sh
===================================================================
--- plog/branches/lifetype-1.2/bin-devel/build-diff.sh 2008-12-22 18:55:13 UTC (rev 6776)
+++ plog/branches/lifetype-1.2/bin-devel/build-diff.sh 2008-12-22 19:02:30 UTC (rev 6777)
@@ -1,114 +0,0 @@
-#!/bin/sh
-
-# This script is for building upgrade tar files, e.g. contain all the files
-# needed to upgrade a 1.2.5 installation to a 1.2.6 installation. The
-# wizard is not included, since this script is only for minor upgrades
-
-# where to find the svn repository
-SVNSERVER="http://devel.lifetype.net"
-SVNREPO="/svn/plog/plog"
-
-# check paramters
-if [ $# -ne 2 ]; then
- echo "Creates a folder with the folders that were added or updated when comparing"
- echo "two subversion folders or branches"
- echo " "
- echo "Usage: $0 branch1 branch2"
- echo " "
- echo "Where branch1 and branch2 are two different branches/tags from the repository"
- echo " "
- echo "Example:"
- echo " "
- echo " $0 tags/lifetype-1.2.5 tags/lifetype-1.2.6"
- exit -1
-fi
-
-#
-# array with the files that we are going to remove before
-# making the package... Wildcards, complete paths, whatever
-# can be used here
-#
-# NOTE: the exact same list is also maintained in build-svn.sh, please make sure that
-# changes made here also propagated to the other script
-#
-TOREMOVE="include_files release/ locale/unported/ templates/LifeType/ templates/standard-with-plugins/ templates/grey-sf/ templates/plogworld docs-devel/ class/gallery/getid3/module.archive.rar.php class/gallery/getid3/module.archive.szip.php class/gallery/getid3/module.audio-video.bink.php class/gallery/getid3/module.audio-video.matroska.php class/gallery/getid3/module.audio-video.nsv.php class/gallery/getid3/module.audio.avr.php class/gallery/getid3/module.audio.bonk.php class/gallery/getid3/module.audio.la.php class/gallery/getid3/module.audio.lpac.php class/gallery/getid3/module.audio.monkey.php class/gallery/getid3/module.audio.optimfrog.php class/gallery/getid3/module.audio.rkau.php class/gallery/getid3/module.audio.shorten.php class/gallery/getid3/module.audio.tta.php class/gallery/getid3/module.audio.voc.php class/gallery/getid3/module.audio.vqf.php class/gallery/getid3/module.graphic.bmp.php class/gallery/getid3/module.graphpc.pcd.php class/gallery/getid3/module.mis
c.exe.php class/gallery/getid3/module.misc.iso.php class/gallery/getid3/extension.cache.dbm.php class/gallery/getid3/extension.cache.mysql.php class/gallery/getid3/write.apetag.php class/gallery/getid3/write.id3v1.php class/gallery/getid3/write.id3v2.php class/gallery/getid3/write.lyrics3.php class/gallery/getid3/write.metaflac.php class/gallery/getid3/write.php class/gallery/getid3/write.real.php class/gallery/getid3/write.vorbiscomment.php dbperf.php *.xcode tools/ runtests.php class/test/"
-
-# parameters with the branches
-BRANCH1=$1
-BRANCH2=$2
-
-# create our temporary folder
-WORKFOLDER=`date +%Y%m%d%H%M`
-DESTFOLDER="destination"
-rm -rf $WORKFOLDER
-mkdir $WORKFOLDER
-rm -rf $DESTFOLDER
-mkdir $DESTFOLDER
-
-# checkout the first branch
-echo "Checking out $BRANCH1..."
-svn checkout $SVNSERVER$SVNREPO/$BRANCH1 $WORKFOLDER > /dev/null
-# switch to the second one
-pushd $WORKFOLDER > /dev/null
-echo "Switching to $BRANCH2..."
-REV=`svn switch $SVNSERVER$SVNREPO/$BRANCH2 | tee files | tail -n 1 | cut -d ' ' -f 4 | tr -d . `
-popd > /dev/null
-
-# and remove all unnecessary files
-echo "Removing unnecessary files...";
-for i in $TOREMOVE
-do
-# echo " -- removing $i"
- rm -rf $WORKFOLDER/$i
-done
-
-# remove files that shouldn't be included in upgrades
-rm -f $WORKFOLDER/wizard*
-rm -rf $WORKFOLDER/config/
-
-echo "Generating MD5 hash of files..."
-php $WORKFOLDER/bin-devel/genmd5.php
-
-echo "Copying new or updated files..."
-# need to change this. We should parse deleted files, and parse
-# this list in order because the same file could have been added
-# and deleted within the time range we are interested in, and
-# the current method will cause errors.
-for i in `grep "^[UA]" $WORKFOLDER/files | grep -v revision | awk '{print $2}'`
-do
- if [ -f $WORKFOLDER/$i -o -d $WORKFOLDER/$i ]; then
- echo Keeping: $i
- FOLDER=`dirname $i`
- mkdir -p $DESTFOLDER/$FOLDER
- cp $WORKFOLDER/$i $DESTFOLDER/$FOLDER
-# else
-# echo Ignoring: $i
- fi
-done
-
-# finally, update the version.php file
-echo "Updating the version.php file..."
-VERNAME=`basename ${BRANCH2}`
-echo "<?php" > $DESTFOLDER/version.php
-echo "\$version = \"${VERNAME}_r${REV}\";" >> $DESTFOLDER/version.php
-echo "?>" >> $DESTFOLDER/version.php
-
-# make sure that install/files.properties.php is included
-echo "Moving the updated files.properties.php to the destination package..."
-mkdir -p $DESTFOLDER/install
-cp $WORKFOLDER/install/files.properties.php $DESTFOLDER/install/files.properties.php
-
-# remove temporary folders
-rm -rf $WORKFOLDER
-
-# remove files that shouldn't be included in any release
-rm -rf $DESTFOLDER/bin-devel/
-rm -rf $DESTFOLDER/docs-devel/
-rm -rf $DESTFOLDER/plog.xcode/
-rm -rf $DESTFOLDER/release/
-rm -rf $DESTFOLDER/templates/LifeType
-rm -rf $DESTFOLDER/templates/grey-sf
-rm -rf $DESTFOLDER/templates/plogworld
-
-
-echo "Done! Output available under the $DESTFOLDER/ folder"
Deleted: plog/branches/lifetype-1.2/bin-devel/build-nightly.sh
===================================================================
--- plog/branches/lifetype-1.2/bin-devel/build-nightly.sh 2008-12-22 18:55:13 UTC (rev 6776)
+++ plog/branches/lifetype-1.2/bin-devel/build-nightly.sh 2008-12-22 19:02:30 UTC (rev 6777)
@@ -1,50 +0,0 @@
-#!/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: $0 label destination-folder"
- echo ""
- echo "Example:"
- echo ""
- echo " $0 branches/lifetype-1.2 lifetype-1.2"
- echo " $0 trunk lifetype-trunk"
- exit -1
-fi
-
-SVNTAG=$1
-DESTFOLDER=$2
-BINPATH=`dirname $0`
-if [ ${BINPATH:0:1} != "/" ]; then
- BINPATH=`pwd`/$BINPATH
-fi
-CLEANSVNTAG=`echo -n $SVNTAG | tr -c "[:alnum:]." "-"`
-PACKAGENAME=core-$CLEANSVNTAG-`date +%Y%m%d`
-
-echo "*** Build: starting process for $SVNTAG ***"
-echo "Destination: $DESTFOLDER/$PACKAGENAME"
-date
-echo "***"
-
-# make the package
-mkdir -p $DESTFOLDER
-pushd $DESTFOLDER > /dev/null
-$BINPATH/build-svn.sh $SVNTAG $PACKAGENAME
-
-# remove everything else
-rm -f $PACKAGENAME.tar.gz
-rm -f $PACKAGENAME.tar.bz2
-rm -f lifetype.xml
-
-# make the softlink
-rm -f core-$CLEANSVNTAG-latest.zip
-ln -s $PACKAGENAME.zip core-$CLEANSVNTAG-latest.zip
-
-popd > /dev/null
-
-echo "*** Build: Nightly build complete!"
-echo "*** Build: build result available in $DESTFOLDER/$PACKAGENAME.zip"
Copied: plog/branches/lifetype-1.2/bin-devel/build-plugin-local.sh (from rev 6774, plugins/branches/lifetype-1.2/bin/build-plugin-local.sh)
===================================================================
--- plog/branches/lifetype-1.2/bin-devel/build-plugin-local.sh (rev 0)
+++ plog/branches/lifetype-1.2/bin-devel/build-plugin-local.sh 2008-12-22 19:02:30 UTC (rev 6777)
@@ -0,0 +1,111 @@
+#!/bin/sh
+
+set -e
+set -u
+
+TYPE=`echo -n $0 | cut -f2 -d-`
+
+#
+# Script to generate distribution builds of LifeType
+#
+# (c) 27-08-2004, the LifeType Team
+
+#
+# array with the files that we are going to remove before
+# making the package... Wildcards, complete paths, whatever
+# can be used here
+#
+TOREMOVE="unported/ bin/"
+WORKFOLDER="/tmp/"
+
+#sourceforge wants all unique filenames. So
+# we code them with a version number. ugh.
+VERSION="1.2"
+
+#
+# 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 $TYPE"
+ echo ""
+ echo "Usage: $0 [noupload] <$TYPE name>"
+ echo ""
+ echo "Use 'all' in order to generate a package of all the ${TYPE}s"
+ exit -1
+fi
+
+# get the name of the object that we're trying to build
+if [ "${1:-}" == "noupload" ]; then
+ message "Building, not uploading";
+ UPLOAD=""
+ NAME=$2
+else
+ message "Building and uploading, please type your sourceforge username"
+ read UPLOAD
+ if [ "${UPLOAD:-}" == "" ]; then
+ error "A sourceforge username is required to upload, or else use 'noupload'."
+ exit
+ fi
+ NAME=$1
+fi
+
+# 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
+ 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 [ $NAME == "all" ]; then
+ NAME=all_${TYPE}s
+ zip -qr ${CURFOLDER}/${VERSION}_${NAME}.zip .
+else
+ zip -r ${CURFOLDER}/${VERSION}_${NAME}.zip $NAME
+fi
+
+if [ "$UPLOAD" != "" ]; then
+ # upload the package. Linux ftp (at least my version,
+ # doesn't have the -a command,
+ # but I can use curl to do the same thing.
+ if [ `uname` == "Linux" ]; then
+ curl --upload-file ${CURFOLDER}/${VERSION}_${NAME}.zip -u $UPLOAD sftp://frs.sourceforge.net/~/uploads/
+ else
+# I think only oscar used this - he'll need to fix it
+# ftp -a -u ftp://upload.sourceforge.net/incoming/${VERSION}_${NAME}.zip ${CURFOLDER}/${VERSION}_${NAME}.zip
+ echo "fix me. Sourceforge changed how they do uploads"
+ fi
+fi
+
+message "Done!"
+
+# cleanup
+rm -rf $TMPFOLDER
Copied: plog/branches/lifetype-1.2/bin-devel/build-plugins-all-svn.sh (from rev 6773, plugins/branches/lifetype-1.2/bin/build-plugins-all-svn.sh)
===================================================================
--- plog/branches/lifetype-1.2/bin-devel/build-plugins-all-svn.sh (rev 0)
+++ plog/branches/lifetype-1.2/bin-devel/build-plugins-all-svn.sh 2008-12-22 19:02:30 UTC (rev 6777)
@@ -0,0 +1,112 @@
+
+#!/bin/bash
+
+# Script to generate distribution builds of LifeType
+#
+# (c) 27-08-2004, the LifeType 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.
+#
+
+TYPE=`echo -n $0 | cut -f2 -d-`
+
+#
+# server and repository path
+#
+SVNSERVER=http://devel.lifetype.net
+SVNREPO=/svn/plog/${TYPE}s
+
+#
+# array with the files that we are going to remove before
+# making the package... Wildcards, complete paths, whatever
+# can be used here
+# NOTE: When changing this list, update the list in build-diff.sh as well
+
+TOREMOVE="unported/ bin/"
+
+#
+# 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 build off the latest SVN source code and packages it"
+ echo ""
+ echo "Usage: $0 label package-name"
+ echo ""
+ echo "If package-name is omitted, the name will be lifetype-${TYPE}s-<current_date>"
+ echo ""
+ echo "Use HEAD or TRUNK to indicate the main development branch"
+ echo ""
+ echo "Example:"
+ echo ""
+ echo " $0 branches/lifetype-1.2 lifetype-1.2"
+ exit -1
+fi
+
+SVNTAG=$1
+
+# if there was no package name parameter, then build one using the current date
+if [ $# -eq 1 ]; then
+ PACKAGENAME=lifetype-${TYPE}s-`date +%Y%m%d`
+else
+ PACKAGENAME=$2
+fi
+
+message "Using $PACKAGENAME as the package name"
+WORKDIR=`basename $PACKAGENAME`
+BUILDLABEL=`basename $PACKAGENAME`
+
+# determine whether code should be fetched from
+# plog/trunk or plog/tags/xxxx
+if [ $SVNTAG == "HEAD" -o $SVNTAG == "TRUNK" -o $SVNTAG == "head" -o $SVNTAG == "trunk" ]; then
+ SVNREPO=${SVNREPO}/trunk
+else
+ SVNREPO=${SVNREPO}/${SVNTAG}
+fi
+
+# call the svn command with the correct parameters
+message "Fetching the source code using $SVNTAG label..."
+REV=`svn export $SVNSERVER$SVNREPO $WORKDIR | tail -n 1 | awk '{print $NF}' | tr -d . `
+if [ $? -eq 1 ]; then
+ echo "There was an error fetching the source code. Please try again."
+ exit 1
+fi
+
+# and remove all unnecessary files
+message "Removing unnecessary files...";
+for i in $TOREMOVE
+do
+ echo " -- removing $i"
+ rm -rf $WORKDIR/$i
+done
+
+# and create the .zip, tar.gz and .tar.bz2 packages
+message "Creating .zip package..."
+zip $BUILDLABEL.zip -r $WORKDIR > /dev/null
+
+# clean up the temporary folders
+message "Cleaning up..."
+rm -rf $WORKDIR
+
+# done!
+message "Done!"
Added: plog/branches/lifetype-1.2/bin-devel/build-plugins-nightly.sh
===================================================================
--- plog/branches/lifetype-1.2/bin-devel/build-plugins-nightly.sh (rev 0)
+++ plog/branches/lifetype-1.2/bin-devel/build-plugins-nightly.sh 2008-12-22 19:02:30 UTC (rev 6777)
@@ -0,0 +1,51 @@
+#!/bin/sh
+
+set -e
+set -u
+
+TYPE=`echo -n $0 | cut -f2 -d-`
+
+# check parameters
+if [ $# -lt 2 ]; then
+ echo "Generates a $TYPE build and moves it to the specified folder"
+ echo ""
+ echo "Usage: $0 label destination-folder"
+ echo ""
+ echo "Example:"
+ echo ""
+ echo " $0 branches/lifetype-1.2 lifetype-1.2"
+ echo " $0 trunk lifetype-trunk"
+ exit -1
+fi
+
+SVNTAG=$1
+DESTFOLDER=$2
+BINPATH=`dirname $0`
+if [ ${BINPATH:0:1} != "/" ]; then
+ BINPATH=`pwd`/$BINPATH
+fi
+CLEANSVNTAG=`echo -n $SVNTAG | tr -c "[:alnum:]." "-"`
+PACKAGENAME=$TYPE-$CLEANSVNTAG-`date +%Y%m%d`
+
+echo "*** Build: starting process for $SVNTAG ***"
+echo "Destination: $DESTFOLDER/$PACKAGENAME"
+date
+echo "***"
+
+# make the package
+mkdir -p $DESTFOLDER
+pushd $DESTFOLDER > /dev/null
+$BINPATH/build-$TYPE-all-svn.sh $SVNTAG $PACKAGENAME
+
+# remove everything else (only needed for the build-core-all-svn.sh script)
+rm -f $PACKAGENAME.tar.gz
+rm -f $PACKAGENAME.tar.bz2
+rm -f lifetype.xml
+
+# make the softlink
+rm -f $TYPE-latest.zip
+ln -s $PACKAGENAME.zip $TYPE-latest.zip
+popd > /dev/null
+
+echo "*** Build: Nightly build complete!"
+echo "*** Build: build result available in $DESTFOLDER/$PACKAGENAME.zip"
Property changes on: plog/branches/lifetype-1.2/bin-devel/build-plugins-nightly.sh
___________________________________________________________________
Added: svn:executable
+ *
Deleted: plog/branches/lifetype-1.2/bin-devel/build-svn.sh
===================================================================
--- plog/branches/lifetype-1.2/bin-devel/build-svn.sh 2008-12-22 18:55:13 UTC (rev 6776)
+++ plog/branches/lifetype-1.2/bin-devel/build-svn.sh 2008-12-22 19:02:30 UTC (rev 6777)
@@ -1,187 +0,0 @@
-
-#!/bin/bash
-
-# Script to generate distribution builds of LifeType
-#
-# (c) 27-08-2004, the LifeType 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.lifetype.net
-SVNREPO=/svn/plog/plog
-
-#
-# array with the files that we are going to remove before
-# making the package... Wildcards, complete paths, whatever
-# can be used here
-# NOTE: When changing this list, update the list in build-diff.sh as well
-
-TOREMOVE="include_files release/ locale/unported/ templates/LifeType/ templates/standard-with-plugins/ templates/grey-sf/ templates/plogworld docs-devel/ class/gallery/getid3/module.archive.rar.php class/gallery/getid3/module.archive.szip.php class/gallery/getid3/module.audio-video.bink.php class/gallery/getid3/module.audio-video.matroska.php class/gallery/getid3/module.audio-video.nsv.php class/gallery/getid3/module.audio.avr.php class/gallery/getid3/module.audio.bonk.php class/gallery/getid3/module.audio.la.php class/gallery/getid3/module.audio.lpac.php class/gallery/getid3/module.audio.monkey.php class/gallery/getid3/module.audio.optimfrog.php class/gallery/getid3/module.audio.rkau.php class/gallery/getid3/module.audio.shorten.php class/gallery/getid3/module.audio.tta.php class/gallery/getid3/module.audio.voc.php class/gallery/getid3/module.audio.vqf.php class/gallery/getid3/module.graphic.bmp.php class/gallery/getid3/module.graphpc.pcd.php class/gallery/getid3/module.mis
c.exe.php class/gallery/getid3/module.misc.iso.php class/gallery/getid3/extension.cache.dbm.php class/gallery/getid3/extension.cache.mysql.php class/gallery/getid3/write.apetag.php class/gallery/getid3/write.id3v1.php class/gallery/getid3/write.id3v2.php class/gallery/getid3/write.lyrics3.php class/gallery/getid3/write.metaflac.php class/gallery/getid3/write.php class/gallery/getid3/write.real.php class/gallery/getid3/write.vorbiscomment.php dbperf.php *.xcode tools/ runtests.php class/test/"
-
-#
-# 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"
-}
-
-find_phpcli()
-{
- if [ -x /usr/bin/php5 ]; then
- PHP=/usr/bin/php5
- else
- PHP=/usr/bin/php
- fi
-}
-
-# check parameters
-if [ $# -lt 1 ]; then
- echo "Makes a build off the latest SVN source code and packages it"
- echo ""
- echo "Usage: $0 label package-name"
- echo ""
- 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 ""
- echo "Example:"
- echo ""
- echo " $0 tags/lifetype-1.2.6 lifetype-1.2.6"
- exit -1
-fi
-
-SVNTAG=$1
-
-# if there was no package name parameter, then build one using the current date
-if [ $# -eq 1 ]; then
- PACKAGENAME=lifetype-devel-`date +%Y%m%d`
-else
- PACKAGENAME=$2
-fi
-
-message "Using $PACKAGENAME as the package name"
-WORKDIR=`basename $PACKAGENAME`
-BUILDLABEL=`basename $PACKAGENAME`
-
-# determine whether code should be fetched from
-# plog/trunk or plog/tags/xxxx
-if [ $SVNTAG == "HEAD" -o $SVNTAG == "TRUNK" -o $SVNTAG == "head" -o $SVNTAG == "trunk" ]; then
- SVNREPO=${SVNREPO}/trunk
-else
- SVNREPO=${SVNREPO}/${SVNTAG}
-fi
-
-# call the svn command with the correct parameters
-message "Fetching the source code using $SVNTAG label..."
-REV=`svn export $SVNSERVER$SVNREPO $WORKDIR | tail -n 1 | awk '{print $NF}' | tr -d . `
-if [ $? -eq 1 ]; then
- echo "There was an error fetching the source code. Please try again."
- exit 1
-fi
-
-# create the temp folder and give proper permissions to it
-message "Creating the temporary folders and setting permissions to 777..."
-if [ \! -d $WORKDIR/tmp ]; then
- mkdir $WORKDIR/tmp
-fi
-chmod 777 $WORKDIR/tmp
-
-# create the gallery/ folder and make sure that it has the right permissions
-message "Creating the gallery/ folder and setting permissions to 777..."
-if [ \! -d $WORKDIR/gallery ]; then
- mkdir $WORKDIR/gallery
-fi
-chmod 777 $WORKDIR/gallery
-
-# copy the generic config file and remove the dist/ folder since it is not needed
-message "Copying the generic config.properties.file..."
-cp -f $WORKDIR/release/config.properties.php.dist $WORKDIR/config/config.properties.php
-cp -f $WORKDIR/release/logging.properties.php.dist $WORKDIR/config/logging.properties.php
-cp -f $WORKDIR/release/cache.properties.php.dist $WORKDIR/config/cache.properties.php
-cp -f $WORKDIR/release/userdata.properties.php.dist $WORKDIR/config/userdata.properties.php
-rm -rf $WORKDIR/release
-
-# regular users want to use the wizard
-mv $WORKDIR/wizard $WORKDIR/wizard.php
-
-# update the version.php file
-message "Updating the version.php file..."
-VERNAME=`basename ${SVNTAG}`
-echo "<?php" > $WORKDIR/version.php
-echo "\$version = \"${VERNAME}_r${REV}\";" >> $WORKDIR/version.php
-echo "?>" >> $WORKDIR/version.php
-
-# and remove all unnecessary files
-message "Removing unnecessary files...";
-for i in $TOREMOVE
-do
- echo " -- removing $i"
- rm -rf $WORKDIR/$i
-done
-
-# generate install/file.properties.php with the MD5 hashes of most core files
-find_phpcli
-message "Generating MD5 hashes (using $PHP)..."
-$PHP $WORKDIR/bin-devel/genmd5.php
-# remove the bin-devel/ folder, we don't need it anymore
-rm -rf $WORKDIR/bin-devel
-
-# and create the .zip, tar.gz and .tar.bz2 packages
-message "Creating .zip package..."
-zip $BUILDLABEL.zip -r $WORKDIR > /dev/null
-message "Creating .tar.gz package..."
-tar czvf $BUILDLABEL.tar.gz $WORKDIR > /dev/null
-message "Creating .tar.bz2 package..."
-tar cjvf $BUILDLABEL.tar.bz2 $WORKDIR > /dev/null
-
-
-# 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
-echo "<?xml version=\"1.0\" encoding=\"iso-8859-1\" ?>
-<rss version=\"2.0\" xmlns:lt=\"http://www.lifetype.net\">
-<channel>
-<title>Lifetype version feed</title>
-<link>http://www.lifetype.net</link>
-<description>This feed contains the latest Lifetype version available</description>
-<item>
-<title>lifetype-${LTVERSION}_r${REV}</title>
-<link>http://downloads.sourceforge.net/lifetype/lifetype-${LTVERSION}.zip</link>
-<author>The Lifetype project</author>
-<description>Lifetype ${LTVERSION}</description>
-<lt:version>${LTVERSION}_r${REV}</lt:version>
-<lt:development>0</lt:development>
-<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..."
-rm -rf $WORKDIR
-
-# done!
-message "Done!"
Added: plog/branches/lifetype-1.2/bin-devel/build-template-local.sh
===================================================================
--- plog/branches/lifetype-1.2/bin-devel/build-template-local.sh (rev 0)
+++ plog/branches/lifetype-1.2/bin-devel/build-template-local.sh 2008-12-22 19:02:30 UTC (rev 6777)
@@ -0,0 +1 @@
+link build-plugin-local.sh
\ No newline at end of file
Property changes on: plog/branches/lifetype-1.2/bin-devel/build-template-local.sh
___________________________________________________________________
Added: svn:special
+ *
Added: plog/branches/lifetype-1.2/bin-devel/build-templates-all-svn.sh
===================================================================
--- plog/branches/lifetype-1.2/bin-devel/build-templates-all-svn.sh (rev 0)
+++ plog/branches/lifetype-1.2/bin-devel/build-templates-all-svn.sh 2008-12-22 19:02:30 UTC (rev 6777)
@@ -0,0 +1 @@
+link build-plugins-all-svn.sh
\ No newline at end of file
Property changes on: plog/branches/lifetype-1.2/bin-devel/build-templates-all-svn.sh
___________________________________________________________________
Added: svn:special
+ *
Added: plog/branches/lifetype-1.2/bin-devel/build-templates-nightly.sh
===================================================================
--- plog/branches/lifetype-1.2/bin-devel/build-templates-nightly.sh (rev 0)
+++ plog/branches/lifetype-1.2/bin-devel/build-templates-nightly.sh 2008-12-22 19:02:30 UTC (rev 6777)
@@ -0,0 +1 @@
+link build-plugins-nightly.sh
\ No newline at end of file
Property changes on: plog/branches/lifetype-1.2/bin-devel/build-templates-nightly.sh
___________________________________________________________________
Added: svn:special
+ *
Copied: plog/branches/lifetype-1.2/bin-devel/genpluginfeeds.php (from rev 6758, plugins/branches/lifetype-1.2/bin/genpluginfeeds.php)
===================================================================
--- plog/branches/lifetype-1.2/bin-devel/genpluginfeeds.php (rev 0)
+++ plog/branches/lifetype-1.2/bin-devel/genpluginfeeds.php 2008-12-22 19:02:30 UTC (rev 6777)
@@ -0,0 +1,191 @@
+<?php
+
+/**
+ * Please change this before running this file
+ */
+define( "PLOG_CLASS_PATH", "/home/lifetype/www/" );
+
+/**
+ * current LT version
+ */
+define( "LIFETYPE_VERSION", "1.2" );
+
+include_once( PLOG_CLASS_PATH."class/bootstrap.php" );
+lt_include( PLOG_CLASS_PATH."class/misc/glob.class.php" );
+lt_include( PLOG_CLASS_PATH."class/file/file.class.php" );
+
+class SvnRepository
+{
+ var $_url;
+
+ function SvnRepository( $url )
+ {
+ $this->_url = $url;
+ }
+
+ function getUrl()
+ {
+ return( $this->_url );
+ }
+}
+
+class SvnClient
+{
+ var $_r;
+
+ function SvnClient( $repository )
+ {
+ $this->_r = $repository;
+
+ $this->_svn = $this->_findSvnClient();
+ }
+
+ /**
+ * @private
+ */
+ function _findSvnClient()
+ {
+ $folders = Array(
+ "/usr/bin/svn",
+ "/usr/local/bin/svn"
+ );
+
+ foreach( $folders as $path ) {
+ if( File::isReadable( $path ))
+ return( $path );
+ }
+
+ return( "svn" );
+ }
+
+ function checkOut( $path, $dest = "" )
+ {
+ $cmd = $this->_svn." co ".$this->_r->getUrl().$path." ".$dest;
+
+ $result = exec( $cmd, $output, $code );
+
+ return( $code == 0 );
+ }
+
+ function export( $path, $dest = "" )
+ {
+ $cmd = $this->_svn." export ".$this->_r->getUrl().$path." ".$dest;
+
+ $result = exec( $cmd, $output, $code );
+
+ return( $code == 0 );
+ }
+}
+
+class PluginFeedWriter
+{
+ var $_dest;
+
+ function PluginFeedWriter( $dest )
+ {
+ $this->_dest = $dest;
+
+ // open the file
+ $this->_out = new File( $this->_dest );
+ $this->_out->open( "w+" );
+ }
+
+ function open()
+ {
+ // header
+ $this->_out->write( "<?xml version=\"1.0\" encoding=\"iso-8859-1\" ?>\n");
+ $this->_out->write( "<rss version=\"2.0\" xmlns:lt=\"http://www.lifetype.net\">\n" );
+ $this->_out->write( "<channel>\n");
+ $this->_out->write( "<title>Lifetype plugin feed</title>\n" );
+ $this->_out->write( "<link>http://www.lifetype.net</link>\n" );
+ $this->_out->write( "<description>This feed lists all the plugins available, their version and download link</description>\n" );
+ }
+
+ function writePluginInfo( $plugin, $data )
+ {
+ $this->_out->write( "<item>\n" );
+ $this->_out->write( "<title>".$plugin."</title>\n" );
+ $this->_out->write( "<link>".$data["url"]."</link>\n" );
+ $this->_out->write( "<author>".htmlentities($data["author"])."</author>\n" );
+ $this->_out->write( "<description>".$data["description"]."</description>\n" );
+ $this->_out->write( "<lt:version>".$data["version"]."</lt:version>\n" );
+ $this->_out->write( "</item>\n" );
+ }
+
+ function close()
+ {
+ $this->_out->write( "</channel>\n" );
+ $this->_out->write( "</rss>\n" );
+ $this->_out->close();
+ }
+}
+
+// check that the amount of parameters is correct
+if( count( $argv ) < 3 ) {
+ die( "Usage: genpluginfeeds.php svnfolder destfile\n" );
+}
+
+// get the data from the command line
+$svnFolder = $argv[1];
+$feedFile = $argv[2];
+
+// use svn to check files out
+$repo = new SvnRepository( "http://devel.lifetype.net/svn/plog" );
+$svn = new SvnClient( $repo );
+if( !$svn->checkOut( $svnFolder )) {
+ die("There was a problem while checking out data from the Subversion repository" );
+}
+
+// intialize the feed writer
+$w = new PluginFeedWriter( $feedFile );
+$w->open();
+
+$glob = new Glob();
+$files = $glob->Glob( basename( $svnFolder ));
+foreach( $files as $file ) {
+
+ // get the plugin name
+ $pluginName = basename( $file );
+
+ // ignore those that are not folders, the 'unported' folder and some more
+ if( !is_dir( $file ) || $pluginName == "unported" || $pluginName == "bin" )
+ continue;
+
+ // load the plugin file and try to extract some information from it...
+ $f = new File( $file."/plugin{$pluginName}.class.php" );
+ $f->open( "r" );
+
+ $contents = $f->readFile();
+
+ // try to find the 'version' lines
+ $found = false;
+ $i = 0;
+ $version = "";
+ while( !$found && $i < count( $contents )) {
+ if( $res = preg_match( '/\$this->version *= *["\'](.*)["\'];/i', $contents[$i], $matches )) {
+ $found = true;
+ $version = $matches[1];
+ }
+
+ if( $res = preg_match( '/\$this->author *= *["\'](.*)["\'];/i', $contents[$i], $matches )) {
+ $author = $matches[1];
+ }
+
+ $i++;
+ }
+
+ if( !$found ) {
+ $version = "not found";
+ }
+
+ $data["version"] = $version;
+ $data["url"] = "http://downloads.sourceforge.net/lifetype/".LIFETYPE_VERSION."_{$pluginName}.zip";
+ $data["author"] = $author;
+ $data["description"] = "Plugin $pluginName - version $version";
+
+ $w->writePluginInfo( $pluginName, $data );
+}
+
+// close the feed writer
+$w->close();
+?>
\ No newline at end of file
More information about the pLog-svn
mailing list