build(release): fix version script (again) [skip ci]
This commit is contained in:
parent
8136d92e48
commit
51267bfd7c
@ -138,6 +138,7 @@ if($par{autokind}) {
|
|||||||
my @rules = split /,/, $par{autokind};
|
my @rules = split /,/, $par{autokind};
|
||||||
RULES: {
|
RULES: {
|
||||||
for my $r(@rules) {
|
for my $r(@rules) {
|
||||||
|
warn "$0: Processing autokind rule '$r'\n" if $par{v};
|
||||||
if($r!~m#(.*)=(.*)#) {
|
if($r!~m#(.*)=(.*)#) {
|
||||||
die "$0: Bad rule in autokind: $r\n";
|
die "$0: Bad rule in autokind: $r\n";
|
||||||
}
|
}
|
||||||
@ -153,14 +154,15 @@ if($par{autokind}) {
|
|||||||
|
|
||||||
|
|
||||||
if($par{'v'}) {
|
if($par{'v'}) {
|
||||||
print "VERBOSE: Parameters\n";
|
warn "VERBOSE: Parameters\n";
|
||||||
for my $k(sort keys %par) {
|
for my $k(sort keys %par) {
|
||||||
print " $k: $par{$k}\n"
|
warn " $k: $par{$k}\n"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
my %typeReact = ();
|
my %typeReact = ();
|
||||||
for my $as(split /,/, $par{change}) {
|
for my $as(split /,/, $par{change}) {
|
||||||
|
warn "$0: processing change parameter '$as'\n" if $par{v};
|
||||||
if($as=~m#(.*)=(.*)#) {
|
if($as=~m#(.*)=(.*)#) {
|
||||||
$typeReact{$1} = $2;
|
$typeReact{$1} = $2;
|
||||||
} else {
|
} else {
|
||||||
@ -229,7 +231,7 @@ sub parseVersion {
|
|||||||
$v=~m#^(?<pre>[a-z]*)(?<ma>[0-9]+)$# ||
|
$v=~m#^(?<pre>[a-z]*)(?<ma>[0-9]+)$# ||
|
||||||
$v=~m#^(?<pre>[a-z]*)(?<ma>[0-9]+)\.(?<mi>[0-9]+)$# ||
|
$v=~m#^(?<pre>[a-z]*)(?<ma>[0-9]+)\.(?<mi>[0-9]+)$# ||
|
||||||
$v=~m#^(?<pre>[a-z]*)(?<ma>[0-9]+)\.(?<mi>[0-9]+)\.(?<p>[0-9]+)$# ||
|
$v=~m#^(?<pre>[a-z]*)(?<ma>[0-9]+)\.(?<mi>[0-9]+)\.(?<p>[0-9]+)$# ||
|
||||||
$v=~m#^(?<pre>[a-z]*)(?<ma>[0-9]+)\.(?<mi>[0-9]+)\.(?<p>[0-9]+)-test-(?<sp>(?<brn>[a-z]+)-(?<brv>[0-9\.]+))$# ||
|
$v=~m#^(?<pre>[a-z]*)(?<ma>[0-9]+)\.(?<mi>[0-9]+)\.(?<p>[0-9]+)-test-(?<sp>(?<brn>[a-z]+)-?(?<brv>[0-9\.]+))$# ||
|
||||||
$v=~m#^(?<pre>[a-z]*)(?<ma>[0-9]+)\.(?<mi>[0-9]+)\.(?<p>[0-9]+)-(?<sp>.*)$#
|
$v=~m#^(?<pre>[a-z]*)(?<ma>[0-9]+)\.(?<mi>[0-9]+)\.(?<p>[0-9]+)-(?<sp>.*)$#
|
||||||
) {
|
) {
|
||||||
%cap = %+
|
%cap = %+
|
||||||
@ -249,7 +251,7 @@ sub parseVersion {
|
|||||||
branchversion=>$cap{brv},
|
branchversion=>$cap{brv},
|
||||||
);
|
);
|
||||||
if($par{v}) {
|
if($par{v}) {
|
||||||
my $parsed = join '; ', map { "$_=>$ret{$_}" } sort keys %ret;
|
my $parsed = join '; ', map { "$_=>".($ret{$_}//'') } sort keys %ret;
|
||||||
warn "Version '$v' was parsed to '$parsed'\n"
|
warn "Version '$v' was parsed to '$parsed'\n"
|
||||||
}
|
}
|
||||||
return \%ret
|
return \%ret
|
||||||
@ -360,6 +362,7 @@ if('-' eq $par{vcslog}) {
|
|||||||
}
|
}
|
||||||
my @versions = ();
|
my @versions = ();
|
||||||
for my $v(@versionsOrig) {
|
for my $v(@versionsOrig) {
|
||||||
|
warn "$0: Processing orig version (part 1): '$v'\n" if $par{v};
|
||||||
if($v=~m#^(.*?\S)\s*::::\s*(.*?)\s*::::\s*(.*)#) {
|
if($v=~m#^(.*?\S)\s*::::\s*(.*?)\s*::::\s*(.*)#) {
|
||||||
push @versions, {
|
push @versions, {
|
||||||
hash => $1,
|
hash => $1,
|
||||||
@ -377,6 +380,7 @@ my $tag = undef;
|
|||||||
my @versionPast = ();
|
my @versionPast = ();
|
||||||
|
|
||||||
VERSION: for my $v(@versions) {
|
VERSION: for my $v(@versions) {
|
||||||
|
warn "$0: Processing version (part 2): $v\n" if $par{v};
|
||||||
#if($v->{meta}=~m#tag\s*:\s*\Q$par{kind}\E(.*)\)#) {
|
#if($v->{meta}=~m#tag\s*:\s*\Q$par{kind}\E(.*)\)#) {
|
||||||
# $tag=$1;
|
# $tag=$1;
|
||||||
# last VERSION
|
# last VERSION
|
||||||
@ -405,6 +409,7 @@ VERSION: for my $v(@versions) {
|
|||||||
#$tag = parseVersion($tag);
|
#$tag = parseVersion($tag);
|
||||||
|
|
||||||
for my $r(reverse @change) {
|
for my $r(reverse @change) {
|
||||||
|
warn "$0: Processing change: $r\n" if $par{v};
|
||||||
if('major' eq $r->{react}) {
|
if('major' eq $r->{react}) {
|
||||||
$tag->{major}++;
|
$tag->{major}++;
|
||||||
$tag->{minor}=0;
|
$tag->{minor}=0;
|
||||||
@ -451,6 +456,7 @@ my $highStart = $mainVersion ? $sortAll[0] : $sortSee[0];
|
|||||||
my $highSee = $sortSee[0];
|
my $highSee = $sortSee[0];
|
||||||
my %reactCollect = ();
|
my %reactCollect = ();
|
||||||
SEARCHVERSION: for my $v(@versions) {
|
SEARCHVERSION: for my $v(@versions) {
|
||||||
|
warn "$0: search for version: '$v'\n" if $par{v};
|
||||||
next unless $v->{version};
|
next unless $v->{version};
|
||||||
next unless $v->{react};
|
next unless $v->{react};
|
||||||
$reactCollect{$v->{react}} = 1;
|
$reactCollect{$v->{react}} = 1;
|
||||||
@ -465,7 +471,9 @@ sub justVersionInc {
|
|||||||
$vv->{patch}++; # if $react->{patch}; # in principal a good idea to increase only when a patch action happend, but we need a new version, even if nothing happend, so we always increase patch; if there are other changes as well, it is overwritten anyways
|
$vv->{patch}++; # if $react->{patch}; # in principal a good idea to increase only when a patch action happend, but we need a new version, even if nothing happend, so we always increase patch; if there are other changes as well, it is overwritten anyways
|
||||||
do {$vv->{minor}++; $vv->{patch}=0} if $react->{minor};
|
do {$vv->{minor}++; $vv->{patch}=0} if $react->{minor};
|
||||||
do {$vv->{major}++; $vv->{minor}=0; $vv->{patch}=0} if $react->{major};
|
do {$vv->{major}++; $vv->{minor}=0; $vv->{patch}=0} if $react->{major};
|
||||||
return vsJustVersion($vv);
|
my $ret = vsJustVersion($vv);
|
||||||
|
warn "$0: version inc from '$v' to $ret\n" if $par{v};
|
||||||
|
return $ret
|
||||||
}
|
}
|
||||||
|
|
||||||
my $newVersion = undef;
|
my $newVersion = undef;
|
||||||
@ -488,7 +496,7 @@ for(@allVersions) {
|
|||||||
$allVersions{$_} = 1
|
$allVersions{$_} = 1
|
||||||
}
|
}
|
||||||
while(exists $allVersions{$newVersion}) {
|
while(exists $allVersions{$newVersion}) {
|
||||||
warn "Version conflict, so we try another version, '$newVersion' exists already\n" if $par{v};
|
warn "$0: Version conflict, so we try another version, '$newVersion' exists already\n" if $par{v};
|
||||||
if($mainVersion) {
|
if($mainVersion) {
|
||||||
die "$0: probably internal error (collision in main version)\n"
|
die "$0: probably internal error (collision in main version)\n"
|
||||||
}
|
}
|
||||||
@ -518,6 +526,7 @@ if($par{changelog}) {
|
|||||||
my %seen = ();
|
my %seen = ();
|
||||||
my @sects = ([]);
|
my @sects = ([]);
|
||||||
for(@changelog) {
|
for(@changelog) {
|
||||||
|
warn "$0: Changelog processing: '$_'\n" if $par{v};
|
||||||
push @sects, [] if m/^## /;
|
push @sects, [] if m/^## /;
|
||||||
push @{$sects[-1]}, $_;
|
push @{$sects[-1]}, $_;
|
||||||
if(m#/commit/([a-f0-9]+)\s*\)\s*\)\s*$#) {
|
if(m#/commit/([a-f0-9]+)\s*\)\s*\)\s*$#) {
|
||||||
@ -531,6 +540,7 @@ if($par{changelog}) {
|
|||||||
shift @sects;
|
shift @sects;
|
||||||
}
|
}
|
||||||
for my $s(@sects) {
|
for my $s(@sects) {
|
||||||
|
warn "$0: Changelog processing, section search: '$s'\n" if $par{v};
|
||||||
my $hh = $s->[0];
|
my $hh = $s->[0];
|
||||||
chomp $hh;
|
chomp $hh;
|
||||||
my $cnt = @$s;
|
my $cnt = @$s;
|
||||||
@ -555,6 +565,7 @@ if($par{changelog}) {
|
|||||||
'feature' => 'Features',
|
'feature' => 'Features',
|
||||||
);
|
);
|
||||||
SELECTCHANGELOG: for my $v(@versions) {
|
SELECTCHANGELOG: for my $v(@versions) {
|
||||||
|
warn "$0: Changelog processing, version selection: '$v'\n" if $par{v};
|
||||||
last SELECTCHANGELOG if $seen{$v->{hash}};
|
last SELECTCHANGELOG if $seen{$v->{hash}};
|
||||||
next unless $v->{subject}=~m#^\s*([a-z]+)\s*(!?)\s*((?:\(.*?\))?)\s*:\s*(.*?)\s*$#i;
|
next unless $v->{subject}=~m#^\s*([a-z]+)\s*(!?)\s*((?:\(.*?\))?)\s*:\s*(.*?)\s*$#i;
|
||||||
my ($kind, $break, $context, $msg) = ($1, $2, $3, $4);
|
my ($kind, $break, $context, $msg) = ($1, $2, $3, $4);
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user