Bug 135119 - [Win] Correct auto-version.pl script for two-digit version numbers
Summary: [Win] Correct auto-version.pl script for two-digit version numbers
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Tools / Tests (show other bugs)
Version: 528+ (Nightly build)
Hardware: PC All
: P1 Blocker
Assignee: Brent Fulgham
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2014-07-21 10:07 PDT by Brent Fulgham
Modified: 2014-07-21 10:44 PDT (History)
2 users (show)

See Also:


Attachments
Patch (1.76 KB, patch)
2014-07-21 10:11 PDT, Brent Fulgham
no flags Details | Formatted Diff | Diff
Patch (1.73 KB, patch)
2014-07-21 10:15 PDT, Brent Fulgham
no flags Details | Formatted Diff | Diff
Patch (1.47 KB, patch)
2014-07-21 10:16 PDT, Brent Fulgham
no flags Details | Formatted Diff | Diff
Patch (2.01 KB, patch)
2014-07-21 10:32 PDT, Brent Fulgham
ddkilzer: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Brent Fulgham 2014-07-21 10:07:16 PDT
When I translated the "auto-version.sh" script into Perl, I misunderstood the pattern matching used for the __VERSION_MAJOR__ and __VERSION_MINOR__ components and assumed that version numbers must always be three (or more) digits.

In fact, this script was meant to support two-digit versions as well.

This patch corrects the regular expression to handle this case.
Comment 1 Brent Fulgham 2014-07-21 10:11:52 PDT
Created attachment 235224 [details]
Patch
Comment 2 Brent Fulgham 2014-07-21 10:12:08 PDT
<rdar://problem/17743959>
Comment 3 Brent Fulgham 2014-07-21 10:14:08 PDT
Original Shell code:
MAJOR_VERSION=${BUILD_MAJOR_VERSION:0:1}
MINOR_VERSION=${BUILD_MAJOR_VERSION:1}

Proposed Perl version:
$BUILD_MAJOR_VERSION =~ m/^[^\d]*(\d)(\d{1,})/;
my $MAJOR_VERSION = $1;
my $MINOR_VERSION = $2;
Comment 4 Brent Fulgham 2014-07-21 10:15:29 PDT
Created attachment 235225 [details]
Patch
Comment 5 Brent Fulgham 2014-07-21 10:16:27 PDT
Created attachment 235226 [details]
Patch
Comment 6 Brent Fulgham 2014-07-21 10:32:34 PDT
Script behavior:
'auto-version.sh':
RC_PROJECTSOURCEVERSION=15300 -> 300 -> 3, 00
RC_PROJECTSOURCEVERSION=5300 -> 300 -> 3, 00
RC_PROJECTSOURCEVERSION=530 -> 530 -> 5, 30
RC_PROJECTSOURCEVERSION=53 -> 53 -> 5, 3
RC_PROJECTSOURCEVERSION=5 -> 5 -> 5, ERROR

'auto-version.pl':
RC_PROJECTSOURCEVERSION=15300 -> 300 -> 3, 00
RC_PROJECTSOURCEVERSION=5300 -> 300 -> 3, 00
RC_PROJECTSOURCEVERSION=530 -> 530 -> 5, 30
RC_PROJECTSOURCEVERSION=53 -> 53 -> 5, 3
RC_PROJECTSOURCEVERSION=5 -> 5 -> ERROR
Comment 7 Brent Fulgham 2014-07-21 10:32:57 PDT
Created attachment 235227 [details]
Patch
Comment 8 David Kilzer (:ddkilzer) 2014-07-21 10:43:24 PDT
Comment on attachment 235227 [details]
Patch

r=me
Comment 9 Brent Fulgham 2014-07-21 10:44:47 PDT
Committed r171305: <http://trac.webkit.org/changeset/171305>