1
Description: Adds an exclude option to Makefile.PL for turning off components from the commandline.
2
Author: Chris Butler <chrisb@debian.org>
3
Last-Update: 2010-05-22
12
GetOptions('strict-deps' => \$opt_strictdeps, # be strict about dependencies
13
yes => \$opt_yes, # answer yes to all questions
14
default => \$opt_default, # answer default to all questions
15
'components=s' => \$opt_components,
16
+ 'exclude=s' => \$opt_exclude,
25
+ foreach (@opt_components) {
26
+ $by_name{$_->{name}} = $_;
27
+ $_->{exclude} = 0; # default if not mentioned
30
+ if (defined $opt_exclude) {
31
+ foreach (split /,/, $opt_exclude) {
32
+ my $i = $by_name{$_};
33
+ die "unknown component $_\n" if not $i;
39
foreach my $info (@opt_components) {
40
my $w = length("$info->{blurb} ($info->{name})");
42
# Guess a default value for {install} based on whether
43
# prerequisites were found.
45
- $info->{install} = $opt_yes || not $info->{missing};
46
+ $info->{install} = not $info->{exclude} && ($opt_yes || not $info->{missing});
48
print STDERR ($s, ' ' x (1 + $width - length $s),
49
$info->{install} ? '[yes]' : '[no]',