aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobin H. Johnson <robbat2@gentoo.org>2007-11-10 08:14:57 +0000
committerRobin H. Johnson <robbat2@gentoo.org>2007-11-10 08:14:57 +0000
commit373aceadc387d09ee2520f0a2c767530016e984c (patch)
treedd3171c5f68d45bbac24ff4169d4463d16e59e68 /run-update.sh
parentMerge branch 'master' of git+ssh://robbat2@git.gentoo.org/var/gitroot/packages (diff)
downloadpackages-373aceadc387d09ee2520f0a2c767530016e984c.tar.gz
packages-373aceadc387d09ee2520f0a2c767530016e984c.tar.bz2
packages-373aceadc387d09ee2520f0a2c767530016e984c.zip
Add scripts for running updates as cronjobs.
Diffstat (limited to 'run-update.sh')
-rwxr-xr-xrun-update.sh19
1 files changed, 16 insertions, 3 deletions
diff --git a/run-update.sh b/run-update.sh
index fc68af5..a7cf6f7 100755
--- a/run-update.sh
+++ b/run-update.sh
@@ -1,5 +1,18 @@
#!/bin/sh
-BASEDIR=/var/www/packages2.gentoo.org/packages
-cd ${BASEDIR}/dbgenerator
-CONFIG_ROOT=.. PYTHONPATH=.. python core.py
+#CODEDIR=/var/www/packages.gentoo.org
+CODEDIR=$(dirname $0)
+cd ${CODEDIR}
+source ${CODEDIR}/etc/make.conf
+if test -z "${SYNC}" || test -z "${PORTDIR}"; then
+ echo "Cannot find SYNC or PORTDIR!" 1>&2
+ exit 1
+fi
+rsync ${RSYNC_OPTS} ${SYNC} ${PORTDIR}
+exit 2
+rc=$?
+if [ $rc -ne 0 ]; then
+ echo "Failed to rsync!" 1>&2
+ exit 1
+fi
+CONFIG_ROOT=. PYTHONPATH=. python dbgenerator/core.py
pkill -HUP -u gpackages -f 'web/controller.py'