]> git.decadent.org.uk Git - dak.git/blobdiff - config/debian/dinstall.functions
New function for tempfile generation
[dak.git] / config / debian / dinstall.functions
index f4a1ef3e5460552c7514c9030d62bc9cac41a944..872357e1a490635b5c6f621c50b2290ee07b6f51 100644 (file)
@@ -1,11 +1,5 @@
 # -*- mode:sh -*-
 
-# Remove daily lock
-# FIXME: Dead code when switched to cronscript
-function remove_daily_lock() {
-    rm -f $LOCK_DAILY
-}
-
 # Remove changelog lock
 function remove_changelog_lock() {
     rm -f $LOCK_CHANGELOG
@@ -56,14 +50,48 @@ function qa1() {
     ssh -n -2 -i ~dak/.ssh/push_merkel_qa  -o BatchMode=yes -o SetupTimeOut=90 -o ConnectTimeout=90 qa@qa.debian.org sleep 1
 }
 
+function mirrorlists() {
+    local mldir="${scriptdir}/mirrorlist"
+    local masterlist=${mldir}/Mirrors.masterlist
+
+    cd ${mldir}
+
+    [[ -f ${HOME}/.cvspass ]] || touch ${HOME}/.cvspass
+
+    grep -q "anonscm.debian.org:/cvs/webwml" ~/.cvspass || \
+       echo ":pserver:anonymous@anonscm.debian.org:/cvs/webwml A" >> ${HOME}/.cvspass
+
+    cvs update
+
+    if [[ ! -f ${ftpdir}/README.mirrors.html ]] || [[ ${masterlist} -nt ${ftpdir}/README.mirrors.html ]]; then
+       rm -f ${ftpdir}/README.mirrors.{html,txt}
+       ${mldir}/mirror_list.pl -m ${masterlist} -t html > ${ftpdir}/README.mirrors.html
+       ${mldir}/mirror_list.pl -m ${masterlist} -t text > ${ftpdir}/README.mirrors.txt
+       log Updated archive version of mirrors file
+    fi
+}
+
+function mailingliststxt() {
+    cd ${ftpdir}/doc
+
+    log "Updating archive version of mailing-lists.txt"
+    wget ${wgetopts} https://www.debian.org/misc/mailing-lists.txt
+}
+
+function pseudopackages() {
+    cd ${scriptdir}/masterfiles
+
+    log "Updating archive version of pseudo-packages"
+    for file in maintainers description; do
+       wget ${wgetopts} https://bugs.debian.org/pseudopackages/pseudo-packages.${file}
+    done
+}
+
 # Updating various files
-function updates() {
-    log "Updating Bugs docu, Mirror list and mailing-lists.txt"
+function bugdoctxt() {
+    log "Updating Bugs docu"
     cd $configdir
     $scriptsdir/update-bugdoctxt
-    $scriptsdir/update-mirrorlists
-    $scriptsdir/update-mailingliststxt
-    $scriptsdir/update-pseudopackages.sh
 }
 
 # The first i18n one, syncing new descriptions
@@ -154,7 +182,7 @@ function fingerprints() {
     log "Updating fingerprints"
     dak import-keyring -L /srv/keyring.debian.org/keyrings/debian-keyring.gpg
 
-    OUTFILE=$(mktemp)
+    OUTFILE=$( gettempfile )
     dak import-keyring --generate-users "%s" /srv/keyring.debian.org/keyrings/debian-maintainers.gpg >"${OUTFILE}"
 
     if [ -s "${OUTFILE}" ]; then
@@ -663,8 +691,7 @@ function signotherfiles() {
     for archive in "${public_archives[@]}"; do
         log "... archive: ${archive}"
         archiveroot="$(get_archiveroot "${archive}")"
-        local TMPLO=$( mktemp -p ${TMPDIR} )
-        trap "rm -f ${TMPLO}" ERR EXIT TERM HUP INT QUIT
+        local TMPLO=$( gettempfile )
 
         cd ${archiveroot}
         rm -f extrafiles
@@ -682,3 +709,9 @@ function startup() {
     touch "${LOCK_BRITNEY}"
     TMPFILES="${TMPFILES} ${LOCK_DAILY} ${LOCK_BRITNEY}"
 }
+
+function postcronscript() {
+    logstats ${LOGFILE}
+    state "all done"
+    touch "${DINSTALLEND}"
+}
\ No newline at end of file