[python-debian/master] Add parsing of Binary: field to Sources

Filippo Giunchedi filippo at esaurito.net
Sun Jun 7 20:13:13 UTC 2009


Full parsing as PkgRelation might be a bit overkill as version and arch
are bound to be None.
On the other hand having a CommaSeparatedList class to parse only
comma-separated fields would be overkill as well.
---
 debian/changelog        |    6 +++++-
 debian_bundle/deb822.py |    2 +-
 tests/test_deb822.py    |   12 ++++++++++--
 3 files changed, 16 insertions(+), 4 deletions(-)

diff --git a/debian/changelog b/debian/changelog
index 8a60f6e..34d200c 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,5 +1,6 @@
 python-debian (0.1.14) UNRELEASED; urgency=low
 
+  [ Stefano Zacchiroli ]
   * setup.py.in: switch to setuptools, which are able to generate eggs;
     add matching build-dep on python-setuptools (Closes: #525694)
   * examples/deb822/: add new example render-dctrl, to render packages in
@@ -8,7 +9,10 @@ python-debian (0.1.14) UNRELEASED; urgency=low
     former approach is deprecated with python 2.6.
     Thanks to Loïc Minier for the patch. (Closes: #524061)
 
- -- Stefano Zacchiroli <zack at debian.org>  Sun, 26 Apr 2009 18:08:50 +0200
+  [ Filippo Giunchedi ]
+  * deb822: parse also Binary as PkgRelation, thus add .binary attribute
+
+ -- Filippo Giunchedi <filippo at debian.org>  Sun, 07 Jun 2009 22:00:21 +0200
 
 python-debian (0.1.13) unstable; urgency=low
 
diff --git a/debian_bundle/deb822.py b/debian_bundle/deb822.py
index 125f451..fb1ed7c 100644
--- a/debian_bundle/deb822.py
+++ b/debian_bundle/deb822.py
@@ -1024,7 +1024,7 @@ class Sources(Dsc, _PkgRelationMixin):
     """Represent an APT source package list"""
 
     _relationship_fields = [ 'build-depends', 'build-depends-indep',
-            'build-conflicts', 'build-conflicts-indep' ]
+            'build-conflicts', 'build-conflicts-indep', 'binary' ]
 
     def __init__(self, *args, **kwargs):
         Dsc.__init__(self, *args, **kwargs)
diff --git a/tests/test_deb822.py b/tests/test_deb822.py
index 10e98c5..2ac1812 100755
--- a/tests/test_deb822.py
+++ b/tests/test_deb822.py
@@ -719,7 +719,8 @@ class TestPkgRelations(unittest.TestCase):
                         'version': None}],
                     [{'name': 'autoconf', 'version': None, 'arch': None}],
                     [{'name': 'debhelper', 'version': ('>>', '5.0.0'), 'arch': None}]],
-                'build-depends-indep': []}
+                'build-depends-indep': [],
+                'binary': [[{'name': 'apache2-mpm-itk', 'version': None, 'arch': None}]]}
         self.assertEqual(rel1, pkg1.relations)
         pkg2 = pkgs.next()
         rel2 = {'build-conflicts': [],
@@ -737,7 +738,14 @@ class TestPkgRelations(unittest.TestCase):
                     [{'name': 'file', 'version': None, 'arch': None}],
                     [{'name': 'bzip2', 'version': None, 'arch': None}],
                     [{'name': 'lsb-release', 'version': None, 'arch': None}]],
-                'build-depends-indep': []}
+                'build-depends-indep': [],
+                'binary': [[{'name': 'binutils', 'version': None, 'arch': None}],
+                    [{'name': 'binutils-dev', 'version': None, 'arch': None}],
+                    [{'name': 'binutils-multiarch', 'version': None, 'arch': None}],
+                    [{'name': 'binutils-hppa64', 'version': None, 'arch': None}],
+                    [{'name': 'binutils-spu', 'version': None, 'arch': None}],
+                    [{'name': 'binutils-doc', 'version': None, 'arch': None}],
+                    [{'name': 'binutils-source', 'version': None, 'arch': None}]]}
         self.assertEqual(rel2, pkg2.relations)
 
 if __name__ == '__main__':
-- 
1.5.6.5




More information about the pkg-python-debian-commits mailing list