Title: [171330] tags/Safari-600.1.1.1
- Revision
- 171330
- Author
- [email protected]
- Date
- 2014-07-21 18:05:33 -0700 (Mon, 21 Jul 2014)
Log Message
Merged r171319. <rdar://problem/17750334>
Modified Paths
Added Paths
- tags/Safari-600.1.1.1/Tools/Scripts/webkitperl/auto-version_unittest/
Diff
Modified: tags/Safari-600.1.1.1/Tools/ChangeLog (171329 => 171330)
--- tags/Safari-600.1.1.1/Tools/ChangeLog 2014-07-22 00:58:40 UTC (rev 171329)
+++ tags/Safari-600.1.1.1/Tools/ChangeLog 2014-07-22 01:05:33 UTC (rev 171330)
@@ -1,3 +1,20 @@
+2014-07-21 Babak Shafiei <[email protected]>
+
+ Merge r171319.
+
+ 2014-07-21 Brent Fulgham <[email protected]>
+
+ [Win] Extend auto-version.pl to support 5-tuple versions
+ https://bugs.webkit.org/show_bug.cgi?id=135124
+ <rdar://problem/17750334>
+
+ Reviewed by David Kilzer.
+
+ Add test cases for auto-version.pl.
+
+ * Scripts/webkitperl/auto-version_unittest: Added.
+ * Scripts/webkitperl/auto-version_unittest/autoVersionTests.pl: Added.
+
2014-07-17 Lucas Forschler <[email protected]>
Roll out r171167. <rdar://problem/17716602>
Modified: tags/Safari-600.1.1.1/WebKitLibraries/ChangeLog (171329 => 171330)
--- tags/Safari-600.1.1.1/WebKitLibraries/ChangeLog 2014-07-22 00:58:40 UTC (rev 171329)
+++ tags/Safari-600.1.1.1/WebKitLibraries/ChangeLog 2014-07-22 01:05:33 UTC (rev 171330)
@@ -1,5 +1,30 @@
2014-07-21 Babak Shafiei <[email protected]>
+ Merge r171319.
+
+ 2014-07-21 Brent Fulgham <[email protected]>
+
+ [Win] Extend auto-version.pl to handle 5-tuple versions
+ https://bugs.webkit.org/show_bug.cgi?id=135124
+ <rdar://problem/17750334>
+
+ Reviewed by David Kilzer.
+
+ Extend tuple parsing to handle up to five tuples, and as
+ few as a single tuple. On Windows, the two additional
+ tuples are unused.
+
+ Also corrected regular _expression_ capture logic to use local
+ blocks, preventing later capture expressions from reusing
+ previous capture results when the current _expression_ failed
+ to find a match (GRRR, Perl!).
+
+ Clean up code by putting logic into a couple of subroutines.
+
+ * win/tools/scripts/auto-version.pl:
+
+2014-07-21 Babak Shafiei <[email protected]>
+
Merge r171305.
2014-07-21 Brent Fulgham <[email protected]>
Modified: tags/Safari-600.1.1.1/WebKitLibraries/win/tools/scripts/auto-version.pl (171329 => 171330)
--- tags/Safari-600.1.1.1/WebKitLibraries/win/tools/scripts/auto-version.pl 2014-07-22 00:58:40 UTC (rev 171329)
+++ tags/Safari-600.1.1.1/WebKitLibraries/win/tools/scripts/auto-version.pl 2014-07-22 01:05:33 UTC (rev 171330)
@@ -28,6 +28,9 @@
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+sub splitVersion($);
+sub splitBuildMajorVersion($);
+
die "You must supply an output path as the argument.\n" if ($#ARGV < 0);
my $WEBKIT_LIBRARIES = $ENV{'WEBKIT_LIBRARIES'};
@@ -68,47 +71,13 @@
my $PROPOSED_VERSION = (defined $ENVIRONMENT_VERSION) ? $ENVIRONMENT_VERSION : $FALLBACK_VERSION;
chomp($PROPOSED_VERSION);
-# Split out the three components of the dotted version number. We pad
-# the input with trailing dots to handle the case where the input version
-# has fewer components than we expect.
-$PROPOSED_VERSION =~ m/^(?:(\d+)\.)?(?:(\d+)\.)?(\*|\d+)$/ or die "Couldn't parse $PROPOSED_VERSION";
-my $BUILD_MAJOR_VERSION = $1;
-my $BUILD_MINOR_VERSION = $2;
-my $BUILD_TINY_VERSION = $3;
+my ($BUILD_MAJOR_VERSION, $BUILD_MINOR_VERSION, $BUILD_TINY_VERSION) = splitVersion($PROPOSED_VERSION);
-# 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;
-}
-
-# Cut the major component down to three characters by dropping any
-# extra leading digits, then adjust the major version portion of the
-# version string to match.
-$BUILD_MAJOR_VERSION =~ s/^.*(\d\d\d)$/$1/;
-
-# Have the minor and tiny components default to zero if not present.
-if (!defined $BUILD_MINOR_VERSION) {
- $BUILD_MINOR_VERSION = 0;
-}
-if (!defined $BUILD_TINY_VERSION) {
- $BUILD_TINY_VERSION = 0;
-}
-
$PROPOSED_VERSION = "$BUILD_MAJOR_VERSION.$BUILD_MINOR_VERSION.$BUILD_TINY_VERSION";
-# Split the first component further by using the first digit for the
-# major version and the remaining two characters as the minor version.
-# The minor version is shifted down to the tiny version, with the tiny
-# version becoming the variant version.
-$BUILD_MAJOR_VERSION =~ m/^[^\d]*(\d)(\d{1,})/;
-my $MAJOR_VERSION = $1;
-my $MINOR_VERSION = $2;
+my ($MAJOR_VERSION, $MINOR_VERSION) = splitBuildMajorVersion($BUILD_MAJOR_VERSION);
my $TINY_VERSION = $BUILD_MINOR_VERSION;
my $VARIANT_VERSION = $BUILD_TINY_VERSION;
-
my $VERSION_TEXT = $PROPOSED_VERSION;
my $VERSION_TEXT_SHORT = $VERSION_TEXT;
@@ -149,3 +118,54 @@
print OUTPUT_FILE "#define __COPYRIGHT_YEAR_END_TEXT__ \"$COPYRIGHT_END_YEAR\"\n";
}
close(OUTPUT_FILE);
+
+
+sub splitVersion($)
+{
+ my $PROPOSED_VERSION = shift;
+
+ # Split out the three components of the dotted version number. We pad
+ # the input with trailing dots to handle the case where the input version
+ # has fewer components than we expect.
+ my @components = split(/\./, $PROPOSED_VERSION) or die "Couldn't parse $PROPOSED_VERSION";
+ my $componentCount = scalar(@components);
+
+ my $BUILD_MAJOR_VERSION = $components[0];
+
+ # Have the minor and tiny components default to zero if not present.
+ my $BUILD_MINOR_VERSION = 0;
+ my $BUILD_TINY_VERSION = 0;
+ if ($componentCount > 1) {
+ $BUILD_MINOR_VERSION = $components[1];
+ if ($componentCount > 2) {
+ $BUILD_TINY_VERSION = $components[2];
+ }
+ }
+
+ # Cut the major component down to three characters by dropping any
+ # extra leading digits, then adjust the major version portion of the
+ # version string to match.
+ $BUILD_MAJOR_VERSION =~ s/^.*(\d\d\d)$/$1/;
+
+ return ($BUILD_MAJOR_VERSION, $BUILD_MINOR_VERSION, $BUILD_TINY_VERSION);
+}
+
+sub splitBuildMajorVersion($)
+{
+ # Split the first component further by using the first digit for the
+ # major version and the remaining two characters as the minor version.
+ # The minor version is shifted down to the tiny version, with the tiny
+ # version becoming the variant version.
+ 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;
+ $MINOR_VERSION = '';
+ }
+ }
+
+ return ($MAJOR_VERSION, $MINOR_VERSION);
+}
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes