diff options
author | Sadie Powell <sadie@witchery.services> | 2020-01-18 13:27:09 +0000 |
---|---|---|
committer | Sadie Powell <sadie@witchery.services> | 2020-01-18 13:27:24 +0000 |
commit | 2c33a3027b3db65961e58f4b45e61496ff988897 (patch) | |
tree | 388c26274755fb5955a3bc8c361097c8839ee95c /configure | |
parent | 47fe6c5540352fd5eafc2ae5c4ec6c4b61984591 (diff) |
Improve manually enabling extra modules.
- Allow modules to be specified without their prefix and extensions
in --{disable,enable}-extras.
- Allow modules to be space delimited in --{disable,enable}-extras.
Diffstat (limited to 'configure')
-rwxr-xr-x | configure | 8 |
1 files changed, 6 insertions, 2 deletions
@@ -106,8 +106,8 @@ exit 1 unless GetOptions( ); if (scalar(@opt_enableextras) + scalar(@opt_disableextras) > 0) { - @opt_enableextras = split /,/, join(',', @opt_enableextras); - @opt_disableextras = split /,/, join(',', @opt_disableextras); + @opt_enableextras = split /[, ]+/, join(',', @opt_enableextras); + @opt_disableextras = split /[, ]+/, join(',', @opt_disableextras); enable_extras(@opt_enableextras); disable_extras(@opt_disableextras); list_extras; @@ -534,6 +534,8 @@ EXTRA: for my $extra (@extras) { sub enable_extras (@) { my (@extras) = @_; for my $extra (@extras) { + $extra = "m_$extra" unless $extra =~ /^m_/; + $extra = "$extra.cpp" unless $extra =~ /\.cpp$/; my $extrapath = "src/modules/extra/$extra"; if (!-e $extrapath) { print STDERR "Cannot enable \e[32;1m$extra\e[0m : No such file or directory in src/modules/extra\n"; @@ -569,6 +571,8 @@ sub disable_extras (@) closedir $dd; my (@extras) = @_; EXTRA: for my $extra (@extras) { + $extra = "m_$extra" unless $extra =~ /^m_/; + $extra = "$extra.cpp" unless $extra =~ /\.cpp$/; my $extrapath = "src/modules/extra/$extra"; my $source = "src/modules/$extra"; if (!-e $extrapath) { |