Control: reopen -1

Hi Mattias,

On Thu, 15 Sep 2022 04:20:34 +0200 Johannes Schauer Marin Rodrigues 
<jo...@debian.org> wrote:
> Quoting Mattias Jernberg (2022-05-06 14:34:22)
> > sbuild-createchroot has an optional mirror argument, however if this is not
> > provided it has its own hardcoded mirror it uses when calling debootstrap.
> > 
> > This is unfortunate as debootstrap (and by extension sbuild) will happily 
> > work
> > with other distributions (such as ubuntu).
> > 
> > Included is a patch which makes sbuild let debootrap pick the mirror 
> > instead.
> 
> thanks for the patch! It's now committed to the main branch and will be part
> of the next sbuild release.

I'm going to revert your commit. The reason is, that further below in the code
of sbuild-createchroot we have this:

if (!($conf->get('SETUP_ONLY') && $conf->get('MAKE_SBUILD_TARBALL'))) {
    my $sources_list = "";

    # Add deb-src to /etc/apt/sources.list.
    if ($conf->get('DEB_SRC')) {
        my $comps = join(' ',split(/,/,$conf->get('COMPONENTS')));
        $sources_list .= "deb-src $mirror $suite $comps\n";
    }

This needs the $mirror variable to be set to something. If it's undefined, then
it will produce an invalid deb-src entry in /etc/apt/sources.list.

Debootstrap doesn't really expose an interface to acquire the default mirror it
chooses for a given distribution name. So solving this problem properly is a
bit harder. One way to do it would be to parse the sources.list created by
debootstrap and then create a deb-src entry based on that. I recently added
code to do that into lib/Sbuild/Build.pm. One solution would be to do something
similar in sbuild-createchroot.

https://salsa.debian.org/debian/sbuild/-/commit/9d498f4a3aeaeceda4e111ba5b25f9c24c2c706b

Thanks!

cheers, josch

Attachment: signature.asc
Description: signature

Reply via email to