]> git.decadent.org.uk Git - dak.git/commitdiff
PackageList: use correct values for section and component
authorAnsgar Burchardt <ansgar@debian.org>
Thu, 31 Jul 2014 22:51:57 +0000 (00:51 +0200)
committerAnsgar Burchardt <ansgar@debian.org>
Thu, 31 Jul 2014 22:51:57 +0000 (00:51 +0200)
daklib/packagelist.py
tests/test_packagelist.py

index 1af05b766c9d97d48161a149e8f50e446e7a8093..04a0ef518777b754405b26b6bfb4c01ef1e366d4 100644 (file)
@@ -90,7 +90,7 @@ class PackageList(object):
             # <name> <type> <component/section> <priority> [arch=<arch>[,<arch>]...]
             name = fields[0]
             package_type = fields[1]
-            component, section = extract_component_from_section(fields[2])
+            section, component = extract_component_from_section(fields[2])
             priority = fields[3]
             other = dict(kv.split('=', 1) for kv in fields[4:])
 
index 9259e7399f45585febda75d523b4bb3a9843665b..fa5cc86ad3c34f522dd852eab9f7f9f0a46aa0d8 100644 (file)
@@ -81,6 +81,14 @@ class TestPackageList(DakTestCase):
         p_all_amd64 = pl.packages_for_suite(suite_all_amd64)
         self.assertEqual(len(p_all_amd64), 1)
 
+        p = p_all[0]
+        self.assertEqual(p.name, 'libdune-common-doc')
+        self.assertEqual(p.type, 'deb')
+        self.assertEqual(p.section, 'doc')
+        self.assertEqual(p.component, 'main')
+        self.assertEqual(p.priority, 'optional')
+        self.assertEqual(p.architectures, ['all'])
+
     def testArchAny(self):
         pl = PackageList(source_any)