]> err.no Git - dak/commitdiff
Make use of Package-Set in determine_new
authorAnsgar Burchardt <ansgar@debian.org>
Thu, 24 Mar 2011 08:36:15 +0000 (08:36 +0000)
committerAnsgar Burchardt <ansgar@debian.org>
Thu, 24 Mar 2011 08:36:15 +0000 (08:36 +0000)
Make use of the Package-Set field of an included .dsc file when looking
for NEW packages.  See http://bugs.debian.org/619131 for more
information.

Signed-off-by: Ansgar Burchardt <ansgar@debian.org>
dak/process_new.py
dak/show_new.py
daklib/queue.py

index 740ce6e809968daaf9c83a4426763b014577848a..014dab9026d9562dda8ca09b96a35076e527b4bc 100755 (executable)
@@ -424,11 +424,17 @@ def do_new(upload, session):
     # Make a copy of distribution we can happily trample on
     changes["suite"] = copy.copy(changes["distribution"])
 
+    # Try to get an included dsc
+    dsc = None
+    (status, _) = upload.load_dsc()
+    if status:
+        dsc = upload.pkg.dsc
+
     # The main NEW processing loop
     done = 0
     while not done:
         # Find out what's new
-        new, byhand = determine_new(upload.pkg.changes_file, changes, files, session=session)
+        new, byhand = determine_new(upload.pkg.changes_file, changes, files, dsc=dsc, session=session)
 
         if not new:
             break
@@ -667,6 +673,12 @@ def do_pkg(changes_full_path, session):
     u.logger = Logger
     origchanges = os.path.abspath(u.pkg.changes_file)
 
+    # Try to get an included dsc
+    dsc = None
+    (status, _) = u.load_dsc()
+    if status:
+        dsc = u.pkg.dsc
+
     cnf = Config()
     bcc = "X-DAK: dak process-new"
     if cnf.has_key("Dinstall::Bcc"):
@@ -691,7 +703,7 @@ def do_pkg(changes_full_path, session):
                 if not recheck(u, session):
                     return
 
-                new, byhand = determine_new(u.pkg.changes_file, u.pkg.changes, files, session=session)
+                new, byhand = determine_new(u.pkg.changes_file, u.pkg.changes, files, dsc=dsc, session=session)
                 if byhand:
                     do_byhand(u, session)
                 elif new:
index e95096e8c3276af48a51eb180d92d7f7f2a8f084..8405aeef9f0fe2391d9e969169b944db7abf179b 100755 (executable)
@@ -180,7 +180,7 @@ def do_pkg(changes_file):
             u.check_source_against_db(deb_filename, session)
     u.pkg.changes["suite"] = u.pkg.changes["distribution"]
 
-    new, byhand = determine_new(u.pkg.changes_file, u.pkg.changes, files, 0, session)
+    new, byhand = determine_new(u.pkg.changes_file, u.pkg.changes, files, 0, dsc=u.pkg.dsc, session=session)
 
     outfile = open(os.path.join(cnf["Show-New::HTMLPath"],htmlname),"w")
 
index d8aec72b9ec07d019e70e30c16a105c62769254c..74070c2fd1ca2887ee7ef8af3ffe65893b17b0bf 100755 (executable)
@@ -51,7 +51,7 @@ from holding import Holding
 from urgencylog import UrgencyLog
 from dbconn import *
 from summarystats import SummaryStats
-from utils import parse_changes, check_dsc_files
+from utils import parse_changes, check_dsc_files, build_package_set
 from textutils import fix_maintainer
 from lintian import parse_lintian_output, generate_reject_messages
 from contents import UnpackedSource
@@ -102,7 +102,7 @@ def get_type(f, session):
 
 # Determine what parts in a .changes are NEW
 
-def determine_new(filename, changes, files, warn=1, session = None):
+def determine_new(filename, changes, files, warn=1, session = None, dsc = None):
     """
     Determine what parts in a C{changes} file are NEW.
 
@@ -118,6 +118,9 @@ def determine_new(filename, changes, files, warn=1, session = None):
     @type warn: bool
     @param warn: Warn if overrides are added for (old)stable
 
+    @type dsc: Upload.Pkg.dsc dict
+    @param dsc: (optional); Dsc dictionary
+
     @rtype: dict
     @return: dictionary of NEW components.
 
@@ -131,6 +134,10 @@ def determine_new(filename, changes, files, warn=1, session = None):
     if dbchg is None:
         print "Warning: cannot find changes file in database; won't check byhand"
 
+    # Try to get the Package-Set field from an included .dsc file (if possible).
+    if dsc:
+        new = build_package_set(dsc, session)
+
     # Build up a list of potentially new things
     for name, f in files.items():
         # Keep a record of byhand elements