#1069979 pbuilder: please make APTGETOPT available to hook scripts

Package:
pbuilder
Source:
pbuilder
Submitter:
Georgios Zarkadas
Date:
2024-05-13 06:42:02 UTC
Severity:
normal
Tags:
#1069979#5
Date:
2024-04-27 22:28:29 UTC
From:
To:
Dear Maintainer,

There are eight hookscripts in the examples/ directory
that use ${APTGETOPT[@]} in their code. APTGETOPT is a
bash array and while it works fine inside pbuilder code
where all library modules are sourced, it is not get
exported to hookscripts, because they are executed as
a separate process and the array is not exported to
their environment.

I have tested this using explicit export APTGETOPT clause
in my pbuilderrc and hookscripts that print the environment
and, unless my configuration is fundamentally broken, it
is not get exported.

I file this as a bug, because including a large number
of scripts using this feature in the examples/ directory
implies the expectation that it actually works.

The attached patch exports the APTGETOPT array as a plain
environment variable in a way that scripts that use the
${APTGETOPT[@]} form in their code will run successfully
without modification. The second patch (...manpages) updates
the relevant hookscripts section of the pbuilder manpage.

Cheers,
Georgios