[Build-common-hackers] Bug#735412: stop assuming /usr/share/pyshared in tests

Martin Pitt martin.pitt at ubuntu.com
Wed Jan 15 08:43:28 UTC 2014


Package: cdbs
Version: 0.4.122
Tags: patch
User: ubuntu-devel at lists.ubuntu.com
Usertags: origin-ubuntu ubuntu-patch trusty

Hello,

distutils-{9,10} tests currently do this:

| dpkg -c $WORKDIR/../python-cdbs-testsuite_0.1_*.deb \
|        | grep -q '/usr/share/pyshared/testing/foo.py' \

These two tests started failing in current Ubuntu trusty recently [1],
as Matthias Klose changed dh_python2 to stop moving files to
/usr/share/pyshared/ and symlinking from /usr/lib/python2.7/ in [2].
Apparently this was done because with latest upstream python this
symlink farm does not work any more, and leads to bugs like [3].

This does not yet affect Debian, but Matthias said he wants to push
that dh_python2 change into Debian soon as well, so this is an early
explanation and patch what happens.

But thinking about it, I think this is a correct change either way.
What the test should do is ensure that Python will be able to find the
module, i. e. check /usr/lib/python*/dist-packages. Checking for
/usr/share/pyshared/ only tests an internal implementation detail of
dh_python2, but won't actually ensure that you'll get a working
package. This is probably still from the time when python2 packages
only shipped files in /usr/share/pyshared/ and the symlinks were
created in postinst.

So I suggest applying this now (I verified it works in current sid) to
avoid being surprised by future changes to dh_python2.

Thanks for considering,

Martin
 
[1] https://launchpadlibrarian.net/162435780/buildlog_ubuntu-trusty-i386.cdbs_0.4.122ubuntu1_FAILEDTOBUILD.txt.gz
[2] https://launchpad.net/ubuntu/+source/dh-python/1.20131021-1ubuntu5
[3] http://bugs.python.org/issue19352

-- 
Martin Pitt                        | http://www.piware.de
Ubuntu Developer (www.ubuntu.com)  | Debian Developer  (www.debian.org)
-------------- next part --------------
diff -Nru cdbs-0.4.122ubuntu1/debian/changelog cdbs-0.4.122ubuntu2/debian/changelog
--- cdbs-0.4.122ubuntu1/debian/changelog	2013-10-21 08:17:45.000000000 +0200
+++ cdbs-0.4.122ubuntu2/debian/changelog	2014-01-15 09:27:41.000000000 +0100
@@ -1,3 +1,12 @@
+cdbs (0.4.122ubuntu2) trusty; urgency=medium
+
+  * Adjust distutils-{9,10}.sh to not expect files in /usr/shared/pyshared/
+    any more. That should be considered an internal implementation detail of
+    dh_python2, and recently changed in trusty. Instead, check for the path
+    that python actually looks into: /usr/lib/python*/dist-packages.
+
+ -- Martin Pitt <martin.pitt at ubuntu.com>  Wed, 15 Jan 2014 09:26:46 +0100
+
 cdbs (0.4.122ubuntu1) trusty; urgency=low
 
   * Merge from Debian unstable. Remaining Ubuntu changes:
diff -Nru cdbs-0.4.122ubuntu1/test/distutils-10.sh cdbs-0.4.122ubuntu2/test/distutils-10.sh
--- cdbs-0.4.122ubuntu1/test/distutils-10.sh	2010-12-27 00:13:01.000000000 +0100
+++ cdbs-0.4.122ubuntu2/test/distutils-10.sh	2014-01-15 09:25:20.000000000 +0100
@@ -55,7 +55,7 @@
 build_package
 
 dpkg -c $WORKDIR/../python-cdbs-testsuite_0.1_*.deb \
-	| grep -q '/usr/share/pyshared/testing/foo.py' \
+	| grep -q '/usr/lib/python.*/dist-packages/testing/foo.py' \
 	|| return_fail
 
 dpkg -c $WORKDIR/../python3-cdbs-testsuite_0.1_*.deb \
diff -Nru cdbs-0.4.122ubuntu1/test/distutils-9.sh cdbs-0.4.122ubuntu2/test/distutils-9.sh
--- cdbs-0.4.122ubuntu1/test/distutils-9.sh	2010-12-26 18:11:57.000000000 +0100
+++ cdbs-0.4.122ubuntu2/test/distutils-9.sh	2014-01-15 09:23:52.000000000 +0100
@@ -50,7 +50,7 @@
 build_package
 
 dpkg -c $WORKDIR/../python-cdbs-testsuite_0.1_*.deb \
-	| grep -q '/usr/share/pyshared/testing/foo.py' \
+	| grep -q '/usr/lib/python.*/dist-packages/testing/foo.py' \
 	|| return_fail
 
 clean_workdir


More information about the Build-common-hackers mailing list