diff options
| author | Michael Vogt <michael.vogt@ubuntu.com> | 2010-08-05 22:41:57 +0200 |
|---|---|---|
| committer | Michael Vogt <michael.vogt@ubuntu.com> | 2010-08-05 22:41:57 +0200 |
| commit | 7bc62fa42772b72f5a4f68729e6fc3aabfb909e8 (patch) | |
| tree | 73661ee354e5403d61ca07dc96d8bec98d1b25f4 | |
| parent | bfa4d690e7262c19b2f0bfc3905177c37f42cf34 (diff) | |
| parent | ad19dcb4f3608779551383103a23ccceb7df3e9c (diff) | |
| download | python-apt-7bc62fa42772b72f5a4f68729e6fc3aabfb909e8.tar.gz | |
merged from debian-sid, fix crash in Dsc file handling
| -rw-r--r-- | apt/debfile.py | 1 | ||||
| -rw-r--r-- | debian/changelog | 26 | ||||
| -rw-r--r-- | doc/source/conf.py | 9 | ||||
| -rw-r--r-- | doc/source/library/apt_pkg.rst | 9 | ||||
| -rw-r--r-- | po/python-apt.pot | 34 | ||||
| -rw-r--r-- | python/apt_pkgmodule.cc | 2 | ||||
| -rw-r--r-- | python/tag.cc | 5 | ||||
| -rw-r--r-- | tests/data/test_debs/hello_2.5-1.dsc | 1 | ||||
| -rw-r--r-- | tests/data/test_debs/impossible-build-depends_2.5-1.dsc | 33 | ||||
| -rw-r--r-- | tests/test_debfile.py | 8 |
10 files changed, 105 insertions, 23 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/debian/changelog b/debian/changelog index 8e5b4565..3906c485 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,13 +1,31 @@ -python-apt (0.7.96.1) UNRELEASED; urgency=low +python-apt (0.7.97) UNRELEASED; urgency=low - * tests/test_debfile.py: - - properly setup fixture data to make debfile test pass - (closes: #588796) + [ Julian Andres Klode ] + * python/tag.cc: + - Support gzip compression for control files (Closes: #383617), + requires APT (>> 0.7.26~exp10) to work. + * doc/conf.py: + - Correctly handle non-digit characters in version (ignore everything + after them). + * python/apt_pkgmodule.cc: + - Bind pkgAcquire::Item::StatTransientNetworkError (Closes: #589010) + * doc/library/apt_pkg.rst: + - Document Configuration.dump(). + + [ Michael Vogt ] * python/configuration.cc: - add binding for the "dump()" method to configruation objects * apt/debfile.py: - fix crash in DscFile handling and add regression test + -- Julian Andres Klode <jak@debian.org> Fri, 23 Jul 2010 16:14:39 +0200 + +python-apt (0.7.96.1) unstable; urgency=low + + * tests/test_debfile.py: + - properly setup fixture data to make debfile test pass + (closes: #588796) + -- Michael Vogt <mvo@debian.org> Mon, 12 Jul 2010 14:14:51 +0200 python-apt (0.7.96) unstable; urgency=low diff --git a/doc/source/conf.py b/doc/source/conf.py index 05490da7..18c8642e 100644 --- a/doc/source/conf.py +++ b/doc/source/conf.py @@ -78,8 +78,13 @@ except KeyError: release = p2.communicate()[0] # Handle the alpha release scheme -release_raw = release.split("~")[0].split(".")[2] -if release_raw.isdigit() and int(release_raw) >= 90: +release_raw = "0" +for c in release.split("~")[0].split(".")[2]: + if not c.isdigit(): + break + release_raw += c + +if int(release_raw) >= 90: version_s = release.split("~")[0].split(".")[:3] # Set the version to 0.X.100 if the release is 0.X.9Y (0.7.90 => 0.7.100) # Use diff --git a/doc/source/library/apt_pkg.rst b/doc/source/library/apt_pkg.rst index dd958959..81dafd54 100644 --- a/doc/source/library/apt_pkg.rst +++ b/doc/source/library/apt_pkg.rst @@ -1381,6 +1381,10 @@ installation. The item is yet to be fetched. + .. attribute:: STAT_TRANSIENT_NETWORK_ERROR + + There was a network error. + .. class:: AcquireFile(owner, uri[, md5, size, descr, short_descr, destdir, destfile]) @@ -1824,6 +1828,11 @@ Configuration and Command-line parsing Remove the option at *key* and all of its children. + .. method:: dump() -> str + + Return a string containing the values in the configuration object, + in the standard :manpage:`apt.conf(5)` format. + .. method:: exists(key) Check whether an option named *key* exists in the configuration. 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/python/apt_pkgmodule.cc b/python/apt_pkgmodule.cc index a1e9ada0..cacbf77a 100644 --- a/python/apt_pkgmodule.cc +++ b/python/apt_pkgmodule.cc @@ -905,6 +905,8 @@ extern "C" void initapt_pkg() Py_BuildValue("i", pkgAcquire::Item::StatFetching)); PyDict_SetItemString(PyAcquireItem_Type.tp_dict, "STAT_DONE", Py_BuildValue("i", pkgAcquire::Item::StatDone)); + PyDict_SetItemString(PyAcquireItem_Type.tp_dict, "STAT_TRANSIENT_NETWORK_ERROR", + Py_BuildValue("i", pkgAcquire::Item::StatTransientNetworkError)); PyDict_SetItemString(PyAcquireItem_Type.tp_dict, "STAT_ERROR", Py_BuildValue("i", pkgAcquire::Item::StatError)); PyDict_SetItemString(PyAcquireItem_Type.tp_dict, "STAT_AUTH_ERROR", diff --git a/python/tag.cc b/python/tag.cc index 9fe12a1a..97039bc4 100644 --- a/python/tag.cc +++ b/python/tag.cc @@ -393,7 +393,12 @@ static PyObject *TagFileNew(PyTypeObject *type,PyObject *Args,PyObject *kwds) return 0; TagFileData *New = (TagFileData*)type->tp_alloc(type, 0); +#ifdef APT_HAS_GZIP + new (&New->Fd) FileFd(); + New->Fd.OpenDescriptor(fileno, FileFd::ReadOnlyGzip, false); +#else new (&New->Fd) FileFd(fileno,false); +#endif New->Owner = File; Py_INCREF(New->Owner); new (&New->Object) pkgTagFile(&New->Fd); diff --git a/tests/data/test_debs/hello_2.5-1.dsc b/tests/data/test_debs/hello_2.5-1.dsc index 48bc2db6..30688272 100644 --- a/tests/data/test_debs/hello_2.5-1.dsc +++ b/tests/data/test_debs/hello_2.5-1.dsc @@ -9,6 +9,7 @@ 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 (>> 4.0.0), libnet1-dev (>= 1.1.2.1), libpcap-dev, autotools-dev Checksums-Sha1: dfaf92bfc8144141bcd5ffb4a30777cd57501bfa 582535 hello_2.5.orig.tar.gz a98ab19072b35295ded3560721662131933f7c05 5965 hello_2.5-1.diff.gz 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 216878fd..5a6c2df9 100644 --- a/tests/test_debfile.py +++ b/tests/test_debfile.py @@ -44,9 +44,11 @@ class TestDebfilee(unittest.TestCase): ] def setUp(self): + apt_pkg.init_config() apt_pkg.config.set("APT::Architecture","i386") apt_pkg.config.set("Dir::State::status", "./data/test_debs/var/lib/dpkg/status") + apt_pkg.init_system() self.cache = apt.Cache() def testDscFile(self): @@ -54,6 +56,12 @@ class TestDebfilee(unittest.TestCase): deb = apt.debfile.DscSrcPackage(cache=self.cache) deb.open(os.path.join("data", "test_debs", filename)) 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) |
