[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

[dak/master 4/5] Make use of Package-Set in determine_new



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 |   16 ++++++++++++++--
 dak/show_new.py    |    2 +-
 daklib/queue.py    |   11 +++++++++--
 3 files changed, 24 insertions(+), 5 deletions(-)

diff --git a/dak/process_new.py b/dak/process_new.py
index 740ce6e..014dab9 100755
--- a/dak/process_new.py
+++ b/dak/process_new.py
@@ -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:
diff --git a/dak/show_new.py b/dak/show_new.py
index e95096e..8405aee 100755
--- a/dak/show_new.py
+++ b/dak/show_new.py
@@ -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")
 
diff --git a/daklib/queue.py b/daklib/queue.py
index d8aec72..74070c2 100755
--- a/daklib/queue.py
+++ b/daklib/queue.py
@@ -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
-- 
1.7.2.5



Reply to: