summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorOswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>2016-04-20 14:19:40 +0200
committerLiang Qi <liang.qi@qt.io>2016-05-05 20:02:38 +0000
commitc41d854254dbee488c454ec512ac0dfba1c38903 (patch)
tree6b83eae3fc509c2c1ca7bf86e24cf06bb5a88c17
parent9b9801b7d49a1c9c01f45fa697812f91b392e091 (diff)
make it actually possible to exclude classes
the doc - quite reasonably - claims that it is possible. Change-Id: I4668b3feafe721f1db4deb65848206d8197962c8 Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
-rwxr-xr-xinit-repository30
1 files changed, 19 insertions, 11 deletions
diff --git a/init-repository b/init-repository
index fd291252..a5773e66 100755
--- a/init-repository
+++ b/init-repository
@@ -333,26 +333,34 @@ sub git_clone_all_submodules
my %include = ();
foreach my $mod (@subset) {
+ my $del = ($mod =~ s/^-//);
+ my $fail = 0;
+ my @what;
if ($mod eq "all") {
- map { $include{$_} = 1; } keys %subbases;
+ @what = keys %subbases;
} elsif ($mod eq "essential") {
- map { $include{$_} = 1; } grep { ($subinits{$_} || 0) eq STS_ESSENTIAL } keys %subbases;
+ @what = grep { ($subinits{$_} || 0) eq STS_ESSENTIAL } keys %subbases;
} elsif ($mod eq "addon") {
- map { $include{$_} = 1; } grep { ($subinits{$_} || 0) eq STS_ADDON } keys %subbases;
+ @what = grep { ($subinits{$_} || 0) eq STS_ADDON } keys %subbases;
} elsif ($mod eq "preview") {
- map { $include{$_} = 1; } grep { ($subinits{$_} || 0) eq STS_PREVIEW } keys %subbases;
+ @what = grep { ($subinits{$_} || 0) eq STS_PREVIEW } keys %subbases;
} elsif ($mod eq "deprecated") {
- map { $include{$_} = 1; } grep { ($subinits{$_} || 0) eq STS_DEPRECATED } keys %subbases;
+ @what = grep { ($subinits{$_} || 0) eq STS_DEPRECATED } keys %subbases;
} elsif ($mod eq "obsolete") {
- map { $include{$_} = 1; } grep { ($subinits{$_} || 0) eq STS_OBSOLETE } keys %subbases;
- } elsif ($mod =~ s/^-//) {
+ @what = grep { ($subinits{$_} || 0) eq STS_OBSOLETE } keys %subbases;
+ } elsif (defined($subdirs{$mod})) {
+ push @what, $mod;
+ } else {
+ $fail = 1;
+ }
+ if ($del) {
print "Warning: excluding non-existent module '$mod'.\n"
- if (!defined($subdirs{$mod}));
- delete $include{$mod};
+ if ($fail);
+ map { delete $include{$_} } @what;
} else {
die("Error: module subset names non-existent '$mod'.\n")
- if (!defined($subdirs{$mod}));
- $include{$mod} = 1;
+ if ($fail);
+ map { $include{$_} = 1; } @what;
}
}