rm -f $LOCK_DAILY
}
+# Remove changelog lock
+function remove_changelog_lock() {
+ rm -f $LOCK_CHANGELOG
+}
+
# Remove all locks
function remove_all_locks() {
- rm -f $LOCK_DAILY $LOCK_ACCEPTED $LOCK_NEW
+ rm -f $LOCK_DAILY $LOCK_ACCEPTED
}
# If we error out this one is called, *FOLLOWED* by cleanup above
$scriptsdir/update-pseudopackages.sh
}
-# Process (oldstable)-proposed-updates "NEW" queue
-function punew_do() {
- date -u -R >> REPORT
- dak process-policy $1 | tee -a REPORT | mail -a "X-Debian: DAK" -e -s "NEW changes in $1" debian-release@lists.debian.org -- -F "Debian FTP Masters" -f ftpmaster@ftp-master.debian.org
- echo >> REPORT
-}
-function punew() {
- log "Doing automated p-u-new processing"
- cd "${queuedir}/p-u-new"
- punew_do "$1"
-}
-function opunew() {
- log "Doing automated o-p-u-new processing"
- cd "${queuedir}/o-p-u-new"
- punew_do "$1"
-}
-
# The first i18n one, syncing new descriptions
function i18n1() {
log "Synchronizing i18n package descriptions"
# Lets check!
if ${scriptsdir}/ddtp-i18n-check.sh . ${scriptdir}/i18n/${TSTAMP}; then
# Yay, worked, lets copy around
- for dir in wheezy sid; do
+ for dir in jessie sid; do
if [ -d dists/${dir}/ ]; then
cd dists/${dir}/main/i18n
- rsync -aq --delete --delete-after . ${ftpdir}/dists/${dir}/main/i18n/.
+ rsync -aq --delete --delete-after --exclude Translation-en.bz2 --exclude Translation-*.diff/ . ${ftpdir}/dists/${dir}/main/i18n/.
fi
cd ${scriptdir}/i18nsync
done
}
function mpfm() {
+ local archiveroot
+
log "Generating package / file mapping"
- dak make-pkg-file-mapping | bzip2 -9 > $base/ftp/indices/package-file.map.bz2
+ for archive in "${public_archives[@]}"; do
+ archiveroot="$(get_archiveroot "${archive}")"
+ dak make-pkg-file-mapping "${archive}" | bzip2 -9 > "${archiveroot}/indices/package-file.map.bz2"
+ done
}
function packages() {
log "Generating Packages and Sources files"
- #cd $configdir
- #dak generate-packages-sources
- dak generate-packages-sources2
- dak contents generate
+ for archive in "${public_archives[@]}"; do
+ dak generate-packages-sources2 -a "${archive}"
+ dak contents generate -a "${archive}"
+ done
}
function pdiff() {
}
function release() {
+ # XXX: disable once we can remove i18n/Index (#649314)
+ log "Generating i18n/Index"
+ (
+ cd "$ftpdir/dists";
+ for dist in testing unstable experimental proposed-updates testing-proposed-updates; do
+ $scriptsdir/generate-i18n-Index $dist;
+ done
+ )
+
log "Generating Release files"
- dak generate-releases
+ for archive in "${public_archives[@]}"; do
+ dak generate-releases -a "${archive}"
+ done
}
function dakcleanup() {
log "Cleanup old packages/files"
dak clean-suites -m 10000
- dak clean-queues
+ dak clean-queues -i "$unchecked"
}
function buildd_dir() {
}
function mklslar() {
- cd $ftpdir
-
- FILENAME=ls-lR
-
- log "Removing any core files ..."
- find -type f -name core -print0 | xargs -0r rm -v
+ local archiveroot
+ local FILENAME=ls-lR
- log "Checking permissions on files in the FTP tree ..."
- find -type f \( \! -perm -444 -o -perm +002 \) -ls
- find -type d \( \! -perm -555 -o -perm +002 \) -ls
+ for archive in "${public_archives[@]}"; do
+ archiveroot="$(get_archiveroot "${archive}")"
+ cd "${archiveroot}"
- log "Checking symlinks ..."
- symlinks -rd .
+ log "Removing any core files ..."
+ find -type f -name core -print -delete
- log "Creating recursive directory listing ... "
- rm -f .${FILENAME}.new
- TZ=UTC ls -lR > .${FILENAME}.new
+ log "Checking symlinks ..."
+ symlinks -rd .
- if [ -r ${FILENAME}.gz ] ; then
- mv -f ${FILENAME}.gz ${FILENAME}.old.gz
- mv -f .${FILENAME}.new ${FILENAME}
- rm -f ${FILENAME}.patch.gz
- zcat ${FILENAME}.old.gz | diff -u - ${FILENAME} | gzip -9cfn - >${FILENAME}.patch.gz
- rm -f ${FILENAME}.old.gz
- else
- mv -f .${FILENAME}.new ${FILENAME}
- fi
-
- gzip -9cfN ${FILENAME} >${FILENAME}.gz
- rm -f ${FILENAME}
+ log "Creating recursive directory listing ... "
+ rm -f ${FILENAME}.gz
+ TZ=UTC ls -lR | gzip -9c --rsyncable > ${FILENAME}.gz
+ done
}
function mkmaintainers() {
+ local archiveroot
+ local indices
+
log 'Creating Maintainers index ... '
- cd $indices
- dak make-maintainers ${scriptdir}/masterfiles/pseudo-packages.maintainers
- gzip -9v --rsyncable <Maintainers >Maintainers.gz
- gzip -9v --rsyncable <Uploaders >Uploaders.gz
+ for archive in "${public_archives[@]}"; do
+ archiveroot="$(get_archiveroot "${archive}")"
+ indices="${archiveroot}/indices"
+ if ! [ -d "${indices}" ]; then
+ mkdir "${indices}"
+ fi
+ cd "${indices}"
+
+ dak make-maintainers -a "${archive}" ${scriptdir}/masterfiles/pseudo-packages.maintainers
+ gzip -9v --rsyncable <Maintainers >Maintainers.gz
+ gzip -9v --rsyncable <Uploaders >Uploaders.gz
+ done
}
function copyoverrides() {
log 'Copying override files into public view ...'
- for ofile in $copyoverrides ; do
- cd $overridedir
- chmod g+w override.$ofile
-
- cd $indices
-
- newofile=override.$ofile.gz
- rm -f .newover-$ofile.gz
- pc="`gzip 2>&1 -9nv <$overridedir/override.$ofile >.newover-$ofile.gz`"
- if ! cmp -s .newover-$ofile.gz $newofile || [ ! -f $newofile ]; then
- log " installing new $newofile $pc"
- mv -f .newover-$ofile.gz $newofile
- chmod g+w $newofile
- else
- rm -f .newover-$ofile.gz
- fi
+ for ofile in ${overridedir}/override.{squeeze,wheezy,jessie,sid}.{,extra.}{main,contrib,non-free}*; do
+ bname=${ofile##*/}
+ gzip -9cv --rsyncable ${ofile} > ${indices}/${bname}.gz
+ chmod g+w ${indices}/${bname}.gz
done
}
function mkfilesindices() {
+ set +o pipefail
umask 002
cd $base/ftp/indices/files/components
ARCHLIST=$(tempfile)
log "Querying postgres"
- echo 'SELECT l.path, f.filename, a.arch_string FROM location l JOIN files f ON (f.location = l.id) LEFT OUTER JOIN (binaries b JOIN architecture a ON (b.architecture = a.id)) ON (f.id = b.file)' | psql -At | sed 's/|//;s,^/srv/ftp-master.debian.org/ftp,.,' | sort >$ARCHLIST
+ local query="
+ SELECT './pool/' || c.name || '/' || f.filename AS path, a.arch_string AS arch_string
+ FROM files f
+ JOIN files_archive_map af ON f.id = af.file_id
+ JOIN component c ON af.component_id = c.id
+ JOIN archive ON af.archive_id = archive.id
+ LEFT OUTER JOIN
+ (binaries b
+ JOIN architecture a ON b.architecture = a.id)
+ ON f.id = b.file
+ WHERE archive.name = 'ftp-master'
+ ORDER BY path, arch_string
+ "
+ psql -At -c "$query" >$ARCHLIST
includedirs () {
perl -ne 'print; while (m,/[^/]+$,) { $_=$`; print $_ . "\n" unless $d{$_}++; }'
log "Generating suite lists"
suite_list () {
- printf 'SELECT DISTINCT l.path, f.filename FROM (SELECT sa.source AS source FROM src_associations sa WHERE sa.suite = %d UNION SELECT b.source AS source FROM bin_associations ba JOIN binaries b ON (ba.bin = b.id) WHERE ba.suite = %d) s JOIN dsc_files df ON (s.source = df.source) JOIN files f ON (df.file = f.id) JOIN location l ON (f.location = l.id)\n' $1 $1 | psql -F' ' -A -t
-
- printf 'SELECT l.path, f.filename FROM bin_associations ba JOIN binaries b ON (ba.bin = b.id) JOIN files f ON (b.file = f.id) JOIN location l ON (f.location = l.id) WHERE ba.suite = %d\n' $1 | psql -F' ' -A -t
+ local suite_id="$(printf %d $1)"
+ local query
+ query="
+ SELECT DISTINCT './pool/' || c.name || '/' || f.filename
+ FROM
+ (SELECT sa.source AS source
+ FROM src_associations sa
+ WHERE sa.suite = $suite_id
+ UNION
+ SELECT esr.src_id
+ FROM extra_src_references esr
+ JOIN bin_associations ba ON esr.bin_id = ba.bin
+ WHERE ba.suite = $suite_id
+ UNION
+ SELECT b.source AS source
+ FROM bin_associations ba
+ JOIN binaries b ON ba.bin = b.id WHERE ba.suite = $suite_id) s
+ JOIN dsc_files df ON s.source = df.source
+ JOIN files f ON df.file = f.id
+ JOIN files_archive_map af ON f.id = af.file_id
+ JOIN component c ON af.component_id = c.id
+ JOIN archive ON af.archive_id = archive.id
+ WHERE archive.name = 'ftp-master'
+ "
+ psql -F' ' -A -t -c "$query"
+
+ query="
+ SELECT './pool/' || c.name || '/' || f.filename
+ FROM bin_associations ba
+ JOIN binaries b ON ba.bin = b.id
+ JOIN files f ON b.file = f.id
+ JOIN files_archive_map af ON f.id = af.file_id
+ JOIN component c ON af.component_id = c.id
+ JOIN archive ON af.archive_id = archive.id
+ WHERE ba.suite = $suite_id AND archive.name = 'ftp-master'
+ "
+ psql -F' ' -A -t -c "$query"
}
- printf 'SELECT id, suite_name FROM suite\n' | psql -F' ' -At |
+ psql -F' ' -At -c "SELECT id, suite_name FROM suite" |
while read id suite; do
[ -e $base/ftp/dists/$suite ] || continue
(
[ "$(readlink $distdir)" != "$distname" ] || echo $distdir
done
)
- suite_list $id | tr -d ' ' | sed 's,^/srv/ftp-master.debian.org/ftp,.,'
+ suite_list $id
) | sort -u | gzip -9 > suite-${suite}.list.gz
done
done
(cd $base/ftp/
- for dist in sid wheezy; do
+ for dist in sid jessie; do
find ./dists/$dist/main/i18n/ \! -type d | sort -u | gzip -9 > $base/ftp/indices/files/components/translation-$dist.list.gz
done
)
- (cat ../arch-i386.files ../arch-amd64.files; zcat suite-proposed-updates.list.gz ; zcat translation-sid.list.gz ; zcat translation-wheezy.list.gz) |
+ (cat ../arch-i386.files ../arch-amd64.files; zcat suite-proposed-updates.list.gz ; zcat translation-sid.list.gz ; zcat translation-jessie.list.gz) |
sort -u | poolfirst > ../typical.files
rm -f $ARCHLIST
log "Done!"
+ set -o pipefail
}
function mkchecksums() {
- dsynclist=$dbdir/dsync.list
- md5list=$indices/md5sums
+ local archiveroot dsynclist md5list
- log -n "Creating md5 / dsync index file ... "
+ for archive in "${public_archives[@]}"; do
+ archiveroot="$(get_archiveroot "${archive}")"
+ dsynclist=$dbdir/dsync.${archive}.list
+ md5list=${archiveroot}/indices/md5sums
- cd "$ftpdir"
- ${bindir}/dsync-flist -q generate $dsynclist --exclude $dsynclist --md5
- ${bindir}/dsync-flist -q md5sums $dsynclist | gzip -9n > ${md5list}.gz
- ${bindir}/dsync-flist -q link-dups $dsynclist || true
+ log -n "Creating md5 / dsync index file for ${archive}... "
+
+ cd "$archiveroot"
+ ${bindir}/dsync-flist -q generate $dsynclist --exclude $dsynclist --md5
+ ${bindir}/dsync-flist -q md5sums $dsynclist | gzip -9n > ${md5list}.gz
+ ${bindir}/dsync-flist -q link-dups $dsynclist || true
+ done
}
function mirror() {
+ local archiveroot
+
log "Regenerating \"public\" mirror/ hardlink fun"
DATE_SERIAL=$(date +"%Y%m%d01")
FILESOAPLUS1=$(awk '/serial/ { print $3+1 }' ${TRACEFILE} )
echo "Using dak v1" >> ${TRACEFILE}
echo "Running on host: $(hostname -f)" >> ${TRACEFILE}
echo "Archive serial: ${SERIAL}" >> ${TRACEFILE}
- cd ${mirrordir}
- rsync -aH --link-dest ${ftpdir} --delete --delete-after --delete-excluded --exclude Packages.*.new --exclude Sources.*.new --ignore-errors ${ftpdir}/. .
+
+ # Ugly "hack", but hey, it does what we want.
+ cp ${TRACEFILE} ${TRACEFILE_BDO}
+
+ for archive in "${public_archives[@]}"; do
+ archiveroot="$(get_archiveroot "${archive}")"
+ mirrordir="${archiveroot}/../mirror"
+ cd ${mirrordir}
+ rsync -aH --link-dest ${archiveroot} --delete --delete-after --delete-excluded --exclude Packages.*.new --exclude Sources.*.new --ignore-errors ${archiveroot}/. .
+ done
}
function expire() {
}
function dm() {
- log "Updating DM html page"
- $scriptsdir/dm-monitor >$webdir/dm-uploaders.html
+ log "Updating DM permissions page"
+ dak acl export-per-source dm >$exportdir/dm.txt
}
function bts() {
function ddaccess() {
# Tell our dd accessible mirror to sync itself up. Including ftp dir.
log "Trigger dd accessible parts sync including ftp dir"
- ssh -o Batchmode=yes -o ConnectTimeout=30 -o SetupTimeout=30 -2 -i ${base}/s3kr1t/pushddmirror dak@ries.debian.org pool
+ ${scriptsdir}/sync-dd ries-sync ries-sync1 ries-sync2 pool
}
function mirrorpush() {
while read SHASUM SIZE NAME; do
if ! [ -f "${subdir}/${NAME}" ]; then
bname=$(basename ${NAME})
- if [ "${bname}" = "Packages" ] || [ "${bname}" = "Sources" ]; then
+ if [[ "${bname}" =~ ^(Packages|Sources|Translation-[a-zA-Z_]+)$ ]]; then
# We don't keep unpacked files, don't check for their existance.
# We might want to go and check their unpacked shasum, but right now
# I don't care. I believe it should be enough if all the packed shasums
# match.
continue
fi
- broken=$(( broken + 1 ))
+ broken=$(( broken + 1 ))
echo "File ${subdir}/${NAME} is missing"
continue
fi
echo "Using dak v1" >> /srv/ftp.debian.org/web/mirrorstart
echo "Running on host $(hostname -f)" >> /srv/ftp.debian.org/web/mirrorstart
sudo -H -u archvsync /home/archvsync/runmirrors > ~dak/runmirrors.log 2>&1 &
+ sudo -H -u archvsync /home/archvsync/runmirrors -a backports > ~dak/runmirrorsbpo.log 2>&1 &
}
function i18n2() {
STAMP=$(date "+%Y%m%d%H%M")
mkdir -p ${scriptdir}/i18n/${STAMP}
cd ${scriptdir}/i18n/${STAMP}
- dak control-suite -l stable > squeeze
- dak control-suite -l testing > wheezy
- dak control-suite -l unstable > sid
+ for suite in stable testing unstable; do
+ codename=$(dak admin s show ${suite}|grep '^Codename')
+ codename=${codename##* }
+ echo "Codename is ${codename}"
+ dak control-suite -l ${suite} >${codename}
+ done
echo "${STAMP}" > timestamp
- gpg --secret-keyring /srv/ftp-master.debian.org/s3kr1t/dot-gnupg/secring.gpg --keyring /srv/ftp-master.debian.org/s3kr1t/dot-gnupg/pubring.gpg --no-options --batch --no-tty --armour --default-key 55BE302B --detach-sign -o timestamp.gpg timestamp
+ gpg --secret-keyring /srv/ftp-master.debian.org/s3kr1t/dot-gnupg/secring.gpg --keyring /srv/ftp-master.debian.org/s3kr1t/dot-gnupg/pubring.gpg --no-options --batch --no-tty --armour --default-key 473041FA --detach-sign -o timestamp.gpg timestamp
rm -f md5sum
md5sum * > md5sum
cd ${webdir}/
dak stats pkg-nums > $webdir/pkg-nums
}
-function aptftpcleanup() {
- log "Clean up apt-ftparchive's databases"
- cd $configdir
- apt-ftparchive -q clean apt.conf
-}
-
function cleantransactions() {
log "Cleanup transaction ids older than 3 months"
cd $base/backup/
sync_debbugs
}
-# do a run of newstage only before dinstall is on.
-function newstage() {
- log "Processing the newstage queue"
- UNCHECKED_WITHOUT_LOCK="-p"
- do_newstage
-}
-
# Function to update a "statefile" telling people what we are doing
# (more or less).
#
# extract changelogs and stuff
function changelogs() {
- log "Extracting changelogs"
- dak make-changelog -e
- mkdir -p ${exportpublic}/changelogs
- cd ${exportpublic}/changelogs
- rsync -aHW --delete --delete-after --ignore-errors ${exportdir}/changelogs/. .
- sudo -H -u archvsync /home/archvsync/runmirrors metaftpdo > ~dak/runmirrors-metadata.log 2>&1 &
+ if lockfile -r3 $LOCK_CHANGELOG; then
+ log "Extracting changelogs"
+ dak make-changelog -e -a ftp-master
+ [ -f ${exportdir}/changelogs/filelist.yaml ] && xz -f ${exportdir}/changelogs/filelist.yaml
+ mkdir -p ${exportpublic}/changelogs
+ cd ${exportpublic}/changelogs
+ rsync -aHW --delete --delete-after --ignore-errors ${exportdir}/changelogs/. .
+ sudo -H -u staticsync /usr/local/bin/static-update-component ftp-master.metadata.debian.org >/dev/null 2>&1 &
+
+ dak make-changelog -e -a backports
+ [ -f /srv/backports-master.debian.org/export/changelogs/filelist.yaml ] && xz -f /srv/backports-master.debian.org/export/changelogs/filelist.yaml
+ mkdir -p /srv/backports-master.debian.org/rsync/export/changelogs
+ cd /srv/backports-master.debian.org/rsync/export/changelogs
+ rsync -aHW --delete --delete-after --ignore-errors /srv/backports-master.debian.org/export/changelogs/. .
+ remove_changelog_lock
+ trap remove_changelog_lock EXIT TERM HUP INT QUIT
+ fi
}
function gitpdiff() {
# Also, we only want contents, packages and sources.
for file in $(find ../dists/ -regex ".*/\(Contents-\($archs\)\|\(Packages\|Sources\)\).gz"); do
log "${file}"
- base=${file%%.gz};
- base=${base##../};
- dir=${base%/*};
+ basen=${file%%.gz};
+ basen=${basen##../};
+ dir=${basen%/*};
mkdir -p $dir;
- zcat $file > $base;
+ zcat $file > $basen;
done
# Second, add all there is into git