Hi, Quoting Samuel Henrique (2024-11-29 01:54:50) > The default for UNSHARE_MMDEBSTRAP_EXTRA_ARGS for backports uses > "stable-backports" while backports documentation (and practice) uses > $codename-backports. > > This leads to issues when building packages from backports as the chroot > that's > created does not come with the backports sources list, the following rule is > missed: > > $unshare_mmdebstrap_extra_args = { > 'stable-backports' => [ '--setup-hook=echo "deb > http://deb.debian.org/debian stable-backports main" > > "$1"/etc/apt/sources.list.d/stable-backports.list' ], > }; > > I would like the default behavior to be smart enough to automatically add the > correct backports sources list for any releases, matching *-backports and > *-backports-sloppy, and adding the repositories correctly. > > This would likely have to be done through some other mechanism as I suppose > the > EXTRA_ARGS approach does not allow the usage of globs and variables (to match > any releases without having to hardcode their names).
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. 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? Thanks! cheers, josch
signature.asc
Description: signature