@@ -87,33 +87,46 @@ multi MAIN ('extract', *@components) {
87
87
next ;
88
88
}
89
89
90
+ # Find all tags known in this component
91
+ % * ENV <GIT_DIR > = $ bare ;
92
+ my $ tag-list = open ' git tag' , : p;
93
+ my @ all-tags = $ tag-list . lines ;
94
+ $ tag-list . close ;
95
+ % * ENV . delete (' GIT_DIR' );
96
+
90
97
my @ tags ;
91
98
if $ comp <checkouts > {
92
- @ tags = @ ($ comp <checkouts >);
99
+ # User specified list of tags to extract
100
+ for $ comp <checkouts >. list {
101
+ when any (@ all-tags ) { push @ tags , $ _ }
102
+ default { $ * ERR . say : " No such tag '$ _ '" }
103
+ }
93
104
}
94
105
else {
95
- # Determine which release tags to check out by default
106
+ # Check out filtered tag list by default
96
107
my $ tag_regex = $ comp <info ><release_tags >;
97
108
next unless $ tag_regex ;
98
109
99
- % * ENV <GIT_DIR > = $ bare ;
100
- my $ tag_list = open ' git tag' , : p;
101
- @ tags = grep / <{ $tag_regex } > / , $ tag_list . lines ;
102
- % * ENV . delete (' GIT_DIR' );
110
+ @ tags = grep / <{ $tag_regex } > / , $ tag-list . lines ;
103
111
}
104
112
105
113
# Work around Rakudo bug #115390 by splitting into two loops
106
114
for @ tags -> $ tag {
107
- next if $ tag . IO . d ;
115
+ if $ tag . IO . d {
116
+ say " $ tag already cloned." ;
117
+ next ;
118
+ }
108
119
run < git clone -l >, $ bare , $ tag ;
109
120
}
110
121
for @ tags -> $ tag {
122
+ unless $ tag . IO . d {
123
+ $ * ERR . say : " Unable to extract release '$ tag '." ;
124
+ next ;
125
+ }
111
126
chdir $ tag ; LEAVE chdir ' ..' ;
112
127
run < git checkout -q >, $ tag ; # > -- Dang syntax highlighting
113
128
}
114
129
}
115
-
116
- say ' Extraction complete.' ;
117
130
}
118
131
119
132
# = Build checked out component trees
0 commit comments