]> git.donarmstrong.com Git - dak.git/commitdiff
merge from master
authorMike O'Connor <stew@vireo.org>
Fri, 13 Mar 2009 13:30:41 +0000 (09:30 -0400)
committerMike O'Connor <stew@vireo.org>
Fri, 13 Mar 2009 13:30:41 +0000 (09:30 -0400)
Signed-off-by: Mike O'Connor <stew@vireo.org>
14 files changed:
config/debian/cron.dinstall
config/debian/dak.conf
config/debian/extensions.py
dak/bts_categorize.py
dak/generate_index_diffs.py
dak/generate_releases.py
dak/init_db.py
dak/process_new.py
daklib/binary.py
docs/meta/lenny/README.Debian [new file with mode: 0644]
docs/meta/lenny/changelog [new file with mode: 0644]
docs/meta/lenny/copyright [new file with mode: 0644]
docs/meta/lenny/ftpmaster-lenny [new file with mode: 0644]
tools/removals.pl

index 383ba3346aaa4f3a32dec93b8c7270a6eded8a17..599a96d4fd2f464df4bd36ecb583dc6d74caa825 100755 (executable)
@@ -43,6 +43,12 @@ function cleanup() {
        rm -f ${LOCK_ACCEPTED}
 }
 
+# If we error out this one is called, *FOLLOWED* by cleanup above
+function onerror() {
+    ERRDATE=$(date "+%Y.%m.%d-%H:%M:%S")
+    cat "$LOGFILE" | mail -s "ATTENTION ATTENTION! dinstall error at ${ERRDATE} (Be quiet, Brain, or I'll stab you with a Q-tip)" cron@ftp-master.debian.org
+}
+
 ########################################################################
 # the actual dinstall functions follow                                 #
 ########################################################################
@@ -74,9 +80,20 @@ function pgdump_pre() {
 function pgdump_post() {
     log "Creating post-daily-cron-job backup of projectb database..."
     cd $base/backup
-    POSTDUMP=$base/backup/dump_$(date +%Y.%m.%d-%H:%M:%S)
-    pg_dump projectb > $POSTDUMP
-    ln -sf $POSTDUMP current
+    POSTDUMP=$(date +%Y.%m.%d-%H:%M:%S)
+    pg_dump projectb > $base/backup/dump_$POSTDUMP
+    pg_dumpall --globals-only > $base/backup/dumpall_$POSTDUMP
+    ln -sf $base/backup/dump_$POSTDUMP current
+    ln -sf $base/backup/dumpall_$POSTDUMP currentall
+}
+
+# Load the dak-dev projectb
+function pgdakdev() {
+    cd $base/backup
+    echo "drop database projectb" | psql -p 5433 template1
+       cat currentall | psql -p 5433 template1
+    createdb -p 5433 -T template0 projectb
+    fgrep -v '\connect' current | psql -p 5433 projectb
 }
 
 # Updating various files
@@ -267,9 +284,9 @@ function bts() {
 }
 
 function merkel2() {
-    # Push katie@merkel so it syncs the projectb there. Returns immediately, the sync runs detached
+    # Push dak@merkel so it syncs the projectb there. Returns immediately, the sync runs detached
     log "Trigger merkels projectb sync"
-    ssh -2 -o BatchMode=yes -o SetupTimeOut=30 -o ConnectTimeout=30 -i ~/.ssh/push_merkel_projectb katie@merkel.debian.org sleep 1
+    ssh -2 -o BatchMode=yes -o SetupTimeOut=30 -o ConnectTimeout=30 -i ~/.ssh/push_merkel_projectb dak@merkel.debian.org sleep 1
 }
 
 function runparts() {
@@ -329,20 +346,29 @@ function savetimestamp() {
        echo ${NOW} > "${dbdir}/dinstallstart"
 }
 
+function maillogfile() {
+    cat "$LOGFILE" | mail -s "Log for dinstall run of ${NOW}" cron@ftp-master.debian.org
+}
+
 function renamelogfile() {
-       if [ -f "${dbdir}/dinstallstart" ]; then
-               RENAMETO=$(cat "${dbdir}/dinstallstart")
-               mv "$LOGFILE" "$logdir/dinstall_${RENAMETO}.log"
-               logstats "$logdir/dinstall_${RENAMETO}.log"
-               bzip2 -9 "$logdir/dinstall_${RENAMETO}.log"
-       else
-               error "Problem, I don't know when dinstall started, unable to do log statistics."
-               NOW=`date "+%Y.%m.%d-%H:%M:%S"`
-               mv "$LOGFILE" "$logdir/dinstall_${NOW}.log"
-               bzip2 -9 "$logdir/dinstall_${NOW}.log"
-       fi
+    if [ -f "${dbdir}/dinstallstart" ]; then
+        NOW=$(cat "${dbdir}/dinstallstart")
+        maillogfile
+    mv "$LOGFILE" "$logdir/dinstall_${NOW}.log"
+        logstats "$logdir/dinstall_${NOW}.log"
+        bzip2 -9 "$logdir/dinstall_${NOW}.log"
+    else
+        error "Problem, I don't know when dinstall started, unable to do log statistics."
+        NOW=`date "+%Y.%m.%d-%H:%M:%S"`
+        maillogfile
+        mv "$LOGFILE" "$logdir/dinstall_${NOW}.log"
+        bzip2 -9 "$logdir/dinstall_${NOW}.log"
+    fi
 }
 
+function testingsourcelist() {
+    dak ls -s testing -f heidi -r .| egrep 'source$' > ${webdir}/testing.list
+}
 ########################################################################
 ########################################################################
 
@@ -384,10 +410,10 @@ function stage() {
     # it has to cd first!
     cd ${configdir}
 
-       if [ -f "${LOCK_STOP}" ]; then
-               log "${LOCK_STOP} exists, exiting immediately"
-               exit 42
-       fi
+    if [ -f "${LOCK_STOP}" ]; then
+        log "${LOCK_STOP} exists, exiting immediately"
+        exit 42
+    fi
 
     if [ "${ERR}" = "false" ]; then
         set +e
@@ -406,10 +432,10 @@ function stage() {
         ts "${TIME}"
     fi
 
-       if [ -f "${LOCK_STOP}" ]; then
-               log "${LOCK_STOP} exists, exiting immediately"
-               exit 42
-       fi
+    if [ -f "${LOCK_STOP}" ]; then
+        log "${LOCK_STOP} exists, exiting immediately"
+        exit 42
+    fi
 }
 
 ########################################################################
@@ -466,7 +492,8 @@ LOCK_BRITNEY="$lockdir/britney.lock"
 LOCK_STOP="$lockdir/archive.stop"
 
 lockfile -l 3600 "${LOCK_DAILY}"
-trap cleanup EXIT ERR TERM HUP INT QUIT
+trap onerror ERR
+trap cleanup EXIT TERM HUP INT QUIT
 
 touch "${LOCK_BRITNEY}"
 
@@ -663,6 +690,14 @@ GO=(
 )
 stage $GO
 
+GO=(
+    FUNC="pgdakdev"
+    TIME="dak-dev db"
+    ARGS=""
+    ERR="false"
+)
+stage $GO
+
 GO=(
     FUNC="expire"
     TIME="expire_dumps"
@@ -691,7 +726,7 @@ GO=(
     FUNC="bts"
     TIME=""
     ARGS=""
-    ERR=""
+    ERR="false"
 )
 stage $GO
 
@@ -729,6 +764,13 @@ GO=(
 )
 stage $GO
 
+GO=(
+    FUNC="testingsourcelist"
+    TIME=""
+    ARGS=""
+    ERR="false"
+)
+
 rm -f ${LOCK_BRITNEY}
 
 GO=(
@@ -751,8 +793,6 @@ log "Daily cron scripts successful, all done"
 
 exec > "$logdir/afterdinstall.log" 2>&1
 
-cat "$LOGFILE" | mail -s "Log for dinstall run of ${NOW}" cron@ftp-master.debian.org
-
 GO=(
     FUNC="renamelogfile"
     TIME=""
index 60df7567f568ba1bb441c2277a4f4ab12d37dad0..b8560c5ef98d93b1c9efd26bfd866fb705edde5b 100644 (file)
@@ -8,7 +8,7 @@ Dinstall
    SigningKeyring "/srv/ftp.debian.org/s3kr1t/dot-gnupg/secring.gpg";
    SigningPubKeyring "/srv/ftp.debian.org/s3kr1t/dot-gnupg/pubring.gpg";
    SigningKeyIds "6070D3A1";
-   SendmailCommand "/usr/sbin/sendmail -odq -oi -t";
+   SendmailCommand "/usr/sbin/sendmail -odq -oi -t -f envelope@ftp-master.debian.org";
    MyEmailAddress "Debian Installer <installer@ftp-master.debian.org>";
    MyAdminAddress "ftpmaster@debian.org";
    MyHost "debian.org";  // used for generating user@my_host addresses in e.g. manual_reject()
@@ -317,12 +317,12 @@ Suite
          {
            Stable;
          };
-         MustBeOlderThan
-         {
-           Testing;
-           Unstable;
-           Experimental;
-         };
+//       MustBeOlderThan
+//       {
+//         Testing;
+//         Unstable;
+//         Experimental;
+//       };
          Enhances
           {
            Stable;
@@ -378,7 +378,7 @@ Suite
          MustBeNewerThan
          {
            Stable;
-           Proposed-Updates;
+//         Proposed-Updates;
            Testing;
          };
          MustBeOlderThan
@@ -439,7 +439,7 @@ Suite
          MustBeNewerThan
          {
            Stable;
-           Proposed-Updates;
+//         Proposed-Updates;
            Testing;
            Testing-Proposed-Updates;
          };
@@ -473,7 +473,7 @@ Suite
          MustBeNewerThan
          {
            Stable;
-           Proposed-Updates;
+//         Proposed-Updates;
            Testing;
            Testing-Proposed-Updates;
            Unstable;
index 0bb51bd7e8d6281f776a578efb0a95c1fd3b4796..83ae307626ebc65fa34b78ab107046b0273d557b 100644 (file)
@@ -2,7 +2,7 @@ import sys, os, textwrap
 
 import apt_pkg
 import daklib.utils, daklib.database
-import syck
+import yaml
 
 import daklib.extensions
 from daklib.extensions import replace_dak_function
@@ -30,8 +30,8 @@ def check_transition():
     sourcefile = file(transpath, 'r')
     sourcecontent = sourcefile.read()
     try:
-        transitions = syck.load(sourcecontent)
-    except syck.error, msg:
+        transitions = yaml.load(sourcecontent)
+    except yaml.YAMLError, msg:
         # This shouldn't happen, there is a wrapper to edit the file which
         # checks it, but we prefer to be safe than ending up rejecting
         # everything.
index fd9cd090653b640890f31964b57171dc505de16e..1e0349d0d0ebb67ed9381a9abf9fe856033e05cc 100755 (executable)
@@ -122,10 +122,14 @@ class BugClassifier(object):
         controls = ""
 
         bc = BugClassifier()
-        for bug in bc.unclassified_bugs():
-            controls += bc.classify_bug(bug)
-
-        return controls
+        try:
+            for bug in bc.unclassified_bugs():
+                controls += bc.classify_bug(bug)
+
+            return controls
+        except:
+            log.error("couldn't retreive bugs from soap interface: %s" % sys.exc_info()[0])
+            return None
 
 def send_email(commands, simulate=False):
     global Cnf
index 2b06146b3b1e00aeff6bfaacebe56cbd0932605d..774e0467d99efd0673159f65378164d9d0b97048 100755 (executable)
@@ -37,7 +37,9 @@ import tempfile
 import subprocess
 import time
 import apt_pkg
+import pg
 from daklib import utils
+from daklib import database
 
 ################################################################################
 
@@ -278,7 +280,7 @@ def genchanges(Options, outdir, oldfile, origfile, maxdiffs = 14):
 
 
 def main():
-    global Cnf, Options, Logger
+    global Cnf, Options, Logger, projectB
 
     os.umask(0002)
 
@@ -309,6 +311,9 @@ def main():
 
     if Options.has_key("RootDir"): Cnf["Dir::Root"] = Options["RootDir"]
 
+    projectB = pg.connect(Cnf["DB::Name"], Cnf["DB::Host"], int(Cnf["DB::Port"]))
+    database.init(Cnf, projectB)
+
     if not suites:
         suites = Cnf.SubTree("Suite").List()
 
@@ -322,7 +327,9 @@ def main():
 
         suite = suite.lower()
 
-        architectures = SuiteBlock.ValueList("Architectures")
+        architectures = database.get_suite_architectures(suite)
+        if architectures == None:
+            architectures = []
 
         if SuiteBlock.has_key("Components"):
             components = SuiteBlock.ValueList("Components")
index 95b32c17d7a42b8cb52494f5b381dd33b9a21c78..983c8573f17aacde6f3a8721fb38028db3206f2a 100755 (executable)
@@ -237,6 +237,13 @@ def main ():
         files = []
 
         if AptCnf.has_key("tree::%s" % (tree)):
+            if AptCnf.has_key("tree::%s::Contents" % (tree)):
+                pass
+            else:
+                for x in os.listdir("%s/%s" % (Cnf["Dir::Root"], tree)):
+                    if x.startswith('Contents-'):
+                        files.append(x)
+
             for sec in AptCnf["tree::%s::Sections" % (tree)].split():
                 for arch in AptCnf["tree::%s::Architectures" % (tree)].split():
                     if arch == "source":
index 31a2a5a7b9d022db2f660a4564e0c21496720ee9..af0a03b2a3e32e32b3c125c4f4f9bc0d565c81e3 100755 (executable)
@@ -23,8 +23,8 @@ import psycopg2, sys
 import apt_pkg
 
 from daklib import utils
-from daklib.dbconn import DBConn
-from daklib.config import Config
+from daklib.DBConn import DBConn
+from daklib.Config import Config
 
 ################################################################################
 
index 8741d25ec887e0e19304b174473772ab47ae5119..acc4522f31046141babcefb776017e14194df674 100755 (executable)
@@ -1,9 +1,12 @@
 #!/usr/bin/env python
 # vim:set et ts=4 sw=4:
 
-""" Handles NEW and BYHAND packages """
-# Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006  James Troup <james@nocrew.org>
+""" Handles NEW and BYHAND packages
 
+@contact: Debian FTP Master <ftpmaster@debian.org>
+@copyright: 2001, 2002, 2003, 2004, 2005, 2006  James Troup <james@nocrew.org>
+@license: GNU General Public License version 2 or later
+"""
 # This program is free software; you can redistribute it and/or modify
 # it under the terms of the GNU General Public License as published by
 # the Free Software Foundation; either version 2 of the License, or
 
 ################################################################################
 
-import copy, errno, os, readline, stat, sys, time
+import copy
+import errno
+import os
+import readline
+import stat
+import sys
+import time
 import apt_pkg, apt_inst
 import examine_package
 from daklib import database
@@ -47,10 +56,10 @@ from daklib import utils
 from daklib.regexes import re_no_epoch, re_default_answer, re_isanum
 
 # Globals
-Cnf = None
+Cnf = None       #: Configuration, apt_pkg.Configuration
 Options = None
 Upload = None
-projectB = None
+projectB = None  #: database connection, pgobject
 Logger = None
 
 Priorities = None
@@ -727,6 +736,9 @@ def init():
             Cnf["Process-New::Options::%s" % (i)] = ""
 
     changes_files = apt_pkg.ParseCommandLine(Cnf,Arguments,sys.argv)
+    if len(changes_files) == 0 and not Cnf.get("Process-New::Options::Comments-Dir",""):
+        changes_files = utils.get_changes_files(Cnf["Dir::Queue::New"])
+
     Options = Cnf.SubTree("Process-New::Options")
 
     if Options["Help"]:
index 8dd9b30113cdf7800aa2420d0e0726a3a5374d2b..57b0f65ddd30183f67a670733a6a5d3abe8c5ade 100755 (executable)
@@ -191,7 +191,6 @@ class Binary(object):
 
             except:
                 traceback.print_exc()
-                result = False
 
         os.chdir(cwd)
         return result
diff --git a/docs/meta/lenny/README.Debian b/docs/meta/lenny/README.Debian
new file mode 100644 (file)
index 0000000..49659fc
--- /dev/null
@@ -0,0 +1,11 @@
+ftpmaster meta package for DSA
+
+
+This is a dummy package that makes Debian's package management
+system believe that certain packages needed for ftpmaster have
+to be installed. The intention is that DSA can easily see what
+needs to be there.
+
+If you, for whatever reason, need a package added to this meta-
+packages dependency list, contact ftpmaster@debian.org, NOT
+the Debian admins.
diff --git a/docs/meta/lenny/changelog b/docs/meta/lenny/changelog
new file mode 100644 (file)
index 0000000..f2449b8
--- /dev/null
@@ -0,0 +1,6 @@
+ftpmaster-lenny (1.0) unstable; urgency=low
+
+  * New "package", to help DSA
+
+ -- Joerg Jaspert <joerg@debian.org>  Mon, 09 Mar 2009 14:09:09 +0100
+
diff --git a/docs/meta/lenny/copyright b/docs/meta/lenny/copyright
new file mode 100644 (file)
index 0000000..f778e68
--- /dev/null
@@ -0,0 +1,25 @@
+This package was put together by:
+
+    Joerg Jaspert <joerg@debian.org> on Mon, 09 Mar 2009 14:07:44 +0100
+
+Copyright:
+
+    <Copyright (C) 2009 Joerg Jaspert>
+
+License:
+
+   This package is free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License version 2 as
+   published by the Free Software Foundation.
+
+    This package is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+    GNU General Public License for more details.
+
+    You should have received a copy of the GNU General Public License
+    along with this package; if not, write to the Free Software
+    Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA
+
+On Debian systems, the complete text of the GNU General
+Public License can be found in `/usr/share/common-licenses/GPL'.
diff --git a/docs/meta/lenny/ftpmaster-lenny b/docs/meta/lenny/ftpmaster-lenny
new file mode 100644 (file)
index 0000000..1448862
--- /dev/null
@@ -0,0 +1,22 @@
+Section: devel
+Priority: optional
+Standards-Version: 3.8.1
+
+Package: ftpmaster-lenny
+Version: 1.0
+Maintainer: Debian FTP Master <ftpmaster@debian.org>
+Depends: apt-utils, bicyclerepair, binutils-multiarch, build-essential, bzip2, cron, curl, cvs, debian-el, debian-bug, dpkg-dev-el, easypg, devscripts, emacs-goodies-el, emacs22-nox, gnupg, gpgv, graphviz, ikiwiki, irb, libapt-pkg-dev, libdbd-pg-ruby, lintian, mc, mutt, postgresql-plperl-8.3, pychecker, pylint, pymacs, python, python-apt, python-btsutils, python-debian, python-epydoc, python-ldap, python-mode, python-numpy, python-psycopg2, python-pygresql, python-pyrss2gen, python-soappy, python-yaml, r-base, rsync, ruby, ruby-elisp, subversion, git-core, symlinks
+Architecture: all
+Copyright: copyright
+Changelog: changelog
+Readme: README.Debian
+Description: Meta package for DSA listing ftpmaster needs
+ This is a small meta package for the Debian System Administrators
+ so DSA easily knows (and can keep installed) all packages
+ Ftpmaster needs.
+ .
+ If, for whatever reason, you need a package added to this ones
+ Dependencies, ask ftpmaster, not the Debian admins.
+ .
+ This is not only "What DAK needs", but a general "FTPMaster needs this
+ to do the work"
index b07845bf0c122d1e04b75b4d5070313ddae7a68d..839fc618c9e060f7fe929825589c1b3a55950af7 100755 (executable)
@@ -71,7 +71,7 @@ for my $removal (@removals ) {
 
   $rss->add_item(title       => "$reason",
                                 link        => "http://ftp-master.debian.org/removals.txt?" . $link,
-                                description => qq[&lt;pre&gt;$body&lt;/pre&gt;],
+                                description => qq[<pre>$body</pre>],
                                 dc => {
                                                creator => "$ftpmaster",
                                           }