unofficial mirror of guix-patches@gnu.org 
 help / color / mirror / code / Atom feed
* [bug#61977] [PATCH] channels: Raise an error if dependency's introduction is malformed
@ 2023-03-05 10:56 Josselin Poiret via Guix-patches via
  2023-03-17 22:14 ` Ludovic Courtès
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Josselin Poiret via Guix-patches via @ 2023-03-05 10:56 UTC (permalink / raw)
  To: 61977; +Cc: Josselin Poiret

* 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)))))))))
 
 (define (read-channel-metadata port)
   "Read from PORT channel metadata in the format expected for the

base-commit: 2799ad44234be675f018115f99be98d2c9fd565d
-- 
2.39.1





^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [bug#61977] [PATCH] channels: Raise an error if dependency's introduction is malformed
  2023-03-05 10:56 [bug#61977] [PATCH] channels: Raise an error if dependency's introduction is malformed Josselin Poiret via Guix-patches via
@ 2023-03-17 22:14 ` Ludovic Courtès
  2023-03-18 21:42   ` Josselin Poiret via Guix-patches via
  2023-05-05 14:15 ` Simon Tournier
  2023-06-04  9:38 ` bug#61977: " Josselin Poiret via Guix-patches via
  2 siblings, 1 reply; 5+ messages in thread
From: Ludovic Courtès @ 2023-03-17 22:14 UTC (permalink / raw)
  To: Josselin Poiret; +Cc: 61977

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’.




^ permalink raw reply	[flat|nested] 5+ messages in thread

* [bug#61977] [PATCH] channels: Raise an error if dependency's introduction is malformed
  2023-03-17 22:14 ` Ludovic Courtès
@ 2023-03-18 21:42   ` Josselin Poiret via Guix-patches via
  0 siblings, 0 replies; 5+ messages in thread
From: Josselin Poiret via Guix-patches via @ 2023-03-18 21:42 UTC (permalink / raw)
  To: Ludovic Courtès; +Cc: 61977

[-- Attachment #1: Type: text/plain, Size: 800 bytes --]

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,
-- 
Josselin Poiret

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 682 bytes --]

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [bug#61977] [PATCH] channels: Raise an error if dependency's introduction is malformed
  2023-03-05 10:56 [bug#61977] [PATCH] channels: Raise an error if dependency's introduction is malformed Josselin Poiret via Guix-patches via
  2023-03-17 22:14 ` Ludovic Courtès
@ 2023-05-05 14:15 ` Simon Tournier
  2023-06-04  9:38 ` bug#61977: " Josselin Poiret via Guix-patches via
  2 siblings, 0 replies; 5+ messages in thread
From: Simon Tournier @ 2023-05-05 14:15 UTC (permalink / raw)
  To: Josselin Poiret; +Cc: Ludovic Courtès, 61977

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




^ permalink raw reply	[flat|nested] 5+ messages in thread

* bug#61977: [PATCH] channels: Raise an error if dependency's introduction is malformed
  2023-03-05 10:56 [bug#61977] [PATCH] channels: Raise an error if dependency's introduction is malformed Josselin Poiret via Guix-patches via
  2023-03-17 22:14 ` Ludovic Courtès
  2023-05-05 14:15 ` Simon Tournier
@ 2023-06-04  9:38 ` Josselin Poiret via Guix-patches via
  2 siblings, 0 replies; 5+ messages in thread
From: Josselin Poiret via Guix-patches via @ 2023-06-04  9:38 UTC (permalink / raw)
  To: 61977-done

[-- Attachment #1: Type: text/plain, Size: 246 bytes --]

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,
-- 
Josselin Poiret

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 682 bytes --]

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2023-06-04  9:40 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-03-05 10:56 [bug#61977] [PATCH] channels: Raise an error if dependency's introduction is malformed Josselin Poiret via Guix-patches via
2023-03-17 22:14 ` Ludovic Courtès
2023-03-18 21:42   ` Josselin Poiret via Guix-patches via
2023-05-05 14:15 ` Simon Tournier
2023-06-04  9:38 ` bug#61977: " Josselin Poiret via Guix-patches via

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).