Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BUG: Parse Release numbers > 9 properly #1391

Merged
merged 3 commits into from
Jul 12, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 14 additions & 2 deletions Utilities/tagRelease.pl
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@

my $tag = $ARGV[0];

if (!($tag =~ m/^v[0-9]\.[0-9]\.[0-9]/) ) {
if (!($tag =~ m/^v[0-9]+\.[0-9]+\.[0-9]+/) ) {
print "Tags for release should be in the format vX.Y.Z where X,Y,Z are integers\n";
exit(1);
}
Expand Down Expand Up @@ -53,12 +53,24 @@
exit(1);
}

# Also don't allow a duplicate tag. git will stop this later, but less messy to check here
my @allTags = `git tag`;

chomp(@allTags);

foreach my $repoTag (@allTags) {
if ($repoTag == ${tag}) {
print "The tag $tag already exists. Exiting \n";
exit(1);
}
}

# Check tag matches Version.cmake
open(my $inFH, "<", "Version.cmake");
my $versionDotCmake = do { local $/; <$inFH> };
close($inFH);

my ($tagVersionMajor,$tagVersionMinor,$tagVersionPatch) = ($tag =~ m/^v([0-9])\.([0-9])\.([0-9])/);
my ($tagVersionMajor,$tagVersionMinor,$tagVersionPatch) = ($tag =~ m/^v([0-9]+)\.([0-9]+)\.([0-9]+)/);

$versionDotCmake =~ s/set\(\$\{PROJECT_NAME\}_VERSION_MAJOR "[0-9]+"\)/set\(\$\{PROJECT_NAME\}_VERSION_MAJOR "${tagVersionMajor}"\)/
or die("Cannot find version information in Version.cmake");
Expand Down