Package: dh-python
Version: 2.20160721
Severity: wishlist
Tags: patch

Hi,

It is extremely useful how pybuild emits the command-line arguments
by default when invoking external commands. For example:

  dh_auto_test -O--buildsystem=pybuild
  I: pybuild base:184: cd /tmp/buildd/src-[..]; pytest3.5 [..]


However, please consider emitting the "AFTER_" and "BEFORE_" commands
at the same log level. For example, I would like to see a log line
containing the command line arguments of, for example:

 PYBUILD_AFTER_INSTALL=rm -rf '{destdir}/{install_dir}/cruft'


This would confirm:

 a) That it was actually being run (eg. I didn't typo "PYBIULD"
    or similar!)

 b) It was being run at the right time (eg. I had got the right hook)

 c) The interpolation of '{destdir}' etc. was correct for my needs. This
    is especially important for indempotent commands such as "rm -rf".

Whilst they are currently visible when running in debug mode, it seems
to make a lot more sense that these are emitted at the same log level as
the command itself (ie. ``INFO``)

Patch attached.


Regards,

-- 
      ,''`.
     : :'  :     Chris Lamb
     `. `'`      [email protected] / chris-lamb.co.uk
       `-
diff --git a/pybuild b/pybuild
index 5b7d8a1..7f51122 100755
--- a/pybuild
+++ b/pybuild
@@ -209,6 +209,7 @@ def main(cfg):
             else:
                 log_file = False
             command = before_cmd.format(**args)
+            log.info(command)
             output = execute(command, context['dir'], env, log_file)
             if output['returncode'] != 0:
                 msg = 'exit code={}: {}'.format(output['returncode'], command)
@@ -231,6 +232,7 @@ def main(cfg):
             else:
                 log_file = False
             command = after_cmd.format(**args)
+            log.info(command)
             output = execute(command, context['dir'], env, log_file)
             if output['returncode'] != 0:
                 msg = 'exit code={}: {}'.format(output['returncode'], command)

Reply via email to