Bug#812228: Multi-Arch support for dh-python

2020-08-02 Thread Kevin Wu
Pinging this bug, any progress? It is blocking crossgrading with GNOME
installed (affects python3-pil and python3-cairo).

On Sat, 25 Aug 2018 22:38:22 +0300 Adrian Bunk  wrote:
> The correct approach is actually to disallow py{,3}compile in
> Multi-Arch: same packages.
>
> It does not even make much sense since it is not possible to install
> multiple architectures of the python interpreter at the same time,
> and in normal cases the package could just be binary-all.
>
> gir1.2-ibus-1.0 is a bit special for that, and the approach taken for
> that is to have no byte-compilation (and no python dependencies).
>
> The latter is not perfect, but seems to be acceptable for a very
> special situation (the python module is an optional part of an
> architecture-specific package). If anything should be improved
> on that, the python module should be split out of the package.
>
> cu
> Adrian
-- 
Best,
Kevin



Bug#812228: Multi-Arch support for dh-python

2018-08-25 Thread Adrian Bunk
On Sun, Sep 18, 2016 at 05:54:17AM -0400, Joe Crayne wrote:
> I've attached a patch that will make dh-python Multi-Arch aware by making
> use of the environment variable DPKG_MAINTSCRIPT_ARCH which is provided in
> the environment by dpkg.
> 
> Specifying the architecture this way will prevent a failure that requires
> the human administrator to fix.  With version 3.5.1-4 of python3-minimal it
> will unfortunately redundantly compile packages when multiple architecture
> variants provide the same python modules.  However, I've submitted a patch
> to python3-minimal that would correct that behavior.
>...
> --- a/autoscripts/postinst-py3compile
> +++ b/autoscripts/postinst-py3compile
> @@ -1,3 +1,3 @@
>  if which py3compile >/dev/null 2>&1; then
> - py3compile -p #PACKAGE# #ARGS#
> + py3compile -p #PACKAGE#:$DPKG_MAINTSCRIPT_ARCH #ARGS#
>  fi
>...

The correct approach is actually to disallow py{,3}compile in
Multi-Arch: same packages.

It does not even make much sense since it is not possible to install 
multiple architectures of the python interpreter at the same time,
and in normal cases the package could just be binary-all.

gir1.2-ibus-1.0 is a bit special for that, and the approach taken for 
that is to have no byte-compilation (and no python dependencies).

The latter is not perfect, but seems to be acceptable for a very
special situation (the python module is an optional part of an 
architecture-specific package). If anything should be improved
on that, the python module should be split out of the package.

cu
Adrian

-- 

   "Is there not promise of rain?" Ling Tan asked suddenly out
of the darkness. There had been need of rain for many days.
   "Only a promise," Lao Er said.
   Pearl S. Buck - Dragon Seed



Bug#812228: Multi-Arch support for dh-python

2016-09-18 Thread Joe Crayne
I've attached a patch that will make dh-python Multi-Arch aware by making
use of the environment variable DPKG_MAINTSCRIPT_ARCH which is provided in
the environment by dpkg.

Specifying the architecture this way will prevent a failure that requires
the human administrator to fix.  With version 3.5.1-4 of python3-minimal it
will unfortunately redundantly compile packages when multiple architecture
variants provide the same python modules.  However, I've submitted a patch
to python3-minimal that would correct that behavior.

See bug #838193 for the changes I propose to python3-minimal.
diff --git a/autoscripts/postinst-py3compile b/autoscripts/postinst-py3compile
index 95b..3d22fc7 100644
--- a/autoscripts/postinst-py3compile
+++ b/autoscripts/postinst-py3compile
@@ -1,3 +1,3 @@
 if which py3compile >/dev/null 2>&1; then
-	py3compile -p #PACKAGE# #ARGS#
+	py3compile -p #PACKAGE#:$DPKG_MAINTSCRIPT_ARCH #ARGS#
 fi
diff --git a/autoscripts/prerm-py3clean b/autoscripts/prerm-py3clean
index c0aadfa..45c8cf2 100644
--- a/autoscripts/prerm-py3clean
+++ b/autoscripts/prerm-py3clean
@@ -1,6 +1,6 @@
 if which py3clean >/dev/null 2>&1; then
-	py3clean -p #PACKAGE# #ARGS#
+	py3clean -p #PACKAGE#:$DPKG_MAINTSCRIPT_ARCH #ARGS#
 else
-	dpkg -L #PACKAGE# | perl -ne 's,/([^/]*)\.py$,/__pycache__/\1.*, or next; unlink $_ or die $! foreach glob($_)'
+	dpkg -L #PACKAGE#:$DPKG_MAINTSCRIPT_ARCH | perl -ne 's,/([^/]*)\.py$,/__pycache__/\1.*, or next; unlink $_ or die $! foreach glob($_)'
 	find /usr/lib/python3/dist-packages/ -type d -name __pycache__ -empty -print0 | xargs --null --no-run-if-empty rmdir
 fi
diff --git a/debian/changelog b/debian/changelog
index 253edae..a1dd124 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,10 +1,14 @@
-dh-python (2.201609XX) UNRELEASED; urgency=medium
+dh-python (2.201609XX+nmu1) UNRELEASED; urgency=medium
 
+  [ Piotr Ożarowski ]
   * pybuild.pm:
 - enable --test-{nose,pytest,tox} if appropriate pypy-* build
   dependency is set
 
- -- Piotr Ożarowski   Wed, 07 Sep 2016 22:39:27 +0200
+  [ Joe Crayne ]
+  * python3 autoscripts: support for Multi-Arch: same.
+
+ -- Joe Crayne   Sun, 18 Sep 2016 03:11:04 -0400
 
 dh-python (2.20160818) unstable; urgency=medium