Subversion Repositories SvarDOS

Compare Revisions

Ignore whitespace Rev 849 → Rev 850

/cron.sh
9,18 → 9,34
# svn post-commit hook whenever something in the svn repo changes.
 
 
FLAGFILE="/tmp/svardos_repo_changed.flag"
REPOFLAGFILE="/tmp/svardos_repo_changed.flag"
REBUILDFLAGFILE="/tmp/svardos_rebuild_please.flag"
SVNREPODIR="/srv/svardos"
 
# if flag does not exist, exit
if [ ! -f "$FLAGFILE" ] ; then
# exit if repo did not change
if [ ! -f "$REPOFLAGFILE" ] ; then
exit 0
fi
 
# delete the flag files as soon as possible to limit the time of possible
# collisions
rm "$REPOFLAGFILE"
 
# repo changed! delete the flag file, refresh the local copy of the repo and rebuild packages index
rm "$FLAGFILE"
NEEDTOREBUILD=0
if [ -f "$REBUILDFLAGFILE" ] ; then
rm "$REBUILDFLAGFILE"
NEEDTOREBUILD=1
fi
 
 
# refresh the local copy of the repo and rebuild packages index
svn up "$SVNREPODIR"
php "$SVNREPODIR/buildidx/buildidx.php" "$SVNREPODIR/packages/" > "$SVNREPODIR/packages/_buildidx.log"
 
# do I need to rebuild the install images as well?
if [ "$NEEDTOREBUILD" -ne 0 ] ; then
cd "$SVNREPODIR"
./build.sh "website/download/" > "website/download/0000_lastbuild.log" 2>&1
fi
 
exit 0