[webkit-reviews] review granted: [Bug 135124] [Win] Extend auto-version.pl to support 5-tuple versions : [Attachment 235241] Patch
bugzilla-daemon at webkit.org
bugzilla-daemon at webkit.org
Mon Jul 21 13:13:09 PDT 2014
David Kilzer (:ddkilzer) <ddkilzer at webkit.org> has granted Brent Fulgham
<bfulgham at webkit.org>'s request for review:
Bug 135124: [Win] Extend auto-version.pl to support 5-tuple versions
https://bugs.webkit.org/show_bug.cgi?id=135124
Attachment 235241: Patch
https://bugs.webkit.org/attachment.cgi?id=235241&action=review
------- Additional Comments from David Kilzer (:ddkilzer) <ddkilzer at webkit.org>
View in context: https://bugs.webkit.org/attachment.cgi?id=235241&action=review
r=me, but consider adding well-named subroutines to do the work (and bdash's
feedback on IRC about splitting on '.').
> WebKitLibraries/win/tools/scripts/auto-version.pl:94
> +my ($BUILD_MAJOR_VERSION, $BUILD_MINOR_VERSION, $BUILD_TINY_VERSION);
> +{
> + $PROPOSED_VERSION =~
m/^(?:(\d+)\.)?(?:(\d+)\.)?(?:(\d+)\.)?(?:(\d+)\.)?(\*|\d+)$/ or die "Couldn't
parse $PROPOSED_VERSION";
> + $BUILD_MAJOR_VERSION = $1;
> + $BUILD_MINOR_VERSION = $2;
> + $BUILD_TINY_VERSION = $3;
> + if (!defined $3) {
> + $BUILD_TINY_VERSION = $5;
> + }
> +
> + # The default version (with no decimals) will be matched by the regexp
> + # to $BUILD_TINY_VERSION. If that happens, we need to move it to
> + # $BUILD_MAJOR_VERSION.
> + if (!defined $BUILD_MAJOR_VERSION && !defined $BUILD_MINOR_VERSION) {
> + $BUILD_MAJOR_VERSION = $BUILD_TINY_VERSION;
> + $BUILD_TINY_VERSION = 0;
> + } elsif (!defined $BUILD_MINOR_VERSION && !defined $3) {
> + $BUILD_MINOR_VERSION = $BUILD_TINY_VERSION;
> + $BUILD_TINY_VERSION = 0;
> + }
> }
Why not make this a subroutine?
> WebKitLibraries/win/tools/scripts/auto-version.pl:101
> +{
> + $BUILD_MAJOR_VERSION =~ s/^.*(\d\d\d)$/$1/;
> +}
Ditto.
> WebKitLibraries/win/tools/scripts/auto-version.pl:126
> +my ($MAJOR_VERSION, $MINOR_VERSION);
> +{
> + if ($BUILD_MAJOR_VERSION =~ m/^[^\d]*(\d)(\d{1,})/) {
> + $MAJOR_VERSION = $1;
> + $MINOR_VERSION = $2;
> + } else {
> + $MAJOR_VERSION = $BUILD_MAJOR_VERSION;
> + }
> + print "From $BUILD_MAJOR_VERSION got $MAJOR_VERSION and
$MINOR_VERSION\n";
> +}
Ditto.
More information about the webkit-reviews
mailing list