From: Ansgar Burchardt Date: Thu, 24 Mar 2011 08:36:15 +0000 (+0000) Subject: Make use of Package-Set in determine_new X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=84fc8be4951132dde1d06bfb5ee8a22efaeab7ab;p=dak 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 --- diff --git a/dak/process_new.py b/dak/process_new.py index 740ce6e8..014dab90 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 e95096e8..8405aeef 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 d8aec72b..74070c2f 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