Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.debian.bugs.dist > #1224455

Bug#1090358: sbuild: please pre-set config variables with their defaults

From Chris Hofstaedtler <zeha@debian.org>
Newsgroups linux.debian.bugs.dist
Subject Bug#1090358: sbuild: please pre-set config variables with their defaults
Date 2024-12-17 14:30 +0100
Message-ID <JUFO9-e8g-3@gated-at.bofh.it> (permalink)
Organization linux.* mail to news gateway

Show all headers | View raw


Package: sbuild
Severity: wishlist

I wish sbuild would allow me to extend its config settings in
.sbuildrc or .config/sbuild/config.pl, without having to re-state
the previous defaults.

As an example, I want to extend $unshare_mmdebstrap_extra_args with
some option. But I want to keep the existing defaults too!

This bug report is mostly here to escape the salsa comment mess;
the traces are https://salsa.debian.org/debian/sbuild/-/merge_requests/104#note_559900
and some previous bug report that figured out one can use $conf in
the config file.

In https://salsa.debian.org/debian/sbuild/-/merge_requests/104#note_559973
josch@ provided a draft patch to sbuild:

--- a/lib/Sbuild/ConfBase.pm
+++ b/lib/Sbuild/ConfBase.pm
@@ -502,7 +502,12 @@ sub read ($$$$) {
        next if $conf->_get_group($key) =~ m/^__/;
 
        my $varname = $conf->_get_varname($key);
-       $script .= "my \$$varname = undef;\n";
+        my $vardefault = $conf->_get_default($key);
+        if (defined $vardefault) {
+           $script .= "my " . Data::Dumper->Dump([$vardefault], [$varname]);
+        } else {
+            $script .= "my \$$varname = undef;\n";
+        }
     }
 
     # For compatibility only.  Non-scalars are deprecated.

But also stated:

> I would bet a lot on this breaking something. The problem are
> settings which have a GET function which is allowed to perform
> some magic. The GET function is called if the value behind a
> setting is requested but the user has set it to undef in their
> ~/.sbuildrc. If all values that have defaults are now set, then
> the GET function is not called anymore which I guess can have
> undesired consequences in some cases? Can you try this patch and
> see what happens?

Chris

Back to linux.debian.bugs.dist | Previous | Next — Next in thread | Find similar | Unroll thread


Thread

Bug#1090358: sbuild: please pre-set config variables with their defaults Chris Hofstaedtler <zeha@debian.org> - 2024-12-17 14:30 +0100
  Bug#1090358: sbuild: please pre-set config variables with their defaults Chris Hofstaedtler <zeha@debian.org> - 2024-12-17 15:10 +0100
    Bug#1090358: sbuild: please pre-set config variables with their defaults Chris Hofstaedtler <zeha@debian.org> - 2024-12-17 15:30 +0100
  Bug#1090358: sbuild: please pre-set config variables with their defaults Johannes Schauer Marin Rodrigues <josch@debian.org> - 2024-12-17 15:30 +0100
    Bug#1090358: sbuild: please pre-set config variables with their defaults Chris Hofstaedtler <zeha@debian.org> - 2024-12-17 16:00 +0100
    Bug#1090358: sbuild: please pre-set config variables with their defaults Chris Hofstaedtler <zeha@debian.org> - 2024-12-17 22:20 +0100
      Bug#1090358: sbuild: please pre-set config variables with their defaults Johannes Schauer Marin Rodrigues <josch@debian.org> - 2024-12-18 00:10 +0100
        Bug#1090358: sbuild: please pre-set config variables with their defaults Chris Hofstaedtler <zeha@debian.org> - 2024-12-18 09:00 +0100
          Bug#1090358: sbuild: please pre-set config variables with their defaults Chris Hofstaedtler <zeha@debian.org> - 2024-12-18 09:20 +0100
            Bug#1090358: sbuild: please pre-set config variables with their defaults Johannes Schauer Marin Rodrigues <josch@debian.org> - 2024-12-18 17:10 +0100

csiph-web