cleantempfiles
- exit $ERRVAL
+ return $ERRVAL
}
TEMPFILES=${TEMPFILES:-""}
TMPFILES=${TMPFILES:-""}
+# Timestamp. Used for dinstall stat graphs
+function ts() {
+ echo "Archive maintenance timestamp ($1): $(date +%H:%M:%S)"
+}
########################################################################
########################################################################
# These versions used in dinstall
function punew() {
- if [ "${PROGRAM}" = "dinstall" ]; then
- log "Doing automated p-u-new processing"
- fi
+ log "Doing automated p-u-new processing"
cd "${queuedir}/p-u-new"
punew_do "$1" "${queuedir}/p-u-new" "debian-release@lists.debian.org"
}
function opunew() {
- if [ "${PROGRAM}" = "dinstall" ]; then
- log "Doing automated o-p-u-new processing"
- fi
+ log "Doing automated o-p-u-new processing"
cd "${queuedir}/o-p-u-new"
punew_do "$1" "${queuedir}/o-p-u-new" "debian-release@lists.debian.org"
}
local qdir="/srv/backports-master.debian.org/queue/policy"
local to="backports-team@debian.org"
- if [ "${PROGRAM}" = "dinstall" ]; then
- log "Doing automated ${queue} processing"
- fi
+ log "Doing automated ${queue} processing"
cd "${qdir}"
punew_do "${queue}" "${qdir}" "${to}"
# process NEW policy queue
function do_new () {
- if [ "${PROGRAM}" = "dinstall" ]; then
- log "Doing NEW processing"
- fi
+ log "Doing NEW processing"
(dak process-policy new; dak process-policy byhand) | mail -a "X-Debian: DAK" -e -s "NEW and BYHAND processing" -a "From: Debian FTP Masters <ftpmaster@ftp-master.debian.org>" ftpmaster@ftp-master.debian.org
dak process-policy backports-new | mail -a "X-Debian: DAK" -e -s "NEW processing for backports-new" -a "From: Debian FTP Masters <ftpmaster@ftp-master.debian.org>" backports-team@debian.org
# Prepare the trees for buildds, then push wanna-build
function do_buildd() {
- if lockfile -r3 $NOTICE; then
- TEMPFILES="${TEMPFILES} ${NOTICE}"
+ if lockfile -r3 ${LOCK_DAILY}; then
+ TMPFILES="${TMPFILES} ${LOCK_DAILY}"
make_buildd_dir
wbtrigger
fi
export LC_ALL=C
ARG=${1:-"meh"}
+
+# set DEBUG if you want to see a little more logs (needs to be used more)
+DEBUG=${DEBUG:-0}
+
# While this check can be done in the following case, some assumptions
# down there are easier if we sorted out calls without an arg before.
if [[ ${ARG} == meh ]]; then
# log "aborting cron.unchecked because $LOCK_UNCHECKED has already been locked"
exit 0
fi
- TEMPFILES="${TEMPFILES} ${LOCK_UNCHECKED}"
+ TMPFILES="${TMPFILES} ${LOCK_UNCHECKED}"
;;
dinstall)
;;
hourly)
# Only one of me should ever run.
FLOCKER=${FLOCKER:-""}
- [ "${FLOCKER}" != "${configdir}/${PROGRAM}.variables" ] && exec env FLOCKER="${configdir}/${PROGRAM}.variables" flock -E 0 -en "${configdir}/${PROGRAM}.variables" "$0"
- "$@" || :
+ [ "${FLOCKER}" != "${configdir}/${PROGRAM}.variables" ] && exec env FLOCKER="${configdir}/${PROGRAM}.variables" flock -E 0 -en "${configdir}/${PROGRAM}.variables" "$0" "$@" || :
;;
daily)
;;
esac
# An easy access by name for the current log
-ln -sf ${LOGFILE} ${PROGRAM}
+ln -sf ${LOGFILE} ${logdir}/${PROGRAM}
# And from here, all output to the log please
exec >> "$LOGFILE" 2>&1
# get the latest list of wnpp bugs and their source packages
function wnppbugs() {
TMPFILE=$( mktemp -p ${TMPDIR} )
- TEMPFILES="${TEMPFILES} ${TMPFILE}"
+ TMPFILES="${TMPFILES} ${TMPFILE}"
wget -q -O${TMPFILE} --ca-directory=/etc/ssl/ca-debian https://qa.debian.org/data/bts/wnpp_rm
chmod go+r ${TMPFILE}
mv ${TMPFILE} /srv/ftp-master.debian.org/scripts/masterfiles/wnpp_rm
function contributor() {
log "Submitting data to contributors"
TMPCNTB=$( mktemp -p ${TMPDIR} )
- TEMPFILES="${TEMPFILES} ${TMPCNTB}"
+ TMPFILES="${TMPFILES} ${TMPCNTB}"
REQUESTS_CA_BUNDLE=/etc/ssl/ca-debian/ca-certificates.crt dc-tool --mine="${configdir}/contributor.source" --auth-token @"${base}/s3kr1t/contributor.auth" --source ftp.debian.org --json > ${TMPCNTB}
# Post with curl as a workaround for #801506
# FUNC ARGS TIME ERR BG
-linkmorgue none none false true
wnppbugs none none false false
pushfilesdb none none false false
wbdump none none false false
overridedisp none none false false
newstats none none false false
contributor none none false false
-finalize none none false false
-
# -*- mode:sh -*-
-# Timestamp. Used for dinstall stat graphs
-function ts() {
- echo "Archive maintenance timestamp ($1): $(date +%H:%M:%S)"
-}
# Remove daily lock
# FIXME: Dead code when switched to cronscript
log "Generating package / file mapping"
for archive in "${public_archives[@]}"; do
+ log " archive: ${archive}"
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"
for archive in "${public_archives[@]}"; do
log " Generating Packages/Sources for ${archive}"
dak generate-packages-sources2 -a "${archive}"
function release() {
log "Generating Release files"
for archive in "${public_archives[@]}"; do
+ log " archive: ${archive}"
dak generate-releases -a "${archive}"
done
}
function startup() {
touch "${DINSTALLSTART}"
ts "startup"
- DINSTALLBEGIN="$(date -u +"%a %b %d %T %Z %Y (%s)")"
lockfile -l 3600 "${LOCK_DAILY}"
trap onerror ERR
- TEMPFILES="${TEMPFILES} ${LOCK_DAILY}"
touch "${LOCK_BRITNEY}"
+ TMPFILES="${TMPFILES} ${LOCK_DAILY} ${LOCK_BRITNEY}"
}
i18n2 none i18n\ 2 false true
stats none stats false true
testingsourcelist none none false true
-NOSTAGE rm\ -f\ "\${LOCK_BRITNEY}" none false false
cleantransactions none none false false
# Marker for dinstall end
DINSTALLEND="${lockdir}/dinstallend"
+# Timestamp for start
+DINSTALLBEGIN="$(date -u +"%a %b %d %T %Z %Y (%s)")"
+
# Lock cron.unchecked from doing work
LOCK_ACCEPTED="$lockdir/unchecked.lock"
function newoverview() {
# do not run show-new and other stuff in parallel
if lockfile -r16 $LOCK_UNCHECKED 2> /dev/null; then
- TEMPFILES="${TEMPFILES} ${LOCK_UNCHECKED}"
+ TMPFILES="${TMPFILES} ${LOCK_UNCHECKED}"
do_new
dak show-new > /dev/null || true
fi
# do the buildd key updates
function builddautosigning() {
BUILDDFUN=$(mktemp -p "${TMPDIR}" BUILDDFUN.XXXXXX)
- TEMPFILES="${TEMPFILEs} ${BUILDDFUN}"
+ TMPFILES="${TMPFILES} ${BUILDDFUN}"
exec >> "${BUILDDFUN}" 2>&1
${scriptsdir}/buildd-remove-keys
${scriptsdir}/buildd-add-keys
ddaccess none none true true
gen_di none none false false
backportsacl none none false false
-builddautosigning none none false false
\ No newline at end of file
+builddautosigning none none false false
# lock cron.unchecked (it immediately exits when this exists)
LOCK_DAILY="$lockdir/daily.lock"
LOCK_UNCHECKED="$lockdir/unchecked.lock"
+LOCK_STOP="$lockdir/archive.stop"
# Set the database variables
eval $(dak admin config db-shell)
# -*- mode:sh -*-
function purgeempty() {
- log "Purging empty directories in $ftpdir/pool/"
+ log "Purging empty directories"
+ local archiveroot
- if [ ! -z "$(find $ftpdir/pool/ -type d -empty)" ]; then
- find $ftpdir/pool/ -type d -empty | xargs rmdir;
- fi
+ for archive in "${public_archives[@]}"; do
+ log "... archive: ${archive}"
+ archiveroot="$(get_archiveroot "${archive}")"
+
+ # FIXME: double find
+ if [ ! -z "$(find ${archiveroot}/pool/ -type d -empty)" ]; then
+ find ${archiveroot}/pool/ -type d -empty | xargs rmdir;
+ fi
+ done
}
function gitcleanup() {
chmod -R g+w logs/
}
-function symlinks() {
- log "Fixing symlinks in $ftpdir"
- symlinks -d -r $ftpdir
+function fixsymlinks() {
+ log "Fixing symlinks"
+ local archiveroot
+
+ for archive in "${public_archives[@]}"; do
+ log "... archive: ${archive}"
+ archiveroot="$(get_archiveroot "${archive}")"
+ symlinks -d -r ${archiveroot}
+ done
}
# FUNC ARGS TIME ERR BG
-purgeempty none none false false
-gitcleanup none none false false
-symlinks none none false false
+purgeempty none none false true
+gitcleanup none none false true
+fixsymlinks none none false true
+linkmorgue none none false true