FS#43255 - [mkinitcpio] syntax errors in preset files generate nothing but a "preset not found" message

Attached to Project: Arch Linux
Opened by Alexei Colin (alexei) - Sunday, 28 December 2014, 22:22 GMT
Last edited by Dave Reisner (falconindy) - Sunday, 28 December 2014, 22:46 GMT
Task Type Bug Report
Category Packages: Extra
Status Closed
Assigned To No-one
Architecture All
Severity Low
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 0
Private No

Details

Description: A preset file with a Bash syntax error will cause a failure when mkinitcpio attempts to source it. Such failures are inaccurately reported as "preset not found: /path/to/preset" with no other output suggesting that the file is in fact found but that there is a syntax error in it.

Example syntax error: PRESETS={"default", "fallback")

This is due to (strange) silencing of stderr in mkinitcpio:
. "$preset" 2>/dev/null || die "Preset not found: \'%s'" "$preset"

Patch is attached to unhide the output with syntax errors from bash and make the error message more accurate.

Additional info:
* package version(s): 18-2 and git b209e8c5e965965c50878fb57a628bca83a06f8d
This task depends upon

Closed by  Dave Reisner (falconindy)
Sunday, 28 December 2014, 22:46 GMT
Reason for closing:  Fixed
Additional comments about closing:  https://projects.archlinux.org/mkinitcpi o.git/commit/?id=715a37b0d6cbee360c00ee2 e23e94a772a50a1f0
Comment by Dave Reisner (falconindy) - Sunday, 28 December 2014, 22:46 GMT
Sounds good. Thanks for the patch.

Loading...