From 68a028f13521a2c8718079d4f4965ae92c09fee9 Mon Sep 17 00:00:00 2001 From: Patrick Spek Date: Mon, 11 Nov 2019 11:23:32 +0100 Subject: Rewrite module-install After some debugging, it appeared to be the options to disable certain sources that caused issues with the command from running in the old fashion. Let's see if keeping the rest is going to fix Linenoise. --- tools/build/module-install.pl | 30 ++++++++++++++++++++---------- 1 file changed, 20 insertions(+), 10 deletions(-) (limited to 'tools/build/module-install.pl') diff --git a/tools/build/module-install.pl b/tools/build/module-install.pl index 9f7e038..af6845f 100644 --- a/tools/build/module-install.pl +++ b/tools/build/module-install.pl @@ -2,21 +2,31 @@ use warnings; use strict; + my $perl6bin = shift @ARGV; my $zefbin = shift @ARGV; +my $exit = 0; +my $path_sep = $^O eq 'MSWin32' ? '\\' : '/'; -my $exit = 0; +while (<>) { + # Skip comments + next if /^\s*(#|$)/; -my $path_sep = "/"; -$path_sep = "\\" if ( $^O eq 'MSWin32' ); + # Extract only the module name from the current line + my ($module) = /(\S+)/; -while (<>) { - next if /^\s*(#|$)/; - my ($module) = /(\S+)/; - $exit ||= system $perl6bin, $zefbin, - '--/build-depends', '--/test-depends', '--/depends', - '--/p6c', '--/metacpan', '--/cpan', - '--force', 'install', "./modules$path_sep$module"; + # Create the command list + my @cmd = ( + $perl6bin, $zefbin, + '--/build-depends', '--/test-depends', '--/depends', + '--force', 'install', "./modules$path_sep$module" + ); + + # Show the command that's going to be ran, for debugging purposes + printf "@cmd\n"; + + # Actually run the command + $exit ||= system "@cmd"; } exit $exit; -- cgit v1.1