]> rtime.felk.cvut.cz Git - novaboot.git/commitdiff
Make <<>> fail if it cannot open a file
authorMichal Sojka <michal.sojka@cvut.cz>
Fri, 22 Oct 2021 12:47:54 +0000 (14:47 +0200)
committerMichal Sojka <michal.sojka@cvut.cz>
Fri, 22 Oct 2021 12:47:54 +0000 (14:47 +0200)
By default, only a warning is printed and the script continues.

Example of this situation:

    % novaboot non-existent --gen-only
    novaboot: Read /home/wsh/.config/novaboot
    novaboot: Effective options: non-existent --gen-only
    Can't open non-existent: No such file or directory at /home/wsh/src/novaboot/novaboot line 362.

We do not add a test for this, because we make all warnings fatal when
running tests.

novaboot

index 0e888816369aab168f88a85a561869dd0ff0c96a..b390d07294c5d62fbef78c2658b08f09d0de2a17 100755 (executable)
--- a/novaboot
+++ b/novaboot
@@ -17,7 +17,9 @@
 
 use strict;
 use warnings;
-use warnings (exists $ENV{NOVABOOT_TEST} ? (FATAL => 'all') : ());
+use warnings (exists $ENV{NOVABOOT_TEST} ?
+              (FATAL => 'all') :
+              (FATAL => qw(inplace))); # Open warnings in <<>> are fatal
 use Getopt::Long qw(GetOptionsFromString GetOptionsFromArray);
 use Pod::Usage;
 use File::Basename;