all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* bug#27143: [PATCH] gnu: build: Improve error reporting.
@ 2017-05-30  9:12 Danny Milosavljevic
  2017-05-31 15:16 ` Ludovic Courtès
  0 siblings, 1 reply; 5+ messages in thread
From: Danny Milosavljevic @ 2017-05-30  9:12 UTC (permalink / raw)
  To: 27143

* gnu/build/file-systems.scm (read-iso9660-primary-volume-descriptor):
Improve error reporting.
---
 gnu/build/file-systems.scm | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/gnu/build/file-systems.scm b/gnu/build/file-systems.scm
index 17c1182ce..bd6997adc 100644
--- a/gnu/build/file-systems.scm
+++ b/gnu/build/file-systems.scm
@@ -245,7 +245,10 @@ Trailing spaces are trimmed."
   "Find and read the first primary volume descriptor, starting at OFFSET.
    Return #f if not found."
   (let* ((sblock    (read-superblock device offset 2048 iso9660-superblock?))
-         (type-code (if sblock (array-ref sblock 0) 255)))
+         (type-code (if sblock
+                      (array-ref sblock 0)
+                      (error (format #f "Could not read ISO9660 primary
+volume descriptor from ~s" device)))))
     (match type-code
       (255 #f) ; Volume Descriptor Set Terminator.
       (1 sblock) ; Primary Volume Descriptor

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

* bug#27143: [PATCH] gnu: build: Improve error reporting.
  2017-05-30  9:12 bug#27143: [PATCH] gnu: build: Improve error reporting Danny Milosavljevic
@ 2017-05-31 15:16 ` Ludovic Courtès
  2017-05-31 18:24   ` Danny Milosavljevic
  0 siblings, 1 reply; 5+ messages in thread
From: Ludovic Courtès @ 2017-05-31 15:16 UTC (permalink / raw)
  To: Danny Milosavljevic; +Cc: 27143

Hi Danny,

The prefix for the subject line should just be “file-systems:”.

Danny Milosavljevic <dannym@scratchpost.org> skribis:

> * gnu/build/file-systems.scm (read-iso9660-primary-volume-descriptor):
> Improve error reporting.

[...]

>     Return #f if not found."
>    (let* ((sblock    (read-superblock device offset 2048 iso9660-superblock?))
> -         (type-code (if sblock (array-ref sblock 0) 255)))
> +         (type-code (if sblock
> +                      (array-ref sblock 0)
> +                      (error (format #f "Could not read ISO9660 primary
> +volume descriptor from ~s" device)))))

‘format’ misses an argument.

I hadn’t noticed earlier, but we should use:

  (bytevector-u8-ref sblock 0)

instead of ‘array-ref’ (the array API is not appropriate in this
context; in fact it’s rarely appropriate :-)).

Also make sure to indent the ‘if’ arms properly.

OK with these changes, thanks!

Ludo’.

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

* bug#27143: [PATCH] gnu: build: Improve error reporting.
  2017-05-31 15:16 ` Ludovic Courtès
@ 2017-05-31 18:24   ` Danny Milosavljevic
  2017-05-31 20:41     ` Ludovic Courtès
  0 siblings, 1 reply; 5+ messages in thread
From: Danny Milosavljevic @ 2017-05-31 18:24 UTC (permalink / raw)
  To: Ludovic Courtès; +Cc: 27143

Hi Ludo,

On Wed, 31 May 2017 17:16:07 +0200
ludo@gnu.org (Ludovic Courtès) wrote:

> The prefix for the subject line should just be “file-systems:”.

OK

> Danny Milosavljevic <dannym@scratchpost.org> skribis:
> 
> > +                      (error (format #f "Could not read ISO9660 primary
> > +volume descriptor from ~s" device)))))  
> 
> ‘format’ misses an argument.

Uh?  Which one does it miss?

> I hadn’t noticed earlier, but we should use:
> 
>   (bytevector-u8-ref sblock 0)

OK!

> Also make sure to indent the ‘if’ arms properly.

OK!

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

* bug#27143: [PATCH] gnu: build: Improve error reporting.
  2017-05-31 18:24   ` Danny Milosavljevic
@ 2017-05-31 20:41     ` Ludovic Courtès
  2017-06-03 14:14       ` Ludovic Courtès
  0 siblings, 1 reply; 5+ messages in thread
From: Ludovic Courtès @ 2017-05-31 20:41 UTC (permalink / raw)
  To: Danny Milosavljevic; +Cc: 27143

Hi Danny,

Danny Milosavljevic <dannym@scratchpost.org> skribis:

> On Wed, 31 May 2017 17:16:07 +0200
> ludo@gnu.org (Ludovic Courtès) wrote:
>
>> The prefix for the subject line should just be “file-systems:”.
>
> OK
>
>> Danny Milosavljevic <dannym@scratchpost.org> skribis:
>> 
>> > +                      (error (format #f "Could not read ISO9660 primary
>> > +volume descriptor from ~s" device)))))  
>> 
>> ‘format’ misses an argument.
>
> Uh?  Which one does it miss?

Oh sorry, I guess I didn’t have my glasses on.

Ludo’.

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

* bug#27143: [PATCH] gnu: build: Improve error reporting.
  2017-05-31 20:41     ` Ludovic Courtès
@ 2017-06-03 14:14       ` Ludovic Courtès
  0 siblings, 0 replies; 5+ messages in thread
From: Ludovic Courtès @ 2017-06-03 14:14 UTC (permalink / raw)
  To: Danny Milosavljevic; +Cc: 27143-done

This was pushed as 203a9455c4695152fc5d0085bffeead9ce3216c2, so closing it.

Ludo’.

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

end of thread, other threads:[~2017-06-03 14:15 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-05-30  9:12 bug#27143: [PATCH] gnu: build: Improve error reporting Danny Milosavljevic
2017-05-31 15:16 ` Ludovic Courtès
2017-05-31 18:24   ` Danny Milosavljevic
2017-05-31 20:41     ` Ludovic Courtès
2017-06-03 14:14       ` Ludovic Courtès

Code repositories for project(s) associated with this external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.