[Pkg-ocaml-maint-commits] r3991 - /trunk/tools/ocaml-debian-status/debian-ocaml-status.py

zack at users.alioth.debian.org zack at users.alioth.debian.org
Thu Jul 12 15:09:41 UTC 2007


Author: zack
Date: Thu Jul 12 15:09:41 2007
New Revision: 3991

URL: http://svn.debian.org/wsvn/?sc=1&rev=3991
Log:
bugfix: handle binNMU properly by stripping the ' (x.y.z)' part from the Source field

Modified:
    trunk/tools/ocaml-debian-status/debian-ocaml-status.py

Modified: trunk/tools/ocaml-debian-status/debian-ocaml-status.py
URL: http://svn.debian.org/wsvn/trunk/tools/ocaml-debian-status/debian-ocaml-status.py?rev=3991&op=diff
==============================================================================
--- trunk/tools/ocaml-debian-status/debian-ocaml-status.py (original)
+++ trunk/tools/ocaml-debian-status/debian-ocaml-status.py Thu Jul 12 15:09:41 2007
@@ -28,6 +28,16 @@
     if not isinstance(entry, dict): # backward compatibility for debian_support
         entry = dict(map(lambda (x, y): (x.lower(), y), entry))
     return entry
+
+def normalize_src(src_value):
+    """'Source' field values of binNMU-ed packages are of the form 'src
+    (source_version)'. Remove the source_version part so that we can use the
+    field as a key in the source package namespace.
+
+    E.g. "pxp (1.1.96-8)" -> "pxp"
+    """
+
+    return src_value.split()[0]
 
 def smart_open(fname):
     """Transparently open a compressed (or not) file."""
@@ -63,7 +73,7 @@
     if pkg.has_key('depends'):
         match = ocaml_virtdep_RE.search(pkg['depends'])
         if match:   # triples: <src_name, src_version, ocaml_version>
-            status = (pkg['source'], pkg['version'],
+            status = (normalize_src(pkg['source']), pkg['version'],
                     match.groupdict()['version'])
     return status
 
@@ -79,6 +89,7 @@
         srcfile = debian_support.PackageFile('', fileObj=f)
         relevant_sources = relevant_sources.union(set(grep_sources(srcfile)))
         f.close()
+    #print relevant_sources
 
     # STEP 2: classify packages
     status = {}
@@ -92,7 +103,7 @@
             pkg = patch_pkg_dict(pkg)
             if not pkg.has_key('source'):
                 pkg['source'] = pkg['package']
-            if pkg['source'] in relevant_sources:
+            if normalize_src(pkg['source']) in relevant_sources:
                 pkg_status = eval_status(pkg)
                 if pkg_status:
                     src_name, src_version, ocaml_version = pkg_status




More information about the Pkg-ocaml-maint-commits mailing list