Hi,

Quoting Julian Gilbey (2022-09-18 18:54:10)
> On Wed, Sep 14, 2022 at 08:13:08AM +0200, Johannes Schauer Marin Rodrigues
> wrote:
> > Hi,
> > 
> > On Fri, 22 Jul 2022 08:25:25 +0100 Julian Gilbey <j...@debian.org> wrote:
> > > The sbuild(1) manpage says:
> > > 
> > >        --autopkgtest-opt=options
> > >               Pass the specified option directly to autopkgtest in 
> > > addition to
> > >               the options already passed by sbuild. [...]
> > > 
> > > and similarly for --autopkgtest-opts.  However, my ~/.sbuildrc
> > > specifies default autopkgtest options, and I sometimes need to
> > > override those.  It would be very helpful if there was a command-line
> > > option to pass the specified options *instead of* the options already
> > > passed by sbuild, for example if I am building a package for a stable
> > > update.
> > > 
> > > The same applies for all of the autopkgtest related options, such as
> > > --autopkgtest-virt-server-opt.
> > 
> > which options are different if you are building for a stable update?
> 
> I have in my .sbuildrc:
> 
> $autopkgtest_opts = ['--apt-upgrade', '--', 'lxc', '-s', 
> 'autopkgtest-testing'];
> 
> For a stable update, I instead need
> 
> $autopkgtest_opts = ['--apt-upgrade', '--', 'lxc', '-s', 
> 'autopkgtest-stable'];

did you try putting the following into your ~/.sbuildrc:

$autopkgtest_opts = ['--apt-upgrade', '--', 'lxc', '-s', 'autopkgtest-%r'];

> But in general, the idea that it is impossible to override settings from a
> configuration file seems an unfortunate design choice.

That is correct. But letting sbuild run autopkgtest is also a bad design
choice. Since the $autopkgtest_opts are a list of options, it would also be bad
to let the command line options just replace what was already set. So then you
need some sort of interface that lets you add or remove arbitrary stuff. This
can become very complicated very fast. We can also not change this now because
sbuild is also heavily used from scripts that now rely on the existing
functionality.

If you just want to switch between stable and testing, consider using the %r
escape in your ~/.sbuildrc.

If you want to do more complex stuff, consider using the SBUILD_CONFIG
environment variable.

Thanks!

cheers, josch

Attachment: signature.asc
Description: signature

Reply via email to