runtime fix for OpenBSD

From Laurent Cheylus, thanks
This commit is contained in:
Solène Rapenne 2023-06-12 08:13:04 +02:00
parent 1a1a875145
commit 76e8f29b93
2 changed files with 6 additions and 0 deletions

View File

@ -3,6 +3,7 @@ PREFIX=/usr/local
test:
./impermanence.pl -v -t tests/impermanence.yml
-./impermanence.pl -t tests/errored.yml
-./impermanence.pl -t tests/size_undefined.yml
install:
install -o root -g wheel -m 555 impermanence.pl ${PREFIX}/bin/impermanence

View File

@ -12,6 +12,8 @@ use File::Path qw(make_path);
use Sys::Syslog qw(:standard :macros);
use 5.010;
my $isOpenBSD = ($^O eq 'openbsd') ? 1 : 0;
my $verbose = 0;
# display usage and quit
@ -258,6 +260,9 @@ sub main {
# read file and sanitize content
$data = read_yml_file_to_struct($configuration_file);
if ( ! defined $data->{size} || $data->{size} eq 0 ) {
trap_error("size not defined in configuration file");
}
$data = remove_transclusion($data);
# display result and stop if in test mode