From d765ca6d2ec26baa5839a51381a44185b53a7604 Mon Sep 17 00:00:00 2001 From: Alex Date: Tue, 8 Sep 2020 22:39:54 +0200 Subject: [PATCH] fix travis condition check $travis may be undef after GetOptions("travis" => \$travis); Will cause errors like this during build: Unknown option: installdirs Welcome to Alien::SDL2 module installation ------------------------------------------ checking operating system... MSWin32 checking for gcc... yes checking build system type... MSWin32-x64-multi-thread checking platform specific module... using 'My::Builder::Windows' checking for config script... no checking for prebuilt binaries... yes, 1 option(s) Use of uninitialized value $travis in numeric eq (==) at Build.PL line 195. --- Build.PL | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Build.PL b/Build.PL index 2ab2078..7f6ea77 100644 --- a/Build.PL +++ b/Build.PL @@ -8,7 +8,7 @@ use My::Utility qw(check_config_script check_prebuilt_binaries check_prereqs_lib use Getopt::Long; my ($ans, $travis) = ''; -GetOptions ( "travis" => \$travis) ; +GetOptions("travis" => \$travis); print "Welcome to Alien::SDL2 module installation\n"; print "------------------------------------------\n"; @@ -192,7 +192,7 @@ else { } # select option '1' for travis - if ($travis == 1) { + if (defined $travis && $travis == 1) { $ans = 1; #set 'travis' var for inc/My/Builder.pm $build->notes( 'travis', '1' );