From: Ansgar Burchardt Date: Thu, 24 Mar 2011 08:45:37 +0000 (+0000) Subject: process-new: allow overrides to work for Package-Set X-Git-Url: https://git.decadent.org.uk/gitweb/?a=commitdiff_plain;h=0b2ebbc8e2792224ceab1d4021bf7ef2dea88152;p=dak.git 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 --- diff --git a/dak/process_new.py b/dak/process_new.py index 014dab90..dfdb2e97 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 74070c2f..0e34fece 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():