Alexandre Julliard : make_announce: Update version number parsing for the new versioning scheme.
Module: wine Branch: master Commit: 9629bb6ad2136593ac6c5026a57614640be41453 URL: http://source.winehq.org/git/wine.git/?a=commit;h=9629bb6ad2136593ac6c5026a5... Author: Alexandre Julliard <julliard(a)winehq.org> Date: Tue Jan 31 14:56:07 2017 +0100 make_announce: Update version number parsing for the new versioning scheme. Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- tools/make_announce | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/tools/make_announce b/tools/make_announce index c65f900..83d869a 100755 --- a/tools/make_announce +++ b/tools/make_announce @@ -109,7 +109,7 @@ my $old = get_current_version(); my $new = $ARGV[0]; unless ($new) { - if ($old =~ /^([0-9]+)\.([0-9]+)$/) { $new = "$1.$2.1"; } + if ($old =~ /^([0-9]+)\.([0-9]+)$/) { $new = "$1." . ($2 + 1); } elsif ($old =~ /^([0-9]+)\.([0-9]+)\.([0-9]+)$/) { $new = "$1.$2." . ($3 + 1); } elsif ($old =~ /^([0-9]+)\.([0-9]+)-rc([0-9]+)$/) { $new = "$1.$2-rc" . ($3 + 1); } else { die "unknown version format $old"; } @@ -117,8 +117,12 @@ unless ($new) print "Updating files for release $new\n"; -(my $reldir = $new) =~ s/^([0-9]+\.[0-9]+).*/$1/; -my $is_stable = ($new =~ /^([0-9]+)\.([0-9]+)\.([0-9]+)$/) && !($2 % 2); # stable releases have an even minor number +my $reldir = $new; +if ($reldir =~ /^([0-9]+\.0)/) { $reldir = $1; } +elsif ($reldir =~ /^([0-9]+)\./) { $reldir = "$1.x"; } +else { die "unknown version format $reldir"; } + +my $is_stable = ($new =~ /^([0-9]+)\.0\.([0-9]+)$/); # stable releases have a 0 minor number my $filter = "product=Wine&resolution=FIXED&" . ($is_stable ? "target_milestone=$reldir.x" : "bug_status=RESOLVED"); my %bugs = get_bugs( $filter ); @@ -128,11 +132,16 @@ my %authors = get_authors(); open ANNOUNCE, "<ANNOUNCE" or die "cannot open ANNOUNCE"; open NEW, ">ANNOUNCE.new" or die "cannot create ANNOUNCE.new"; + +# replace version number in first line +$_ = <ANNOUNCE>; +s/(([0-9]+)\.)+[0-9]+(-rc[0-9]+)?/$new/; +print NEW $_; + while (<ANNOUNCE>) { last if /^------------------/; - s!http://mirrors.ibiblio.org/wine/source/.*!http://mirrors.ibiblio.org/wine/so...; - s!http://dl.winehq.org/wine/source/.*!http://dl.winehq.org/wine/source/$reldir...; + s!(https?://.*/wine/source/).*\.tar!$1$reldir/wine-$new.tar!; print NEW $_; }
participants (1)
-
Alexandre Julliard