[Pkg-shotwell-maint] Bug#803044: gexiv2: Fix autopkgtest regression

Martin Pitt martin.pitt at ubuntu.com
Mon Oct 26 10:32:43 UTC 2015


Package: gexiv2
Version: 0.10.3-1
Tags: patch
User: ubuntu-devel at lists.ubuntu.com
Usertags: origin-ubuntu ubuntu-patch xenial

Hello,

gexiv2's autopkgtest recently started failing [1]

| adt-run [03:36:38]: test gir.smoketest: -----------------------]
| adt-run [03:36:38]: test gir.smoketest:  - - - - - - - - - - results - - - - - - - - - -
| gir.smoketest        FAIL stderr: test.py:1: PyGIWarning: GExiv2 was imported without specifying a version first. Use gi.require_version('GExiv2', '0.10') before import to ensure that the right version gets loaded.
| adt-run [03:36:39]: test gir.smoketest:  - - - - - - - - - - stderr - - - - - - - - - -
| test.py:1: PyGIWarning: GExiv2 was imported without specifying a version first. Use gi.require_version('GExiv2', '0.10') before import to ensure that the right version gets loaded.

This is apparently due to the recent python-gi which now emits these
warnings. Obvious patch attached.

While I was at it, I also took the liberty to rewrite the test to use
#!/usr/bin/python instead of the shell wrapper. The "cd $ADTTMP"
should be a no-op as there is no "gi" module in the gexiv2/ tree. If
you don't like this, feel free to ignore this part of course and only
add the gi.require_version.

Thanks for considering,

Martin

[1] http://ci.debian.net/packages/g/gexiv2/unstable/amd64/

-- 
Martin Pitt                        | http://www.piware.de
Ubuntu Developer (www.ubuntu.com)  | Debian Developer  (www.debian.org)
-------------- next part --------------
diff -Nru gexiv2-0.10.3/debian/changelog gexiv2-0.10.3/debian/changelog
--- gexiv2-0.10.3/debian/changelog	2015-08-06 08:03:31.000000000 +0200
+++ gexiv2-0.10.3/debian/changelog	2015-10-26 11:28:04.000000000 +0100
@@ -1,3 +1,11 @@
+gexiv2 (0.10.3-1ubuntu1) xenial; urgency=medium
+
+  * debian/tests/gir.smoketest: Explicitly require GIR module version to avoid
+    a warning on stderr. Also rewrite to use python directly, instead of an
+    unnecessary shell wrapper.
+
+ -- Martin Pitt <martin.pitt at ubuntu.com>  Mon, 26 Oct 2015 11:27:27 +0100
+
 gexiv2 (0.10.3-1build2) wily; urgency=medium
 
   * No-change rebuild against libexiv2-14
diff -Nru gexiv2-0.10.3/debian/tests/gir.smoketest gexiv2-0.10.3/debian/tests/gir.smoketest
--- gexiv2-0.10.3/debian/tests/gir.smoketest	2014-09-26 14:05:23.000000000 +0200
+++ gexiv2-0.10.3/debian/tests/gir.smoketest	2015-10-26 11:27:24.000000000 +0100
@@ -1,11 +1,7 @@
-#!/bin/sh
-set -e
-
-cd "$ADTTMP"
-cat > test.py << EOF
+#!/usr/bin/python
+import gi
+gi.require_version('GExiv2', '0.10')
 from gi.repository import GExiv2
 
-print GExiv2.initialize()
-print type(GExiv2.Metadata())
-EOF
-python test.py
+print(GExiv2.initialize())
+print(type(GExiv2.Metadata()))
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: Digital signature
URL: <http://lists.alioth.debian.org/pipermail/pkg-shotwell-maint/attachments/20151026/716f9864/attachment.sig>


More information about the Pkg-shotwell-maint mailing list