]> git.decadent.org.uk Git - dak.git/commitdiff
Merge remote-tracking branch 'ansgar/pu/multiarchive-1' into merge
authorJoerg Jaspert <joerg@debian.org>
Tue, 28 Aug 2012 18:47:13 +0000 (20:47 +0200)
committerJoerg Jaspert <joerg@debian.org>
Tue, 28 Aug 2012 18:47:13 +0000 (20:47 +0200)
* ansgar/pu/multiarchive-1:
  daklib/archive.py: fix automatic byhand processing
  move split_uploaders function to daklib.textutils
  daklib/archive.py: use first component for NEW packages if we don't have a better guess

Signed-off-by: Joerg Jaspert <joerg@debian.org>
dak/dakdb/update81.py [new file with mode: 0755]
dak/dakdb/update82.py [new file with mode: 0644]
dak/process_new.py
dak/queue_report.py
dak/show_deferred.py
dak/update_db.py
daklib/queue.py
templates/rm.bug-close-with-related

diff --git a/dak/dakdb/update81.py b/dak/dakdb/update81.py
new file mode 100755 (executable)
index 0000000..668eb9e
--- /dev/null
@@ -0,0 +1,46 @@
+#!/usr/bin/env python
+# coding=utf8
+
+"""
+Correct permissions of policy_queue_byhand_file_id_seq
+
+@contact: Debian FTP Master <ftpmaster@debian.org>
+@copyright: 2012 Luca Falavigna <dktrkranz@debian.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
+# (at your option) any later version.
+
+# This program 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 program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+
+################################################################################
+
+import psycopg2
+from daklib.dak_exceptions import DBUpdateError
+from daklib.config import Config
+
+################################################################################
+def do_update(self):
+    print __doc__
+    try:
+        cnf = Config()
+
+        c = self.db.cursor()
+        c.execute("GRANT SELECT, UPDATE, USAGE ON policy_queue_byhand_file_id_seq TO ftpmaster")
+        c.execute("GRANT SELECT ON policy_queue_byhand_file_id_seq TO public")
+        c.execute("UPDATE config SET value = '81' WHERE name = 'db_revision'")
+        self.db.commit()
+
+    except psycopg2.ProgrammingError as msg:
+        self.db.rollback()
+        raise DBUpdateError('Unable to apply sick update 81, rollback issued. Error message: {0}'.format(msg))
diff --git a/dak/dakdb/update82.py b/dak/dakdb/update82.py
new file mode 100644 (file)
index 0000000..174f869
--- /dev/null
@@ -0,0 +1,46 @@
+#!/usr/bin/env python
+# coding=utf8
+
+"""
+Correct permissions of policy_queue_upload_id_seq
+
+@contact: Debian FTP Master <ftpmaster@debian.org>
+@copyright: 2012 Luca Falavigna <dktrkranz@debian.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
+# (at your option) any later version.
+
+# This program 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 program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+
+################################################################################
+
+import psycopg2
+from daklib.dak_exceptions import DBUpdateError
+from daklib.config import Config
+
+################################################################################
+def do_update(self):
+    print __doc__
+    try:
+        cnf = Config()
+
+        c = self.db.cursor()
+        c.execute("GRANT SELECT, UPDATE, USAGE ON policy_queue_upload_id_seq TO ftpmaster")
+        c.execute("GRANT SELECT ON policy_queue_upload_id_seq TO public")
+        c.execute("UPDATE config SET value = '81' WHERE name = 'db_revision'")
+        self.db.commit()
+
+    except psycopg2.ProgrammingError as msg:
+        self.db.rollback()
+        raise DBUpdateError('Unable to apply sick update 82, rollback issued. Error message: {0}'.format(msg))
index 583143bb6f41e5381865218740e58739bf4a3da9..afd03d23c8283ee5410ac4cc4ab76f83def95c38 100755 (executable)
@@ -534,7 +534,7 @@ def do_new(upload, upload_copy, handler, session):
             missing = edit_overrides (missing, upload, session)
         elif answer == 'M' and not Options["Trainee"]:
             reason = Options.get('Manual-Reject', '') + "\n"
