[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#622251: pu: package python-apt/0.7.100.1+squeeze1



Package: release.debian.org
Severity: normal
User: release.debian.org@packages.debian.org
Usertags: pu

We'd like to upload python-apt 0.7.100.1+squeeze1 (or without
+, whatever is preferred) to stable. It contains the changes
the ftpmasters seem to need for multi-arch support and xz
packages in the archive.

-- System Information:
Debian Release: wheezy/sid
  APT prefers unstable
  APT policy: (500, 'unstable'), (250, 'experimental')
Architecture: amd64 (x86_64)

Kernel: Linux 2.6.38-2-amd64 (SMP w/4 CPU cores)
Locale: LANG=de_DE.UTF-8, LC_CTYPE=de_DE.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash

-- 
Julian Andres Klode  - Debian Developer, Ubuntu Member

See http://wiki.debian.org/JulianAndresKlode and http://jak-linux.org/.
=== modified file 'apt/debfile.py'
--- apt/debfile.py	2010-11-10 16:40:45 +0000
+++ apt/debfile.py	2011-04-11 10:36:43 +0000
@@ -40,7 +40,8 @@ class DebPackage(object):
      VERSION_SAME, 
      VERSION_NEWER) = range(4)
 
-    _supported_data_members = ("data.tar.gz", "data.tar.bz2", "data.tar.lzma")
+    _supported_data_members = ("data.tar.gz", "data.tar.bz2", "data.tar.lzma",
+                               "data.tar.xz")
 
     debug = 0
 

=== modified file 'debian/changelog'
--- debian/changelog	2010-12-12 13:30:33 +0000
+++ debian/changelog	2011-04-11 10:36:43 +0000
@@ -1,3 +1,18 @@
+python-apt (0.7.100.1+squeeze1) UNRELEASED; urgency=low
+
+  * python/apt_pkgmodule.cc:
+    - strip multiarch by default in RealParseDepends
+    - add optional parameter to allow parse_depends() to keep the
+      multiarch parameter
+  * tests/test_deps.py:
+    - add test forapt_pkg.parse_depends(strip_multiarch=True)
+  * python/arfile.cc, apt/debfile.py:
+    - add support for .xz archives
+  * tests/test_debfile.py:
+    - add test for xz compression
+
+ -- Michael Vogt <mvo@debian.org>  Mon, 21 Mar 2011 15:46:50 +0100
+
 python-apt (0.7.100.1) unstable; urgency=low
 
   [ Julian Andres Klode ]

=== modified file 'debian/control'
--- debian/control	2010-12-12 13:21:53 +0000
+++ debian/control	2011-04-11 10:36:43 +0000
@@ -16,8 +16,8 @@ Build-Depends: apt-utils,
                python-distutils-extra (>= 2.0),
                python-sphinx (>= 0.5),
                python-debian
-Vcs-Bzr: http://bzr.debian.org/apt/python-apt/debian-sid
-Vcs-Browser: http://bzr.debian.org/loggerhead/apt/python-apt/debian-sid/changes
+Vcs-Bzr: http://bzr.debian.org/apt/python-apt/debian-squeeze
+Vcs-Browser: http://bzr.debian.org/loggerhead/apt/python-apt/debian-squeeze/changes
 
 Package: python-apt
 Architecture: any

=== modified file 'doc/source/library/apt_pkg.rst'
--- doc/source/library/apt_pkg.rst	2010-11-17 15:45:48 +0000
+++ doc/source/library/apt_pkg.rst	2011-04-11 10:36:43 +0000
@@ -1731,7 +1731,7 @@ Dependencies
 The following two functions provide the ability to parse dependencies. They
 use the same format as :attr:`Version.depends_list_str`.
 
-.. function:: parse_depends(depends)
+.. function:: parse_depends(depends, strip_multiarch=True)
 
     Parse the string *depends* which contains dependency information as
     specified in Debian Policy, Section 7.1.
