]> git.decadent.org.uk Git - dak.git/commitdiff
Merge remote branch 'drkranz/master' into merge
authorJoerg Jaspert <joerg@debian.org>
Fri, 5 Nov 2010 22:30:03 +0000 (23:30 +0100)
committerJoerg Jaspert <joerg@debian.org>
Fri, 5 Nov 2010 22:30:03 +0000 (23:30 +0100)
* drkranz/master:
  process_new.py: show NEW comments as a whole
  Use Changes-file as field name for deferred .changes files

Signed-off-by: Joerg Jaspert <joerg@debian.org>
dak/process_new.py
dak/show_deferred.py

index e23efb691ec5282612940bda33a40ea4eba04c84..740ce6e809968daaf9c83a4426763b014577848a 100755 (executable)
@@ -517,6 +517,7 @@ def usage (exit_code=0):
     print """Usage: dak process-new [OPTION]... [CHANGES]...
   -a, --automatic           automatic run
   -b, --no-binaries         do not sort binary-NEW packages first
+  -c, --comments            show NEW comments
   -h, --help                show this help and exit.
   -m, --manual-reject=MSG   manual reject with `msg'
   -n, --no-action           don't do anything
@@ -706,6 +707,23 @@ def do_pkg(changes_full_path, session):
     except AlreadyLockedError, e:
         print "Seems to be locked by %s already, skipping..." % (e)
 
+def show_new_comments(changes_files, session):
+    sources = set()
+    query = """SELECT package, version, comment, author
+               FROM new_comments
+               WHERE package IN ('"""
+
+    for changes in changes_files:
+        sources.add(os.path.basename(changes).split("_")[0])
+
+    query += "%s') ORDER BY package, version" % "', '".join(sources)
+    r = session.execute(query)
+
+    for i in r:
+        print "%s_%s\n%s\n(%s)\n\n\n" % (i[0], i[1], i[2], i[3])
+
+    session.commit()
+
 ################################################################################
 
 def end():
@@ -732,12 +750,13 @@ def main():
 
     Arguments = [('a',"automatic","Process-New::Options::Automatic"),
                  ('b',"no-binaries","Process-New::Options::No-Binaries"),
+                 ('c',"comments","Process-New::Options::Comments"),
                  ('h',"help","Process-New::Options::Help"),
                  ('m',"manual-reject","Process-New::Options::Manual-Reject", "HasArg"),
                  ('t',"trainee","Process-New::Options::Trainee"),
                  ('n',"no-action","Process-New::Options::No-Action")]
 
-    for i in ["automatic", "no-binaries", "help", "manual-reject", "no-action", "version", "trainee"]:
+    for i in ["automatic", "no-binaries", "comments", "help", "manual-reject", "no-action", "version", "trainee"]:
         if not cnf.has_key("Process-New::Options::%s" % (i)):
             cnf["Process-New::Options::%s" % (i)] = ""
 
@@ -767,13 +786,16 @@ def main():
         sys.stderr.write("Sorting changes...\n")
     changes_files = sort_changes(changes_paths, session, Options["No-Binaries"])
 
-    for changes_file in changes_files:
-        changes_file = utils.validate_changes_file_arg(changes_file, 0)
-        if not changes_file:
-            continue
-        print "\n" + os.path.basename(changes_file)
+    if Options["Comments"]:
+        show_new_comments(changes_files, session)
+    else:
+        for changes_file in changes_files:
+            changes_file = utils.validate_changes_file_arg(changes_file, 0)
+            if not changes_file:
+                continue
+            print "\n" + os.path.basename(changes_file)
 
-        do_pkg (changes_file, session)
+            do_pkg (changes_file, session)
 
     end()
 
index 2bb643d151508bac7b20577d1f0310c51eaeba36..28ecd7b6d62fb27ddd20a8e0bf0a5aa92613e247 100755 (executable)
@@ -172,7 +172,7 @@ def list_uploads(filelist):
         f = open(fn,"w")
         try:
             for u in uploads:
-                print >> f, "Changes: %s"%u[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])