-            reason = reason + "\n".join([n.comment for n in get_new_comments(upload.changes.source, session=session)])
+            reason = reason + "\n\n=====\n\n".join([n.comment for n in get_new_comments(upload.changes.source, session=session)])
             reason = get_reject_reason(reason)
             if reason is not None:
                 Logger.log(["NEW REJECT", upload.changes.changesname])
index ad2a8531757db2a1d29a8a985d522f2c4df64a05..0ab0b732d48324c6fef38b3f834a1aa8bdf72a06 100755 (executable)
@@ -498,16 +498,16 @@ def process_queue(queue, log, rrd_dir):
         age =  Cnf["Queue-Report::Options::Age"]
     if Cnf.has_key("Queue-Report::Options::New"):
     # If we produce html we always have oldest first.
-        direction.append([5,-1,"ao"])
+        direction.append([6,-1,"ao"])
     else:
         if Cnf.has_key("Queue-Report::Options::Sort"):
             for i in Cnf["Queue-Report::Options::Sort"].split(","):
                 if i == "ao":
                     # Age, oldest first.
-                    direction.append([5,-1,age])
+                    direction.append([6,-1,age])
                 elif i == "an":
                     # Age, newest first.
-                    direction.append([5,1,age])
+                    direction.append([6,1,age])
                 elif i == "na":
                     # Name, Ascending.
                     direction.append([0,1,0])
@@ -516,10 +516,10 @@ def process_queue(queue, log, rrd_dir):
                     direction.append([0,-1,0])
                 elif i == "nl":
                     # Notes last.
-                    direction.append([4,1,0])
+                    direction.append([5,1,0])
                 elif i == "nf":
                     # Notes first.
-                    direction.append([4,-1,0])
+                    direction.append([5,-1,0])
     entries.sort(lambda x, y: sortfunc(x, y))
     # Yes, in theory you can add several sort options at the commandline with. But my mind is to small
     # at the moment to come up with a real good sorting function that considers all the sidesteps you
@@ -566,7 +566,7 @@ def process_queue(queue, log, rrd_dir):
     source_count = len(per_source_items)
 
     if Cnf.has_key("Queue-Report::Options::New"):
-        direction.append([5,1,"ao"])
+        direction.append([6,1,"ao"])
         entries.sort(lambda x, y: sortfunc(x, y))
     # Output for a html file. First table header. then table_footer.
     # Any line between them is then a <tr> printed from subroutine table_row.
index e7dded0f92393f846e88fad9f8aeebac4eabe84b..53f568e0df60844bd470095c330a03c8b1f13e94 100755 (executable)
@@ -27,6 +27,7 @@ import rrdtool
 from debian import deb822
 
 from daklib.dbconn import *
+from daklib.gpg import SignedFile
 from daklib import utils
 from daklib.regexes import re_html_escaping, html_escaping
 
@@ -109,11 +110,12 @@ def table_header():
 def table_footer():
     return '</table><br/><p>non-NEW uploads are <a href="/deferred/">available</a>, see the <a href="ftp://ftp-master.debian.org/pub/UploadQueue/README">UploadQueue-README</a> for more information.</p></center><br/>\n'
 
-def table_row(changesname, delay, changed_by, closes):
+def table_row(changesname, delay, changed_by, closes, fingerprint):
     global row_number
 
     res = '<tr class="%s">'%((row_number%2) and 'odd' or 'even')
-    res += (3*'<td valign="top">%s</td>')%tuple(map(html_escape,(changesname,delay,changed_by)))
+    res += (2*'<td valign="top">%s</td>')%tuple(map(html_escape,(changesname,delay)))
+    res += '<td valign="top">%s<br><span class=\"deferredfp\">Fingerprint: %s</span></td>' % (html_escape(changed_by), fingerprint)
     res += ('<td valign="top">%s</td>' %
              ''.join(map(lambda close:  '<a href="http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=%s">#%s</a><br>' % (close, close),closes)))
     res += '</tr>\n'
@@ -188,6 +190,8 @@ def get_upload_data(changesfn):
 
     uploader = achanges.get('changed-by')
     uploader = re.sub(r'^\s*(\S.*)\s+<.*>',r'\1',uploader)