@@ -1743,6 +1743,9 @@ use the same format as :attr:`Version.de
         >>> apt_pkg.parse_depends("PkgA (>= VerA) | PkgB (>= VerB)")
         [[('PkgA', 'VerA', '>='), ('PkgB', 'VerB', '>=')]]
 
+    Note that multiarch dependency information is stripped off by default.
+    You can force the full dependency info (including the multiarch info)
+    by passing "False" as a additional parameter to this function.
 
     .. note::
 

=== modified file 'python/apt_pkgmodule.cc'
--- python/apt_pkgmodule.cc	2010-07-23 14:37:13 +0000
+++ python/apt_pkgmodule.cc	2011-04-11 10:36:43 +0000
@@ -189,12 +189,14 @@ static PyObject *RealParseDepends(PyObje
    string Package;
    string Version;
    unsigned int Op;
+   bool StripMultiArch=true;
 
    const char *Start;
    const char *Stop;
    int Len;
 
-   if (PyArg_ParseTuple(Args,(char *)("s#:" + name).c_str(),&Start,&Len) == 0)
+   if (PyArg_ParseTuple(Args,(char *)("s#|b:" + name).c_str(), 
+                        &Start, &Len, &StripMultiArch) == 0)
       return 0;
    Stop = Start + Len;
    PyObject *List = PyList_New(0);
@@ -205,7 +207,7 @@ static PyObject *RealParseDepends(PyObje
 	 break;
 
       Start = debListParser::ParseDepends(Start,Stop,Package,Version,Op,
-					  ParseArchFlags);
+					  ParseArchFlags, StripMultiArch);
       if (Start == 0)
       {
 	 PyErr_SetString(PyExc_ValueError,"Problem Parsing Dependency");

=== modified file 'python/arfile.cc'
--- python/arfile.cc	2010-04-21 14:59:48 +0000
+++ python/arfile.cc	2011-04-11 10:36:43 +0000
@@ -477,8 +477,8 @@ PyTypeObject PyArArchive_Type = {
  * Representation of a Debian package.
  *
  * This does not resemble debDebFile in apt-inst, but instead is a subclass
- * of ArFile which adds properties for the control.tar.{lzma,bz2,gz} and
- * data.tar.{lzma,bz2,gz} members which return TarFile objects. It also adds
+ * of ArFile which adds properties for the control.tar.{xz,lzma,bz2,gz} and
+ * data.tar.{xz,lzma,bz2,gz} members which return TarFile objects. It also adds
  * a descriptor 'version' which returns the content of 'debian-binary'.
  *
  * We are using it this way as it seems more natural to represent this special
@@ -541,8 +541,12 @@ static PyObject *debfile_new(PyTypeObjec
         self->data = _gettar(self, self->Object->FindMember("data.tar.lzma"),
                              "lzma");
     if (!self->data)
+        self->data = _gettar(self, self->Object->FindMember("data.tar.xz"),
+                             "xz");
+    if (!self->data)
         return PyErr_Format(PyExc_SystemError, "No debian archive, missing %s",
-                            "data.tar.gz or data.tar.bz2 or data.tar.lzma");
+                            "data.tar.gz or data.tar.bz2 or data.tar.lzma "
+			    "or data.tar.xz");
 
 
     const ARArchive::Member *member = self->Object->FindMember("debian-binary");
@@ -586,7 +590,7 @@ static PyGetSetDef debfile_getset[] = {
     {"control",(getter)debfile_get_control,0,
      "The TarFile object associated with the control.tar.gz member."},
     {"data",(getter)debfile_get_data,0,
-     "The TarFile object associated with the data.tar.{gz,bz2,lzma} member."},
+     "The TarFile object associated with the data.tar.{gz,bz2,lzma,xz}) member."},
     {"debian_binary",(getter)debfile_get_debian_binary,0,
      "The package version, as contained in debian-binary."},
     {NULL}
@@ -600,7 +604,7 @@ static const char *debfile_doc =
     "specifying a file descriptor (returned by e.g. os.open()).\n"
     "The recommended way of using it is to pass in the path to the file.\n\n"
     "It differs from ArArchive by providing the members 'control', 'data'\n"
-    "and 'version' for accessing the control.tar.gz, data.tar.{gz,bz2,lzma},\n"
+    "and 'version' for accessing the control.tar.gz, data.tar.{gz,bz2,lzma,xz},\n"
     "and debian-binary members in the archive.";
 
 PyTypeObject PyDebFile_Type = {

=== added file 'tests/data/test_debs/data-tar-xz.deb'
Binary files tests/data/test_debs/data-tar-xz.deb	1970-01-01 00:00:00 +0000 and tests/data/test_debs/data-tar-xz.deb	2011-04-11 10:36:43 +0000 differ

=== modified file 'tests/test_debfile.py'
--- tests/test_debfile.py	2010-09-08 08:54:12 +0000
+++ tests/test_debfile.py	2011-04-11 10:36:43 +0000
@@ -102,6 +102,11 @@ class TestDebfilee(unittest.TestCase):
         self.assertTrue(content.startswith("Automatically converted to printable ascii:\n\x7fELF "))
                   
 
+    def test_xz_data(self):
+	deb = apt.debfile.DebPackage("./data/test_debs/data-tar-xz.deb")
+        self.assertEqual(deb.filelist, ["./", "usr/", "usr/bin/"])
+
+
 if __name__ == "__main__":
     #logging.basicConfig(level=logging.DEBUG)
     unittest.main()

=== modified file 'tests/test_deps.py'
--- tests/test_deps.py	2010-03-10 14:01:18 +0000
+++ tests/test_deps.py	2011-04-11 10:36:43 +0000
@@ -61,6 +61,14 @@ class TestDependencies(unittest.TestCase
         self.assertFalse(apt_pkg.check_dep("1", ">>", "1"))
         self.assertTrue(apt_pkg.check_dep("2", ">>", "1"))
 
+    def test_parse_depends_multiarch(self):
+        # strip multiarch
+        deps = apt_pkg.parse_depends("po4a:native", True)
+        self.assertEqual(deps[0][0][0], "po4a")
+        # do not strip multiarch
+        deps = apt_pkg.parse_depends("po4a:native", False)
+        self.assertEqual(deps[0][0][0], "po4a:native")
+
     def test_parse_depends(self):
         """dependencies: Test apt_pkg.parse_depends()"""
         deps = apt_pkg.parse_depends("p1a (<< 1a) | p1b (>> 1b)")

Attachment: pgpnN8xzLgoN9.pgp
Description: PGP signature


Reply to: