aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPatrick Spek <p.spek@tyil.nl>2019-11-11 11:23:32 +0100
committerPatrick Spek <p.spek@tyil.nl>2019-11-11 11:23:32 +0100
commit68a028f13521a2c8718079d4f4965ae92c09fee9 (patch)
tree386172953039a5b91b76ac6ed1237df9d677ff91
parent7f7713382f18886e7ca60181891b5cad95e73236 (diff)
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.
-rw-r--r--tools/build/module-install.pl30
1 files changed, 20 insertions, 10 deletions
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;