+    with utils.open_file(changesfn) as f:
+        fingerprint = SignedFile(f.read(), keyrings=get_active_keyring_paths()).fingerprint
     if Cnf.has_key("Show-Deferred::LinkPath"):
         isnew = 0
         suites = get_suites_source_in(achanges['source'])
@@ -210,7 +214,7 @@ def get_upload_data(changesfn):
                 if os.path.exists(qfn):
                     os.symlink(qfn,lfn)
                     os.chmod(qfn, 0o644)
-    return (max(delaydays-1,0)*24*60*60+remainingtime, changesname, delay, uploader, achanges.get('closes','').split(),achanges, delaydays)
+    return (max(delaydays-1,0)*24*60*60+remainingtime, changesname, delay, uploader, achanges.get('closes','').split(), fingerprint, achanges, delaydays)
 
 def list_uploads(filelist, rrd_dir):
     uploads = map(get_upload_data, filelist)
@@ -219,7 +223,7 @@ def list_uploads(filelist, rrd_dir):
     print header()
     if uploads:
         print table_header()
-        print ''.join(map(lambda x: table_row(*x[1:5]), uploads)).encode('utf-8')
+        print ''.join(map(lambda x: table_row(*x[1:6]), uploads)).encode('utf-8')
         print table_footer()
     else:
         print '<h1>Currently no deferred uploads to Debian</h1>'
@@ -231,13 +235,14 @@ def list_uploads(filelist, rrd_dir):
         try:
             counts = [0]*16
             for u in uploads:
-                counts[u[6]] += 1
+                counts[u[7]] += 1
                 print >> f, "Changes-file: %s"%u[1]
                 fields = """Location: DEFERRED
 Delayed-Until: %s
-Delay-Remaining: %s"""%(time.strftime("%Y-%m-%d %H:%M:%S", time.gmtime(time.time()+u[0])),u[2])
+Delay-Remaining: %s
+Fingerprint: %s"""%(time.strftime("%Y-%m-%d %H:%M:%S", time.gmtime(time.time()+u[0])),u[2], u[5])
                 print >> f, fields
-                encoded = unicode(u[5]).encode('utf-8')
+                encoded = unicode(u[6]).encode('utf-8')
                 print >> f, encoded.rstrip()
                 open(os.path.join(Cnf["Show-Deferred::LinkPath"],u[1]),"w").write(encoded+fields+'\n')
                 print >> f
index c83459b258a6f97db4c139b426f36cfd2da5de06..5568caed698859cb47585c264ed15b47bac9011d 100755 (executable)
@@ -46,7 +46,7 @@ from daklib.daklog import Logger
 ################################################################################
 
 Cnf = None
-required_database_schema = 80
+required_database_schema = 82
 
 ################################################################################
 
index e81614c3e742e89a2b1b8c6538e8f65a712bcbe5..547972ed0932b6af669e836e96a61dbfcbdf100d 100644 (file)
@@ -108,8 +108,7 @@ def prod_maintainer(notes, upload):
     # Here we prepare an editor and get them ready to prod...
     (fd, temp_filename) = utils.temp_filename()
     temp_file = os.fdopen(fd, 'w')
-    for note in notes:
-        temp_file.write(note.comment)
+    temp_file.write("\n\n=====\n\n".join([note.comment for note in notes]))
     temp_file.close()
     editor = os.environ.get("EDITOR","vi")
     answer = 'E'
index 0cfabe7f0e932af27049c18a354da9accced34cc..e097a756e498bc69baa9e14f7abfe0746fc8a42a 100644 (file)
@@ -26,9 +26,9 @@ from unstable when removing them from testing causes no dependency
 problems. The release team can force a removal from testing if it is
 really needed, please contact them if this should be the case.
 
-We try to close Bugs which have been reported against this package
-automatically.  But please check all old bugs, if they where closed
-correctly or should have been re-assign to another package.
+We try to close bugs which have been reported against this package
+automatically. But please check all old bugs, if they were closed
+correctly or should have been re-assigned to another package.
 
 Thank you for reporting the bug, which will now be closed.  If you
 have further comments please address them to __BUG_NUMBER__@__BUG_SERVER__.