From 328b1ce478e25902aba5d8f19024dadeaaf3f678 Mon Sep 17 00:00:00 2001 From: Pierre Schmitz Date: Wed, 1 Sep 2010 19:34:47 +0200 Subject: Simplify repo configuration * Repositories can now be defined in the config file for each host * added community-staging, gnome-unstable and kde-unstable * Exception is the adjust-permission cron-job; but we might want to use acls in future anyway Signed-off-by: Pierre Schmitz --- config | 8 ++++++++ cron-jobs/adjust-permissions | 6 ++++++ cron-jobs/create-filelists | 3 +-- cron-jobs/integrity-check | 2 +- cron-jobs/sourceballs | 3 +-- db-functions | 12 ++++++------ test/lib/common.inc | 16 +++++++++++++--- 7 files changed, 36 insertions(+), 14 deletions(-) diff --git a/config b/config index f6600a6..f0d6cfc 100644 --- a/config +++ b/config @@ -4,6 +4,14 @@ FTP_BASE="/srv/ftp" SVNREPO="file:///srv/svn-packages" SVNREPOCOMMUNITY="file:///srv/svn-community" +declare -A PKGREPO +PKGREPO['default']='core extra testing staging kde-unstable gnome-unstable' +PKGREPO['sigurd']='community community-testing community-staging multilib' + +declare -A PKGPOOL +PKGPOOL['default']='pool/packages' +PKGPOOL['sigurd']='pool/community' + CLEANUP_DESTDIR="/srv/package-cleanup" CLEANUP_DRYRUN=false SOURCE_CLEANUP_DESTDIR="/srv/source-cleanup" diff --git a/cron-jobs/adjust-permissions b/cron-jobs/adjust-permissions index a68584c..e0b6e4e 100755 --- a/cron-jobs/adjust-permissions +++ b/cron-jobs/adjust-permissions @@ -15,10 +15,16 @@ get_dir_owner() { echo "ftp:ftp-extra" ;; staging) echo "ftp:ftp-extra" ;; + kde-unstable) + echo "ftp:ftp-extra" ;; + gnome-unstable) + echo "ftp:ftp-extra" ;; community) echo "root:tusers" ;; community-testing) echo "root:tusers" ;; + community-staging) + echo "root:tusers" ;; multilib) echo "root:multilib" ;; pool/packages) diff --git a/cron-jobs/create-filelists b/cron-jobs/create-filelists index e280f84..a37080f 100755 --- a/cron-jobs/create-filelists +++ b/cron-jobs/create-filelists @@ -5,7 +5,6 @@ reposdir=${FTP_BASE} targetdir=${FTP_BASE} -repos=(core extra testing community community-testing staging multilib) script_lock @@ -28,7 +27,7 @@ esac FILESEXT="${DBEXT//db/files}" -for repo in ${repos[@]}; do +for repo in ${PKGREPO[@]}; do REPO_DB_FILE="${repo}$DBEXT" FILES_DB_FILE="${repo}$FILESEXT" for arch in ${ARCHES[@]}; do diff --git a/cron-jobs/integrity-check b/cron-jobs/integrity-check index 0b2b9c7..c120cfd 100755 --- a/cron-jobs/integrity-check +++ b/cron-jobs/integrity-check @@ -7,7 +7,7 @@ if [ $# -ne 2 ]; then exit 1 fi -for arch in i686 x86_64; do +for arch in ${ARCHES[@]}; do $basedir/check_archlinux/check_packages.py \ --repos="$1" \ --abs-tree="/srv/abs/rsync/$arch,/srv/abs/rsync/any" --arch="$arch" |\ diff --git a/cron-jobs/sourceballs b/cron-jobs/sourceballs index a482eb7..0cf062f 100755 --- a/cron-jobs/sourceballs +++ b/cron-jobs/sourceballs @@ -5,7 +5,6 @@ ftpbase="${FTP_BASE}" srcbase="${FTP_BASE}/sources" -repos=(core extra testing community community-testing staging multilib) script_lock @@ -18,7 +17,7 @@ FAILED_PKGS="" [ -e "$srcbase/errors.txt" ] && /bin/mv "$srcbase/errors.txt" "$srcbase/errors.txt.old" echo "Errors occured during run:" > "$srcbase/errors.txt" -for repo in ${repos[@]}; do +for repo in ${PKGREPO[@]}; do for arch in ${ARCHES[@]} any; do ftppath="$ftpbase/$repo/os/$arch" if [ ! -d "$ftppath" ]; then diff --git a/db-functions b/db-functions index 9f87298..28928da 100644 --- a/db-functions +++ b/db-functions @@ -313,18 +313,18 @@ check_pkgsvn() { } get_repos_for_host() { - if [ "$(hostname)" = "sigurd" ]; then - echo "community community-testing multilib" + if [ -n "${PKGREPO[$(hostname -s)]}" ]; then + echo "${PKGREPO[$(hostname -s)]}" else - echo "core extra testing staging" + echo "${PKGREPO['default']}" fi } get_pkgpool_for_host() { - if [ "$(hostname)" = "sigurd" ]; then - echo "pool/community" + if [ -n "${PKGPOOL[$(hostname -s)]}" ]; then + echo "${PKGPOOL[$(hostname -s)]}" else - echo "pool/packages" + echo "${PKGPOOL['default']}" fi } diff --git a/test/lib/common.inc b/test/lib/common.inc index 9017aa5..71dfd3d 100644 --- a/test/lib/common.inc +++ b/test/lib/common.inc @@ -1,5 +1,6 @@ set -E +. "${curdir}/../config" . "${curdir}/../db-functions" oneTimeSetUp() { @@ -25,15 +26,24 @@ oneTimeTearDown() { setUp() { local p local pkg + local r + local a #[ -f "${curdir}/../config.local" ] && die "${curdir}/../config.local exists" TMP="$(mktemp -d /dev/shm/$(basename $0).XXXXXXXXXX)" #msg "Using ${TMP}" mkdir -p "${TMP}/"{ftp,tmp,staging,{package,source}-cleanup,svn-{packages,community}-{copy,repo}} - mkdir -p "${TMP}/ftp/"{core,extra,community,testing,community-testing,staging,multilib}/os/{i686,any,x86_64} - mkdir -p "${TMP}/ftp/pool/"{packages,community} - mkdir -p "${TMP}/staging/"{core,extra,community,testing,community-testing,staging,multilib} + + for r in ${PKGREPO[@]}; do + mkdir -p "${TMP}/staging/${r}" + for a in ${ARCHES[@]} any; do + mkdir -p "${TMP}/ftp/${r}/os/${a}" + done + done + for p in ${PKGPOOL[@]}; do + mkdir -p "${TMP}/ftp/${p}" + done msg 'Creating svn repository...' svnadmin create "${TMP}/svn-packages-repo" -- cgit v1.1-4-g5e80