diff options
| author | Michael Vogt <michael.vogt@ubuntu.com> | 2010-08-05 22:43:30 +0200 |
|---|---|---|
| committer | Michael Vogt <michael.vogt@ubuntu.com> | 2010-08-05 22:43:30 +0200 |
| commit | 9a60588d6a76fa9705d69779ed83aefded657dca (patch) | |
| tree | 73661ee354e5403d61ca07dc96d8bec98d1b25f4 | |
| parent | ad19dcb4f3608779551383103a23ccceb7df3e9c (diff) | |
| parent | 7bc62fa42772b72f5a4f68729e6fc3aabfb909e8 (diff) | |
| download | python-apt-9a60588d6a76fa9705d69779ed83aefded657dca.tar.gz | |
fix another crash and add regression test
| -rw-r--r-- | apt/debfile.py | 1 | ||||
| -rw-r--r-- | po/python-apt.pot | 34 | ||||
| -rw-r--r-- | tests/data/test_debs/impossible-build-depends_2.5-1.dsc | 33 | ||||
| -rw-r--r-- | tests/test_debfile.py | 4 |
4 files changed, 55 insertions, 17 deletions
diff --git a/apt/debfile.py b/apt/debfile.py index e2275f84..33f0f04d 100644 --- a/apt/debfile.py +++ b/apt/debfile.py @@ -52,6 +52,7 @@ class DebPackage(object): self.pkgname = "" self._sections = {} self._need_pkgs = [] + self._failure_string = "" if filename: self.open(filename) diff --git a/po/python-apt.pot b/po/python-apt.pot index 0fc2c959..a317abf0 100644 --- a/po/python-apt.pot +++ b/po/python-apt.pot @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2010-08-05 12:54+0200\n" +"POT-Creation-Date: 2010-08-05 22:40+0200\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" "Language-Team: LANGUAGE <LL@li.org>\n" @@ -413,23 +413,23 @@ msgid "" "Please check your Internet connection." msgstr "" -#: ../apt/debfile.py:81 +#: ../apt/debfile.py:82 #, python-format msgid "List of files for '%s' could not be read" msgstr "" -#: ../apt/debfile.py:166 +#: ../apt/debfile.py:167 #, python-format msgid "Dependency is not satisfiable: %s\n" msgstr "" -#: ../apt/debfile.py:187 +#: ../apt/debfile.py:188 #, python-format msgid "Conflicts with the installed package '%s'" msgstr "" #. TRANSLATORS: the first '%s' is the package that breaks, the second the dependency that makes it break, the third the relation (e.g. >=) and the latest the version for the releation -#: ../apt/debfile.py:326 +#: ../apt/debfile.py:327 #, python-format msgid "" "Breaks existing package '%(pkgname)s' dependency %(depname)s (%(deprelation)" @@ -437,63 +437,63 @@ msgid "" msgstr "" #. TRANSLATORS: the first '%s' is the package that conflicts, the second the packagename that it conflicts with (so the name of the deb the user tries to install), the third is the relation (e.g. >=) and the last is the version for the relation -#: ../apt/debfile.py:342 +#: ../apt/debfile.py:343 #, python-format msgid "" "Breaks existing package '%(pkgname)s' conflict: %(targetpkg)s (%(comptype)s %" "(targetver)s)" msgstr "" -#: ../apt/debfile.py:351 +#: ../apt/debfile.py:352 #, python-format msgid "" "Breaks existing package '%(pkgname)s' that conflict: '%(targetpkg)s'. But " "the '%(debfile)s' provides it via: '%(provides)s'" msgstr "" -#: ../apt/debfile.py:397 +#: ../apt/debfile.py:398 msgid "No Architecture field in the package" msgstr "" -#: ../apt/debfile.py:402 +#: ../apt/debfile.py:403 #, python-format msgid "Wrong architecture '%s'" msgstr "" #. the deb is older than the installed -#: ../apt/debfile.py:409 +#: ../apt/debfile.py:410 msgid "A later version is already installed" msgstr "" -#: ../apt/debfile.py:434 +#: ../apt/debfile.py:435 msgid "Failed to satisfy all dependencies (broken cache)" msgstr "" -#: ../apt/debfile.py:464 +#: ../apt/debfile.py:465 #, python-format msgid "Cannot install '%s'" msgstr "" -#: ../apt/debfile.py:506 ../apt/debfile.py:554 ../apt/debfile.py:565 +#: ../apt/debfile.py:507 ../apt/debfile.py:555 ../apt/debfile.py:566 msgid "Python-debian module not available" msgstr "" -#: ../apt/debfile.py:538 +#: ../apt/debfile.py:539 msgid "" "Automatically decompressed:\n" "\n" msgstr "" -#: ../apt/debfile.py:544 +#: ../apt/debfile.py:545 msgid "Automatically converted to printable ascii:\n" msgstr "" -#: ../apt/debfile.py:641 +#: ../apt/debfile.py:642 #, python-format msgid "Install Build-Dependencies for source package '%s' that builds %s\n" msgstr "" -#: ../apt/debfile.py:651 +#: ../apt/debfile.py:652 msgid "An essential package would be removed" msgstr "" diff --git a/tests/data/test_debs/impossible-build-depends_2.5-1.dsc b/tests/data/test_debs/impossible-build-depends_2.5-1.dsc new file mode 100644 index 00000000..7f7364ae --- /dev/null +++ b/tests/data/test_debs/impossible-build-depends_2.5-1.dsc @@ -0,0 +1,33 @@ +-----BEGIN PGP SIGNED MESSAGE----- +Hash: SHA256 + +Format: 1.0 +Source: hello +Binary: hello +Architecture: any +Version: 2.5-1 +Maintainer: Santiago Vila <sanvila@debian.org> +Homepage: http://www.gnu.org/software/hello +Standards-Version: 3.8.4 +Build-Depends: debhelper (>> 101) +Checksums-Sha1: + dfaf92bfc8144141bcd5ffb4a30777cd57501bfa 582535 hello_2.5.orig.tar.gz + a98ab19072b35295ded3560721662131933f7c05 5965 hello_2.5-1.diff.gz +Checksums-Sha256: + 22934a7d3a62f247ce3b5a77a2c7f7dd095ad8aef305efa2d0d15e0fef31c446 582535 hello_2.5.orig.tar.gz + c2f17c08a6a94bdab4f4316beb4687e8468de03a5162f1d694a0bab4b90e5962 5965 hello_2.5-1.diff.gz +Files: + cf4b73d837692b93676ccd723bf6f797 582535 hello_2.5.orig.tar.gz + fa6c41ce60b975294781ed00d67f32fe 5965 hello_2.5-1.diff.gz + +-----BEGIN PGP SIGNATURE----- +Version: GnuPG v1.4.10 (GNU/Linux) + +iQEcBAEBCAAGBQJLeDJTAAoJEEHOfwufG4syQSAH/0S9vYKRbs71bfGNmKTmRQy6 +TJM1oj3hdjJoE9HBvCBoBhRSB7l5Iz+TDVyvKTcFOnXTWrZfhnNRCoErtOxP8Z0R +MOEeLDTPf3JEvpwaRbfzngp+dRkAXTJSI+equqOvj4jjPd1lrNegWtwTF6VIlXAX +5s+onfBp29/MesxzTGAdviobMYCdazmi2XceC+t5ZEJzEsMMPO6i/v22SrvE/Jkg +LiD/U6gea3/1dovsUY6I7/VyzMhHgdcuUW4dzovr2daLwE+uRp9R90XDtKN5aWUM +oBzk8vBIsw/3EV5kjCKdMtqFGdHBjn4nTKvyoXmJ1SvEzeEd21WvLsBFpcJVKaw= +=YMqG +-----END PGP SIGNATURE----- diff --git a/tests/test_debfile.py b/tests/test_debfile.py index e042a30c..5a6c2df9 100644 --- a/tests/test_debfile.py +++ b/tests/test_debfile.py @@ -58,6 +58,10 @@ class TestDebfilee(unittest.TestCase): self.assertTrue(deb.check()) missing = set(['debhelper', 'libnet1-dev', 'libpcap-dev', 'autotools-dev']) self.assertEqual(set(deb.missing_deps), missing) + filename = "impossible-build-depends_2.5-1.dsc" + deb = apt.debfile.DscSrcPackage(cache=self.cache) + deb.open(os.path.join("data", "test_debs", filename)) + self.assertFalse(deb.check()) def testDebFile(self): deb = apt.debfile.DebPackage(cache=self.cache) |
