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

[dak/master 5/5] process-new: allow overrides to work for Package-Set



New packages from Package-Set do not always have files assocciated with
them. In that case edited overrides would be lost once we call
override_new again. We pass the old new dictionary so we can preserve
this information.

Signed-off-by: Ansgar Burchardt <ansgar@debian.org>
---
 dak/process_new.py |    3 ++-
 daklib/queue.py    |   10 +++++++---
 2 files changed, 9 insertions(+), 4 deletions(-)

diff --git a/dak/process_new.py b/dak/process_new.py
index 014dab9..dfdb2e9 100755
--- a/dak/process_new.py
+++ b/dak/process_new.py
@@ -432,9 +432,10 @@ def do_new(upload, session):
 
     # The main NEW processing loop
     done = 0
+    new = {}
     while not done:
         # Find out what's new
-        new, byhand = determine_new(upload.pkg.changes_file, changes, files, dsc=dsc, session=session)
+        new, byhand = determine_new(upload.pkg.changes_file, changes, files, dsc=dsc, session=session, new=new)
 
         if not new:
             break
diff --git a/daklib/queue.py b/daklib/queue.py
index 74070c2..0e34fec 100755
--- a/daklib/queue.py
+++ b/daklib/queue.py
@@ -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, dsc = None):
+def determine_new(filename, changes, files, warn=1, session = None, dsc = None, new = {}):
     """
     Determine what parts in a C{changes} file are NEW.
 
@@ -121,13 +121,15 @@ def determine_new(filename, changes, files, warn=1, session = None, dsc = None):
     @type dsc: Upload.Pkg.dsc dict
     @param dsc: (optional); Dsc dictionary
 
+    @type new: dict
+    @param new: new packages as returned by a previous call to this function, but override information may have changed
+
     @rtype: dict
     @return: dictionary of NEW components.
 
     """
     # TODO: This should all use the database instead of parsing the changes
     # file again
-    new = {}
     byhand = {}
 
     dbchg = get_dbchange(filename, session)
@@ -136,7 +138,9 @@ def determine_new(filename, changes, files, warn=1, session = None, dsc = None):
 
     # Try to get the Package-Set field from an included .dsc file (if possible).
     if dsc:
-        new = build_package_set(dsc, session)
+        for package, entry in build_package_set(dsc, session).items():
+            if not new.has_key(package):
+                new[package] = entry
 
     # Build up a list of potentially new things
     for name, f in files.items():
-- 
1.7.2.5


Reply to: