4

The man page isn't clear on that.

How would I use a signing hook? Especially using the parameter without the config file. What is the meaning of foo in the documentation? For example in --signing-hook-foo? Do I replace foo with my bash script? The would seem very odd and against all conventions that I know.

For example, would this be the way you are supposed to use it?

echo "#!/usr/bin/env bash" > /signing-hook-script.sh
echo "(pwd; ls -la; tree /) > /output.txt" >> /signing-hook-script.sh
chmod +x /signing-hook-script.sh

debuild -i -S --signing-hook-/signing-hook-script.sh
Stephen Kitt
  • 411,918
  • 54
  • 1,065
  • 1,164
Forivin
  • 779
  • 5
  • 18
  • 37

1 Answers1

3

Well spotted, the manpage is incorrect. debuild --help shows the appropriate syntax:

    --dpkg-buildpackage-hook=HOOK
    --clean-hook=HOOK
    --dpkg-source-hook=HOOK
    --build-hook=HOOK
    --binary-hook=HOOK
    --dpkg-genchanges-hook=HOOK
    --final-clean-hook=HOOK
    --lintian-hook=HOOK
    --signing-hook=HOOK
    --post-dpkg-buildpackage-hook=HOOK
                        These hooks run at the various stages of the
                        dpkg-buildpackage run.  For details, see the
                        debuild manpage.  They default to nothing, and
                        can be reset to nothing with --foo-hook=''

So your example would be

debuild --signing-hook=/signing-hook-script.sh -i -S

(debuild options must be specified before dpkg-buildpackage options).

Stephen Kitt
  • 411,918
  • 54
  • 1,065
  • 1,164
  • How would one go about correcting the issue with the manpage? – kemotep Nov 21 '18 at 13:21
  • Clone the repository (`debcheckout devscripts`), edit `scripts/debuild.1`, and submit the resulting patch using `reportbug`. (If any of that isn’t clear, ask and I’ll expand my answer.) – Stephen Kitt Nov 21 '18 at 13:35
  • Hm, I get `dpkg-buildpackage: error: unknown option or argument --signing-hook=/signing-hook-script.sh` when running `debuild -i -S --signing-hook=/signing-hook-script.sh`. – Forivin Nov 21 '18 at 13:39
  • 1
    Ah yes, see my update. – Stephen Kitt Nov 21 '18 at 13:45