Message ID | e442826ed0b778e2f3eb4f2de54fe6c4c114455a.1678013769.git.dev@jpoiret.xyz |
---|---|
State | New |
Headers | show |
Series | [bug#61977] channels: Raise an error if dependency's introduction is malformed | expand |
Hi Josselin,
Josselin Poiret <dev@jpoiret.xyz> skribis:
> * guix/channels.scm (sexp->channel-introduction): Do it.
To be clear, without this a malformed introduction sexp would be
silently ignored; consequently, the channel in question would not be
authenticated, in which case the “channel '~a' lacks 'introduction'
field” warning would be printed. Am I right?
So the goal here is to catch errors in ‘.guix-channel’ earlier, right?
Thanks,
Ludo’.
Hi Ludo, Ludovic Courtès <ludo@gnu.org> writes: > Hi Josselin, > > Josselin Poiret <dev@jpoiret.xyz> skribis: > >> * guix/channels.scm (sexp->channel-introduction): Do it. > > To be clear, without this a malformed introduction sexp would be > silently ignored; consequently, the channel in question would not be > authenticated, in which case the “channel '~a' lacks 'introduction' > field” warning would be printed. Am I right? > > So the goal here is to catch errors in ‘.guix-channel’ earlier, right? Exactly! Someone else reported this elsewhere because they were using the syntax for a channels.scm file instead of the channel dependencies syntax, which is different, and consumers of that channel kept getting warning messages. Best,
Hi, What is the status of this patch? On dim., 05 mars 2023 at 11:56, Josselin Poiret <dev@jpoiret.xyz> wrote: > * guix/channels.scm (sexp->channel-introduction): Do it. > --- > guix/channels.scm | 9 ++++++++- > 1 file changed, 8 insertions(+), 1 deletion(-) > > diff --git a/guix/channels.scm b/guix/channels.scm > index d44e7a0a3a..fc2bf55d65 100644 > --- a/guix/channels.scm > +++ b/guix/channels.scm > @@ -256,7 +256,14 @@ (define sexp->channel-introduction > ('commit commit) ('signer signer) > _ ...) > (make-channel-introduction commit (openpgp-fingerprint signer))) > - (x #f))) > + (x (raise (condition > + (&message > + (message (format #f "channel dependency has an invalid\ > + introduction field"))) > + (&error-location > + (location > + (source-properties->location > + (source-properties x))))))))) I guess the string needs to use ’(G_ )’ for translation, no? Cheers, simon
Hi everyone,
Josselin Poiret <dev@jpoiret.xyz> writes:
> * guix/channels.scm (sexp->channel-introduction): Do it.
Pushed as cacc0cb6ab22218a3783a51ba9986405ede4e0d8, with Simon's
suggestion of adding G_.
Best,
diff --git a/guix/channels.scm b/guix/channels.scm index d44e7a0a3a..fc2bf55d65 100644 --- a/guix/channels.scm +++ b/guix/channels.scm @@ -256,7 +256,14 @@ (define sexp->channel-introduction ('commit commit) ('signer signer) _ ...) (make-channel-introduction commit (openpgp-fingerprint signer))) - (x #f))) + (x (raise (condition + (&message + (message (format #f "channel dependency has an invalid\ + introduction field"))) + (&error-location + (location + (source-properties->location + (source-properties x))))))))) (define (read-channel-metadata port) "Read from PORT channel metadata in the format expected for the