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
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.
-rw-r--r--etc/make.conf.example9
-rwxr-xr-xrun-update.sh19
2 files changed, 25 insertions, 3 deletions
diff --git a/etc/make.conf.example b/etc/make.conf.example
index b01d4d7..64aa393 100644
--- a/etc/make.conf.example
+++ b/etc/make.conf.example
@@ -1,4 +1,13 @@
+# You can use a custom directory here if you want a seperate copy of the
+# tree for running packages2
PORTDIR=/usr/portage
+SYNC="rsync://rsync.gentoo.org/gentoo-portage"
+# You probably shouldn't change this
+RSYNC_OPTS='-rlqptzW --safe-links --force --delete --delete-after --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages --filter=H_**/files/digest-*'
+
+# Do NOT change these
ACCEPT_KEYWORDS=""
ARCH="x86"
FEATURES="-metadata-transfer"
+
+# vim:ft=filetype=gentoo-make-conf:
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'