file-systems: Improve error reporting for ISO9660

  • Done
  • quality assurance status badge
Details
2 participants
  • Danny Milosavljevic
  • Ludovic Courtès
Owner
unassigned
Submitted by
Danny Milosavljevic
Severity
normal

Debbugs page

Danny Milosavljevic wrote 8 years ago
[PATCH] gnu: build: Improve error reporting.
(address . guix-patches@gnu.org)(name . Danny Milosavljevic)(address . dannym@scratchpost.org)
20170530091258.3245-1-dannym@scratchpost.org
* 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(-)

Toggle diff (16 lines)
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
Ludovic Courtès wrote 8 years ago
(name . Danny Milosavljevic)(address . dannym@scratchpost.org)(address . 27143@debbugs.gnu.org)
878tldcb0o.fsf@gnu.org
Hi Danny,

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

Danny Milosavljevic <dannym@scratchpost.org> skribis:

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

[...]

Toggle quote (8 lines)
> 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’.
Danny Milosavljevic wrote 8 years ago
(name . Ludovic Courtès)(address . ludo@gnu.org)(address . 27143@debbugs.gnu.org)
20170531202448.64e7129b@scratchpost.org
Hi Ludo,

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

Toggle quote (2 lines)
> The prefix for the subject line should just be “file-systems:”.

OK

Toggle quote (7 lines)
> 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?

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

OK!

Toggle quote (2 lines)
> Also make sure to indent the ‘if’ arms properly.

OK!
Ludovic Courtès wrote 8 years ago
(name . Danny Milosavljevic)(address . dannym@scratchpost.org)(address . 27143@debbugs.gnu.org)
87wp8w92t1.fsf@gnu.org
Hi Danny,

Danny Milosavljevic <dannym@scratchpost.org> skribis:

Toggle quote (16 lines)
> 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’.
Ludovic Courtès wrote 8 years ago
control message for bug #27143
(address . control@debbugs.gnu.org)
878tl9kvkq.fsf@gnu.org
retitle 27143 file-systems: Improve error reporting for ISO8660
Ludovic Courtès wrote 8 years ago
(address . control@debbugs.gnu.org)
877f0tkvkd.fsf@gnu.org
retitle 27143 file-systems: Improve error reporting for ISO9660
Ludovic Courtès wrote 8 years ago
Re: bug#27143: [PATCH] gnu: build: Improve error reporting.
(name . Danny Milosavljevic)(address . dannym@scratchpost.org)(address . 27143-done@debbugs.gnu.org)
8737bhkvjk.fsf@gnu.org
This was pushed as 203a9455c4695152fc5d0085bffeead9ce3216c2, so closing it.

Ludo’.
Closed
?
Your comment

This issue is archived.

To comment on this conversation send an email to 27143@debbugs.gnu.org

To respond to this issue using the mumi CLI, first switch to it
mumi current 27143
Then, you may apply the latest patchset in this issue (with sign off)
mumi am -- -s
Or, compose a reply to this issue
mumi compose
Or, send patches to this issue
mumi send-email *.patch
You may also tag this issue. See list of standard tags. For example, to set the confirmed and easy tags
mumi command -t +confirmed -t +easy
Or, remove the moreinfo tag and set the help tag
mumi command -t -moreinfo -t +help