On 28 Feb 2023, at 19:36, Henning <[email protected]> wrote:
>
> Package: pbuilder
> Version: 0.231
> Severity: normal
> X-Debbugs-Cc: [email protected]
>
> Dear Maintainer,
>
> *** Reporter, please consider answering these questions, where appropriate ***
>
> * What led up to the situation?
>
> Building a docker image with pbuilder installed with debconf
> frontend non-interactive
>
> * What exactly did you do (or not do) that was effective (or
> ineffective)?
>
> When pbuilder is to be installed via apt in the Dockerfile, it's
> configuration process apprently tries to puzl some configuration
> out of /etc/apt/sources.list - but this file does not exist on
> bookworm docker images (and presumeably on other systems,
> neither).
>
> At least in the bookworm docker image, the apt sources are
> configured via /etc/apt/sources.list.d/debian.sources file, and
> I assume its the same for systems installed "normally" with the
> debian installer.
>
> But pbuilder apparently relies on the "traditional"
> /etc/apt/sources.list file, and otrherwise keeps looping through
> an interactive question for the user to input a default mirror
> manually.
>
> * What was the outcome of this action?
> The interactive question, at least in a docker build run, can not
> be answered as the text just keeps looping.
> The process must be exited with ctrl-c.
>
> * What outcome did you expect instead?
> I expect that pbuilder does not resort to interactive user input
> when DEBIAN_FRONTEND=noninteractive and some default is used,
> and the pbuilder instal script do not rely on a file that cannot
> be guranteed to exist.
This confuses me, because the config script does the following:
while [ -z "$MIRRORSITE" ] ; do
db_input high pbuilder/nomirror || true
db_input high pbuilder/mirrorsite && RETCODE=$? || RETCODE=$?
db_go
# if the interface is non-interactive, still set a valid mirror
if [ $RETCODE = 30 ] ; then
MIRRORSITE="http://deb.debian.org/debian"
else
db_get pbuilder/mirrorsite
MIRRORSITE="$RET"
fi
done
So it’s supposed to be detecting the non-interactive case (and 30 is
the documented value for that), providing a default. Yes, we should do
better in the deb822 cases (note that the script *does* check
sources.list.d, but only for *.list, which are in the same format as
sources.list itself), and maybe there’s a way we can extract that
information out of apt itself (e.g. something like apt-cache policy
dpkg, but not quite), but the above code should still be making that
matter less. I’ll have to go test this myself, see if I can reproduce
it, and figure out why it’s not working.
Jessica