@@ -5,22 +5,26 @@
(seen '()))
(match targets
((target rest ...)
- (let (type (bootloader-target-type target)))
+ (let ((type (bootloader-target-type target)))
(when (memq type seen)
(error loc (G_ "target with duplicate type~%") duplicate))
- (loop rest (cons type seen)))
+ (loop rest (cons type seen))))
(() #t))))
-(define-with-syntax-properties (warn-update-targets (targets
properties))
- (let ((targets (if (list? targets) targets (list targets)))
+(define-with-syntax-properties (warn-update-targets (value
properties))
+ (let ((targets (if (list? value) value (list value)))
(loc (source-properties->location properties)))
(define string->target
(match-lambda
((? bootloader-target? target) target)
((? string? s) (if (string-prefix? "/dev" s)
- (bootloader-target
- (type 'disk)
- (device s))
+ (if (string-rindex s char-set:digit)
+ (bootloader-target
+ (type 'part)
+ (device s))
+ (bootloader-target
+ (type 'disk)
+ (device s)))
(bootloader-target