summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--config3
-rwxr-xr-xcron-jobs/ftpdir-cleanup2
-rw-r--r--db-functions8
-rwxr-xr-xdb-update8
4 files changed, 13 insertions, 8 deletions
diff --git a/config b/config
index 3a232f2..57ae64b 100644
--- a/config
+++ b/config
@@ -1,9 +1,6 @@
FTP_BASE="/srv/ftp"
-#This dir MUST be under FTP_BASE
-PKGPOOL_DIR="packages"
-
SVNREPO="file:///srv/svn-packages"
CLEANUP_DESTDIR="/srv/package-cleanup"
diff --git a/cron-jobs/ftpdir-cleanup b/cron-jobs/ftpdir-cleanup
index a278341..2e23440 100755
--- a/cron-jobs/ftpdir-cleanup
+++ b/cron-jobs/ftpdir-cleanup
@@ -36,7 +36,7 @@ done
to_cleanup=""
for _arch in ${ARCHES[@]}; do
- poolpath="$FTP_BASE/$PKGPOOL_DIR/os/$_arch/"
+ poolpath="$FTP_BASE/$(get_pkgpool_for_host)/$_arch/"
cd $poolpath
for pkg in *$PKGEXT; do
[ -f "$pkg" ] || continue # in case we get a file named "*.pkg.tar.gz"
diff --git a/db-functions b/db-functions
index d0665b0..2fe7a49 100644
--- a/db-functions
+++ b/db-functions
@@ -161,6 +161,14 @@ get_repos_for_host() {
fi
}
+get_pkgpool_for_host() {
+ if [ "$(hostname)" = "sigurd" ]; then
+ echo "packages/community"
+ else
+ echo "packages/arch"
+ fi
+}
+
#usage: chk_license ${license[@]}"
chk_license() {
local l
diff --git a/db-update b/db-update
index bcfb882..28095d8 100755
--- a/db-update
+++ b/db-update
@@ -131,11 +131,11 @@ for current_arch in ${ARCHES[@]}; do
ftppath="$FTP_BASE/$reponame/os/$current_arch"
ftppath_any="$FTP_BASE/$reponame/os/any"
- poolpath="$FTP_BASE/$PKGPOOL_DIR/os/$current_arch"
- poolpath_any="$FTP_BASE/$PKGPOOL_DIR/os/any"
+ poolpath="$FTP_BASE/$(get_pkgpool_for_host)/$current_arch"
+ poolpath_any="$FTP_BASE/$(get_pkgpool_for_host)/any"
# The following is used to create relative symlinks
- poolrel="../../../$PKGPOOL_DIR/os/$current_arch"
- poolrel_any="../../../$PKGPOOL_DIR/os/any"
+ poolrel="../../../$(get_pkgpool_for_host)/$current_arch"
+ poolrel_any="../../../$(get_pkgpool_for_host)/any"
if [ ! -d "$ftppath" ]; then
echo "FTP path for this repo ($reponame) is missing"