Hi Niels, On Sat, Jul 20, 2019 at 07:37:00AM +0000, Niels Thykier wrote: > Can you show me some concrete of the examples, where this would be > useful. I am most interested in the "blob" disguised as "somecommand" > in your examples above (I can fully appreciate the value of getting rid > of the if.../endif-bits). > > My first take would be something like: > > dh_runcmdforpkg -- some-cmd --with-arg1 --with-arg2 > > But if you use a lot of shell pipelines, then you would need to do sh -c > '<shellpayload>' a lot. Then it might be better to have: > > dh_runcmdforpkg --exec-mode=command -- some-cmd --with-arg > dh_runcmdforpkg --exec-mode=command -- 'raw-shell payload | process'
These are very good thoughs. I grepped throug my bugs and this is what I found: > Will you need support for: > > * chdir Yes, once. > * flagging certain exit codes as acceptable/non-errors > * special-exit code if dh_runcmdforpkg does nothing (default would be > 0) > * negated package selection > * redirects of stdout/stderr > * something else I have not thought off * Varying flags of a command: (many times) + Most commonly dh_auto_configure. - --with$(if $(filter somepkg,$(shell dh_listpackages)),,out)-foo - --$(if $(filter somepkg,$(shell dh_listpackages)),en,dis)able-foo . A very common one is --enable-gtk-doc if the (arch:all) -doc package is built. * Conditional dh_install/dh_strip -pfoo. (multiple times) * A shell for loop over the relevant pyversions (dependent on whether particular python-* and python3-* packages get built). (multiple times) * dh_auto_* for a spearate --sourcedirectory if a particular package is built. * A very simple conditional chmod/cp. > > (Not all of these are equally trivial with the debhelper library design) So I think my gut feeling was wrong and this dh_runcmdforpkg isn't actually useful. The vast majority actually is varying dh_auto_configure flags followed by (useless?) conditionals around debhelpers. Should we close the bug? Helmut