From 205d7ee9627d28d924fb6b8765de950f46acdb2e Mon Sep 17 00:00:00 2001 From: Joerg Jaspert Date: Sun, 12 Dec 2010 21:42:29 +0100 Subject: [PATCH] updated for new version Signed-off-by: Joerg Jaspert --- config/debian-security/apt.conf | 16 +-------- config/debian-security/apt.conf.buildd | 18 ++-------- config/debian-security/cron.buildd | 48 +++++++++++++------------- config/debian-security/cron.daily | 13 ++++--- config/debian-security/cron.unchecked | 33 ++++++++++++------ config/debian-security/cron.weekly | 8 ++--- config/debian-security/map.sh | 2 +- config/debian-security/vars | 4 +-- 8 files changed, 62 insertions(+), 80 deletions(-) diff --git a/config/debian-security/apt.conf b/config/debian-security/apt.conf index 444e6804..456bfcb1 100644 --- a/config/debian-security/apt.conf +++ b/config/debian-security/apt.conf @@ -9,26 +9,12 @@ Dir Default { - Packages::Compress ". gzip bzip2"; + Packages::Compress "gzip bzip2"; Sources::Compress "gzip bzip2"; DeLinkLimit 0; FileMode 0664; } -tree "dists/oldstable/updates" -{ - FileList "/srv/security-master.debian.org/dak-database/dists/oldstable_updates/$(SECTION)_binary-$(ARCH).list"; - SourceFileList "/srv/security-master.debian.org/dak-database/dists/oldstable_updates/$(SECTION)_source.list"; - Sections "main contrib non-free"; - Architectures "alpha amd64 arm hppa i386 ia64 mips mipsel powerpc s390 sparc source"; - BinOverride "override.etch.$(SECTION)"; - ExtraOverride "override.etch.extra.$(SECTION)"; - SrcOverride "override.etch.$(SECTION).src"; - Contents " "; - Packages::Compress "gzip bzip2"; - Sources::Compress "gzip bzip2"; -}; - tree "dists/stable/updates" { FileList "/srv/security-master.debian.org/dak-database/dists/stable_updates/$(SECTION)_binary-$(ARCH).list"; diff --git a/config/debian-security/apt.conf.buildd b/config/debian-security/apt.conf.buildd index 6ca68521..f9010a88 100644 --- a/config/debian-security/apt.conf.buildd +++ b/config/debian-security/apt.conf.buildd @@ -9,25 +9,12 @@ Dir Default { - Packages::Compress ". gzip bzip2"; - Sources::Compress ". gzip bzip2"; + Packages::Compress "gzip"; + Sources::Compress "gzip"; DeLinkLimit 0; FileMode 0664; } -bindirectory "etch" -{ - Packages "etch/Packages"; - Sources "etch/Sources"; - Contents " "; - - BinOverride "override.etch.all3"; - SrcOverride "override.etch.all3.src"; - BinCacheDB "packages-accepted-etch.db"; - PathPrefix ""; - Packages::Extensions ".deb .udeb"; -}; - bindirectory "lenny" { Packages "lenny/Packages"; @@ -53,4 +40,3 @@ bindirectory "squeeze" PathPrefix ""; Packages::Extensions ".deb .udeb"; }; - diff --git a/config/debian-security/cron.buildd b/config/debian-security/cron.buildd index d73033c7..368cd988 100755 --- a/config/debian-security/cron.buildd +++ b/config/debian-security/cron.buildd @@ -2,48 +2,49 @@ # # Executed after cron.unchecked -ARCHS_oldstable="alpha amd64 arm hppa i386 ia64 mips mipsel powerpc sparc s390" -ARCHS_stable="alpha amd64 arm armel hppa i386 ia64 mips mipsel powerpc sparc s390" -ARCHS_testing="alpha amd64 armel hppa i386 ia64 kfreebsd-i386 kfreebsd-amd64 mips mipsel powerpc sparc s390" -DISTS="oldstable stable testing" -SSH_SOCKET=~/.ssh/buildd.debian.org.socket - set -e -export SCRIPTVARS=/org/security-master.debian.org/dak/config/debian-security/vars +set -u + +export SCRIPTVARS=/srv/security-master.debian.org/dak/config/debian-security/vars . $SCRIPTVARS +SSH_SOCKET=~/.ssh/buildd.debian.org.socket +DISTS=$(dak admin s list) if [ -e $ftpdir/Archive_Maintenance_In_Progress ]; then exit 0 fi -cd $masterdir -for d in $DISTS; do - eval SOURCES_$d=`stat -c "%Y" $base/buildd/$d/Sources.gz` - eval PACKAGES_$d=`stat -c "%Y" $base/buildd/$d/Packages.gz` +for dist in $DISTS; do + eval SOURCES_$dist=`stat -c "%Y" $base/buildd/$dist/Sources.gz` + eval PACKAGES_$dist=`stat -c "%Y" $base/buildd/$dist/Packages.gz` done +cd $configdir apt-ftparchive -qq -o APT::FTPArchive::Contents=off generate apt.conf.buildd + dists= -for d in $DISTS; do - eval NEW_SOURCES_$d=`stat -c "%Y" $base/buildd/$d/Sources.gz` - eval NEW_PACKAGES_$d=`stat -c "%Y" $base/buildd/$d/Packages.gz` - old=SOURCES_$d - new=NEW_$old - if [ ${!new} -gt ${!old} ]; then + + +for dist in $DISTS; do + eval NEW_SOURCES_$dist=`stat -c "%Y" $base/buildd/$dist/Sources.gz` + eval NEW_PACKAGES_$dist=`stat -c "%Y" $base/buildd/$dist/Packages.gz` + old=SOURCES_$dist + new=NEW_$old + if [ ${!new} -gt ${!old} ]; then if [ -z "$dists" ]; then - dists="$d" + dists="$dist" else - dists="$dists $d" + dists="$dists $dist" fi continue fi - old=PACKAGES_$d + old=PACKAGES_$dist new=NEW_$old - if [ ${!new} -gt ${!old} ]; then + if [ ${!new} -gt ${!old} ]; then if [ -z "$dists" ]; then - dists="$d" + dists="$dist" else - dists="$dists $d" + dists="$dists $dist" fi continue fi @@ -61,4 +62,3 @@ if [ ! -z "$dists" ]; then ssh wbadm@buildd -S $SSH_SOCKET trigger.security $d done fi - diff --git a/config/debian-security/cron.daily b/config/debian-security/cron.daily index 025f6fca..059de374 100755 --- a/config/debian-security/cron.daily +++ b/config/debian-security/cron.daily @@ -1,9 +1,9 @@ -#!/bin/sh +#!/bin/bash # # Executed daily via cron, out of dak's crontab. set -e -export SCRIPTVARS=/org/security-master.debian.org/dak/config/debian-security/vars +export SCRIPTVARS=/srv/security-master.debian.org/dak/config/debian-security/vars . $SCRIPTVARS ################################################################################ @@ -69,10 +69,9 @@ apt-ftparchive -q clean apt.conf.buildd symlinks -d -r $ftpdir pg_dump obscurity > /org/security-master.debian.org/dak-backup/dump_$(date +%Y.%m.%d-%H:%M:%S) - -# Vacuum the database -set +e -echo "VACUUM; VACUUM ANALYZE;" | psql obscurity 2>&1 | egrep -v "^NOTICE: Skipping \"pg_.*only table or database owner can VACUUM it$|^VACUUM$" -set -e +find -maxdepth 1 -mindepth 1 -type f -name 'dump_*' \! -name '*.bz2' \! -name '*.gz' -mmin +720 | +while read dumpname; do + bzip2 -9fv "$dumpname" +done ################################################################################ diff --git a/config/debian-security/cron.unchecked b/config/debian-security/cron.unchecked index 4918c18b..ea8f5056 100755 --- a/config/debian-security/cron.unchecked +++ b/config/debian-security/cron.unchecked @@ -1,31 +1,42 @@ -#! /bin/sh +#! /bin/bash set -e -export SCRIPTVARS=/org/security-master.debian.org/dak/config/debian-security/vars +set -u + +export SCRIPTVARS=/srv/security-master.debian.org/dak/config/debian-security/vars . $SCRIPTVARS +# And use one locale, no matter what the caller has set +export LANG=C +export LC_ALL=C + report=$queuedir/REPORT reportdis=$queuedir/REPORT.disembargo timestamp=$(date "+%Y-%m-%d %H:%M") doanything=false +cd $newstage +changes=$(find . -maxdepth 1 -mindepth 1 -type f -name \*.changes | sed -e "s,./,," | xargs) +if [ -n "$changes" ]; then + echo "$timestamp": ${changes:-"Nothing to do in newstage"} >> $report + dak process-upload -a -d "$newstage" >> $report +fi + cd $unchecked changes=$(find . -maxdepth 1 -mindepth 1 -type f -name \*.changes | sed -e "s,./,," | xargs) if [ -n "$changes" ]; then - doanything=true - echo "$timestamp": "$changes" >> $report - dak process-unchecked -a $changes >> $report - echo "--" >> $report + doanything=true + echo "$timestamp": ${changes:-"Nothing to do in unchecked"} >> $report + dak process-upload -a -d "$unchecked" >> $report fi cd $disembargo changes=$(find . -maxdepth 1 -mindepth 1 -type f -name \*.changes | sed -e "s,./,," | xargs) if [ -n "$changes" ]; then - doanything=true - echo "$timestamp": "$changes" >> $reportdis - dak process-unchecked -a $changes >> $reportdis - echo "--" >> $reportdis + doanything=true + echo "$timestamp": ${changes:-"Nothing to do in disembargo"} >> $reportdis + dak process-upload -a -d "$disembargo" >> $reportdis fi if ! $doanything; then @@ -33,4 +44,4 @@ if ! $doanything; then exit 0 fi -sh $masterdir/cron.buildd +$masterdir/cron.buildd diff --git a/config/debian-security/cron.weekly b/config/debian-security/cron.weekly index ddc12ac5..80a83538 100755 --- a/config/debian-security/cron.weekly +++ b/config/debian-security/cron.weekly @@ -1,9 +1,9 @@ -#!/bin/sh +#!/bin/bash # # Executed weekly via cron, out of dak's crontab. set -e -export SCRIPTVARS=/org/security-master.debian.org/dak/config/debian-security/vars +export SCRIPTVARS=/srv/security-master.debian.org/dak/config/debian-security/vars . $SCRIPTVARS ################################################################################ @@ -11,9 +11,9 @@ export SCRIPTVARS=/org/security-master.debian.org/dak/config/debian-security/var # Weekly generation of release files, then pushing mirrors. # Used as we have a "Valid-until" field in our release files of 10 days. In case # we dont have a security update in that time... -cd $masterdir +cd $configdir dak generate-releases -/org/security-master.debian.org/dak/config/debian-security/make-mirror.sh +/srv/security-master.debian.org/dak/config/debian-security/make-mirror.sh sudo -u archvsync -H /home/archvsync/signal_security diff --git a/config/debian-security/map.sh b/config/debian-security/map.sh index 68bf7fcb..06cd5384 100755 --- a/config/debian-security/map.sh +++ b/config/debian-security/map.sh @@ -1,3 +1,3 @@ #!/bin/bash -dak make-pkg-file-mapping | bzip2 -9 > /org/security-master.debian.org/ftp/indices/package-file.map.bz2 +dak make-pkg-file-mapping | bzip2 -9 > /srv/security-master.debian.org/ftp/indices/package-file.map.bz2 diff --git a/config/debian-security/vars b/config/debian-security/vars index b85b6d83..f39093c8 100644 --- a/config/debian-security/vars +++ b/config/debian-security/vars @@ -21,8 +21,8 @@ logdir=$base/log/cron/ queuedir=$base/queue/ unchecked=$queuedir/unchecked/ +newstage=$queuedir/newstage/ disembargo=$queuedir/unchecked-disembargo/ -accepted=$queuedir/accepted/ done=$queuedir/done/ mirrordir=$base/mirror/ @@ -36,7 +36,7 @@ uploaddir=/pub/UploadQueue/ ftpgroup=debadmin components="main non-free contrib" -suites="stable testing" +suites=$(dak admin s list) override_types="deb dsc udeb" TMPDIR=${base}/tmp -- 2.39.5