]> err.no Git - dak/commitdiff
remove checksums- from .dsc display
authorThomas Viehmann <tv@beamnet.de>
Mon, 28 Apr 2008 23:22:27 +0000 (23:22 +0000)
committerThomas Viehmann <tv@beamnet.de>
Mon, 28 Apr 2008 23:22:27 +0000 (23:22 +0000)
dak/examine_package.py

index 31549e11099c4a98aaa1cf6d81f3f940e25fcbdf..6aca60bc815bd4cb79d2d8edd25a61f501c335a3 100755 (executable)
@@ -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):