aboutsummaryrefslogtreecommitdiff
path: root/tools/build/module-install.pl
blob: af6845f4ad39031f6b50f6539a4ab7757a679573 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
#! perl

use warnings;
use strict;

my $perl6bin = shift @ARGV;
my $zefbin   = shift @ARGV;
my $exit     = 0;
my $path_sep = $^O eq 'MSWin32' ? '\\' : '/';

while (<>) {
	# Skip comments
	next if /^\s*(#|$)/;

	# Extract only the module name from the current line
	my ($module) = /(\S+)/;

	# 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;