On Fri, 29 Nov 2024 at 09:25, Johannes Schauer Marin Rodrigues 
<jo...@debian.org> wrote:
> there are no globs, but there are percent escapes which work like they do in
> other parts of sbuild. For example in my ~/.sbuildrc I have:
>
> "%r" => [ '--setup-hook=echo "deb http://deb.debian.org/debian %r main" > 
> "$1"/etc/apt/sources.list.d/%r.list' ]
>
> That way, building for bookworm-backports or experimental will add the mirror
> line for bookworm-backports or experimental to apt.

That's great, given that this works, and it also generalizes the current
default, I've proposed the following MR:
https://salsa.debian.org/debian/sbuild/-/merge_requests/101

For anyone else reading, you need to build sbuild from git, as the version in
unstable will not yet work with it.

> But that being said: I'm not quite happy with this interface yet. I was
> pondering with extending the extra arguments to allow regex replacements
> similar to what is allowed in $unshare_mmdebstrap_distro_mangle and then
> somebody could do:
>
> '(.*)-backports' => [ '.... deb http://deb.debian.org/debian $1 main' ... ]
>
> The problem with that is, that this would mean that $1 in the value would
> have a special meaning which would be surprising if you do not mean to have
> $1 treated as a replacement reference...
>
> Of course there is always the option to hard-code codenames but I do not like
> the idea to carry a long list of codenames in the config. Being able to match
> on prefixes like '-backports' would be much better.
>
> What do you think?

I believe the current state fits all Debian use cases, so I wouldn't bother
with regex support, unless you know of scenarios where the current state
becomes a limitation.

While testing this, I've just noticed the actual issue I wanted to solve was
slightly different, even though the MR is an improvement regardless.

With the MR, we now enable sbuild to automatically create chroots for
$codename-release, but this could be improved further. Would it be possible to
have sbuild use the regular stable chroot and enable the following arguments
whenever %r contains "-backports"?
--build-dep-resolver=aptitude --extra-repository="deb 
http://deb.debian.org/debian bookworm-backports main"

These are required in order to build backports packages, and if there's a way
this behavior can be achieved through defaults, it would both save space due
to  deduplication of chroots and let users build backports packages without
having to pass the extra parameters.

An overall note about the bug reports I've filled recently: I very much like
the recent usability improvements of sbuild, especially with regards to
automatic chroot creation and unshare, this motivated me to chase down the
small paper cuts I have (and see others having) with sbuild. Even if none of my
suggestions goes through, the current state of sbuild is already much better
than it was before, so thank you for that.

Cheers,

--
Samuel Henrique <samueloph>

Reply via email to