Package: dh-python
Version: 4.20191017
Severity: wishlist

Hi,

it would be nice if dh-python could automatically handle
DEB_BUILD_OPTIONS=terse.

Debhelper does already have some machinery for this:

  /usr/share/perl5/Debian/Debhelper$ grep -r QUIET
  Dh_Lib.pm:      # make sure verbose is on. Otherwise, check DH_QUIET.
  Dh_Lib.pm:      } elsif (defined $ENV{DH_QUIET} && $ENV{DH_QUIET} ne "" || 
get_buildoption("terse")) {
  Dh_Lib.pm:              $dh{QUIET}=1;
  Dh_Lib.pm:      if (!$dh{QUIET}) {
  Buildsystem/ninja.pm:   if (!$dh{QUIET}) {
  Buildsystem/cmake.pm:   unless ($dh{QUIET}) {
  Buildsystem/autoconf.pm:        if ($dh{QUIET}) {

Iow, it sets `$dh{QUIET}` when the build should be quiet, and some build
systems already check this, so it would make sense for dh-python to do the same.

pybuild already has a working `--quiet` option, so I included a patch below
that passes `--quiet` to `pybuild` when appropriate (this checks for
`--verbose`, since from looking at the code, I expect mixing `--verbose` with
`--quiet` will give funny results). The patch is made against an installed
version 4.20191017, so I hope it still applies to a master version as-is.

Gr.

Matthijs

And here's the patch:

--- a/Debian/Debhelper/Buildsystem/pybuild.pm
+++ b/Debian/Debhelper/Buildsystem/pybuild.pm
@@ -10,7 +10,7 @@ package Debian::Debhelper::Buildsystem::
 use strict;
 use Dpkg::Control;
 use Dpkg::Changelog::Debian;
-use Debian::Debhelper::Dh_Lib qw(error doit);
+use Debian::Debhelper::Dh_Lib qw(%dh error doit);
 use base 'Debian::Debhelper::Buildsystem';
 
 sub DESCRIPTION {
@@ -105,6 +105,10 @@ sub pybuild_commands {
                push @options, '--dir', $dir;
        }
 
+       if (not grep {$_ eq '--verbose'} @options and $dh{QUIET}) {
+               push @options, '--quiet';
+       }
+
        my @deps;
        if ($ENV{'PYBUILD_INTERPRETERS'}) {
                push @result, ['pybuild', "--$step", @options];

Reply via email to