File tree Expand file tree Collapse file tree 1 file changed +12
-4
lines changed
Expand file tree Collapse file tree 1 file changed +12
-4
lines changed Original file line number Diff line number Diff line change @@ -40,6 +40,7 @@ our @EXPORT = qw(
4040 install_gotestsum
4141 install_ncat
4242 mount_tmp_vartmp
43+ numeric_version
4344 patch_junit
4445 patch_sources
4546 run_command
@@ -623,17 +624,24 @@ sub bats_tests {
623624 return ($ret );
624625}
625626
627+ sub numeric_version {
628+ my $version = shift ;
629+
630+ # Sometimes version strings have a leading "v" or a trailing "-ce"
631+ # Strip leading & trailing non-digits from version
632+ $version =~ s / ^\D +// ;
633+ $version =~ s /\D +$// ;
634+ return $version ;
635+ }
636+
626637sub patch_sources {
627638 my ($package , $branch , $tests_dir ) = @_ ;
628639
629640 my $text = script_output(" curl " . data_url(" containers/patches.yaml" ), quiet => 1);
630641 my $yaml = YAML::PP-> new()-> load_string($text );
631642 my $patches = $yaml -> {$package } // {};
632643
633- # Strip leading & trailing non-digits from version
634- my $version = $branch ;
635- $version =~ s / ^\D +// ;
636- $version =~ s /\D +$// ;
644+ my $version = numeric_version($branch );
637645
638646 my @patches = split (/ \s +/ , get_var(" GITHUB_PATCHES" , " " ));
639647 if (!@patches ) {
You can’t perform that action at this time.
0 commit comments