Hi,

On Fri, 29 Nov 2024 10:17:31 +0100 Johannes Schauer Marin Rodrigues <jo...@debian.org> wrote:
This feature is marked as experimental for a reason. We can definitely change
this. I wonder what the best interface would be?

Is what you want a "append to defaults" option?

The problem with an "append to default" option is, that now you need
another option to change the default. And you also still need to periodically
check what the current default is because your appending to the default
will change depending on what the default actually is.
Just adding my two cents, I exploit the fact that .sbuildrc is essentially a Perl script, and do the following to have a bunch of common default options for mmdebstrap:

my @common_mmdebstrap_args = (
        '--variant=apt',
        '--include=build-essential,ccache',
        '--chrooted-customize-hook=update-ccache-symlinks',
        '--customize-hook=rm "$1/etc/resolv.conf"',
        '--customize-hook=rm "$1/etc/hostname"',
        '--aptopt=Acquire::http::Proxy "http://localhost:3456";',
        '--dpkgopt=path-exclude=/usr/share/man/*',
        '--dpkgopt=path-include=/usr/share/man/man[1-9]/*',
        '--dpkgopt=path-exclude=/usr/share/locale/*',
        '--dpkgopt=path-include=/usr/share/locale/locale.alias',
        '--dpkgopt=path-exclude=/usr/share/doc/*',
        '--dpkgopt=path-include=/usr/share/doc/*/copyright',
        '--dpkgopt=path-include=/usr/share/doc/*/changelog.Debian.*',
);
$unshare_mmdebstrap_extra_args = {
        '*' => [ @common_mmdebstrap_args ],
        "$1/etc/apt/sources.list.d/experimental.list"'],
        'focal' => [ @common_mmdebstrap_args, 
'--include=adduser,ca-certificates', '--components=main,universe' ],
        'jammy' => [ @common_mmdebstrap_args, 
'--include=adduser,ca-certificates', '--components=main,universe' ],
        'noble' => [ @common_mmdebstrap_args, 
'--include=adduser,ca-certificates', '--components=main,universe' ],
};


If the default options were somehow exposed as predefined variable to the config script, this could be used in a similar way to append options (and it would be explicit, which is always nice for readability).

I'm not enough of a Perl expert to gauge how easily this could be implemented, though.


Cheers
Timo

--
⢀⣴⠾⠻⢶⣦⠀   ╭────────────────────────────────────────────────────╮
⣾⠁⢠⠒⠀⣿⡁   │ Timo Röhling                                       │
⢿⡄⠘⠷⠚⠋⠀   │ 9B03 EBB9 8300 DF97 C2B1  23BF CC8C 6BDD 1403 F4CA │
⠈⠳⣄⠀⠀⠀⠀   ╰────────────────────────────────────────────────────╯

Attachment: signature.asc
Description: PGP signature

Reply via email to