From 9f9da35e524274a0a013279cbe0b52fb8f0d0930 Mon Sep 17 00:00:00 2001 From: Thomas Viehmann Date: Mon, 28 Apr 2008 23:22:27 +0000 Subject: [PATCH] remove checksums- from .dsc display --- dak/examine_package.py | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/dak/examine_package.py b/dak/examine_package.py index 31549e11..6aca60bc 100755 --- a/dak/examine_package.py +++ b/dak/examine_package.py @@ -274,21 +274,32 @@ def read_dsc (dsc_filename): dsc_file.close() filecontents = escape_if_needed(strip_pgp_signature(dsc_filename)) + keysinorder = [] + for l in filecontents.split('\n'): + m = re.match(r'([-a-zA-Z0-9]*):', l) + if m: + keysinorder.append(m.group(1)) if dsc.has_key("build-depends"): builddep = split_depends(dsc["build-depends"]) builddepstr = create_depends_string(builddep) - filecontents = re_builddep.sub("Build-Depends: "+builddepstr, filecontents) + dsc['build-depends'] = builddepstr if dsc.has_key("build-depends-indep"): builddepindstr = create_depends_string(split_depends(dsc["build-depends-indep"])) - filecontents = re_builddepind.sub("Build-Depends-Indep: "+builddepindstr, filecontents) + dsc['build-depends-indep'] = builddepindstr if dsc.has_key("architecture") : if (dsc["architecture"] != "any"): newarch = colour_output(dsc["architecture"], 'arch') - filecontents = re_arch.sub("Architecture: " + newarch, filecontents) + dsc['architecture'] = newarch + if dsc.has_key("files"): + dsc["files"] = '\n'+'\n'.join(map(lambda x: ' '+x, dsc["files"].split('\n'))) + + keysinorder = filter(lambda x: not x.lower().startswith('checksums-'), keysinorder) + + filecontents = ''.join(map(lambda x: '%s: %s\n'%(x,dsc[x.lower()]), keysinorder)) return filecontents def create_depends_string (depends_tree): -- 2.39.5