Correct handling of __VERSION_TEXT__ for 4+-tuple versions
authorbfulgham@apple.com <bfulgham@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 22 Jul 2014 18:35:32 +0000 (18:35 +0000)
committerbfulgham@apple.com <bfulgham@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 22 Jul 2014 18:35:32 +0000 (18:35 +0000)
https://bugs.webkit.org/show_bug.cgi?id=135161
<rdar://problem/17763546>

Reviewed by David Kilzer.

Tools:
* Scripts/webkitperl/auto-version_unittest/autoVersionTests.pl:
Add additional test cases to catch errors in multiple-tuple
version string handling.

WebKitLibraries:
Revise the auto-version.pl script to properly handle version
strings with 4 (or more) version tuples. Previously these were
being truncated from the version.

* win/tools/scripts/auto-version.pl:
(splitVersion): Return truncated version of
overall version string.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@171351 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Tools/ChangeLog
Tools/Scripts/webkitperl/auto-version_unittest/autoVersionTests.pl
WebKitLibraries/ChangeLog
WebKitLibraries/win/tools/scripts/auto-version.pl

index 63c3d72..3e0dfea 100644 (file)
@@ -1,3 +1,15 @@
+2014-07-22  Brent Fulgham  <bfulgham@apple.com>
+
+        Correct handling of __VERSION_TEXT__ for 4+-tuple versions
+        https://bugs.webkit.org/show_bug.cgi?id=135161
+        <rdar://problem/17763546>
+
+        Reviewed by David Kilzer.
+
+        * Scripts/webkitperl/auto-version_unittest/autoVersionTests.pl:
+        Add additional test cases to catch errors in multiple-tuple
+        version string handling.
+
 2014-07-18  Filip Pizlo  <fpizlo@apple.com>
 
         Extend exception fuzzing to the LLInt
index 8379ff9..6e6c0e6 100644 (file)
@@ -35,9 +35,9 @@ my @testCases =
     {
         'RC_ProjectSourceVersion' => '5300.4.3.2.1',
         expectedResults => {
-            '__VERSION_TEXT__' => '300.4.3',
-            '__BUILD_NUMBER__' => '300.4.3',
-            '__BUILD_NUMBER_SHORT__' => '300.4.3',
+            '__VERSION_TEXT__' => '300.4.3.2.1',
+            '__BUILD_NUMBER__' => '300.4.3.2.1',
+            '__BUILD_NUMBER_SHORT__' => '300.4.3.2.1',
             '__VERSION_MAJOR__' => '3',
             '__VERSION_MINOR__' => '00',
             '__VERSION_TINY__' => '4',
@@ -51,9 +51,9 @@ my @testCases =
     {
         'RC_ProjectSourceVersion' => '530.4.3.2.1',
         expectedResults => {
-            '__VERSION_TEXT__' => '530.4.3',
-            '__BUILD_NUMBER__' => '530.4.3',
-            '__BUILD_NUMBER_SHORT__' => '530.4.3',
+            '__VERSION_TEXT__' => '530.4.3.2.1',
+            '__BUILD_NUMBER__' => '530.4.3.2.1',
+            '__BUILD_NUMBER_SHORT__' => '530.4.3.2.1',
             '__VERSION_MAJOR__' => '5',
             '__VERSION_MINOR__' => '30',
             '__VERSION_TINY__' => '4',
@@ -67,9 +67,9 @@ my @testCases =
     {
         'RC_ProjectSourceVersion' => '53.4.3.2.1',
         expectedResults => {
-            '__VERSION_TEXT__' => '53.4.3',
-            '__BUILD_NUMBER__' => '53.4.3',
-            '__BUILD_NUMBER_SHORT__' => '53.4.3',
+            '__VERSION_TEXT__' => '53.4.3.2.1',
+            '__BUILD_NUMBER__' => '53.4.3.2.1',
+            '__BUILD_NUMBER_SHORT__' => '53.4.3.2.1',
             '__VERSION_MAJOR__' => '5',
             '__VERSION_MINOR__' => '3',
             '__VERSION_TINY__' => '4',
@@ -83,9 +83,9 @@ my @testCases =
     {
         'RC_ProjectSourceVersion' => '5.4.3.2.1',
         expectedResults => {
-            '__VERSION_TEXT__' => '5.4.3',
-            '__BUILD_NUMBER__' => '5.4.3',
-            '__BUILD_NUMBER_SHORT__' => '5.4.3',
+            '__VERSION_TEXT__' => '5.4.3.2.1',
+            '__BUILD_NUMBER__' => '5.4.3.2.1',
+            '__BUILD_NUMBER_SHORT__' => '5.4.3.2.1',
             '__VERSION_MAJOR__' => '5',
             '__VERSION_MINOR__' => '',
             '__VERSION_TINY__' => '4',
@@ -99,9 +99,9 @@ my @testCases =
     {
         'RC_ProjectSourceVersion' => '5300.4.3.2',
         expectedResults => {
-            '__VERSION_TEXT__' => '300.4.3',
-            '__BUILD_NUMBER__' => '300.4.3',
-            '__BUILD_NUMBER_SHORT__' => '300.4.3',
+            '__VERSION_TEXT__' => '300.4.3.2',
+            '__BUILD_NUMBER__' => '300.4.3.2',
+            '__BUILD_NUMBER_SHORT__' => '300.4.3.2',
             '__VERSION_MAJOR__' => '3',
             '__VERSION_MINOR__' => '00',
             '__VERSION_TINY__' => '4',
@@ -115,9 +115,9 @@ my @testCases =
     {
         'RC_ProjectSourceVersion' => '530.4.3.2',
         expectedResults => {
-            '__VERSION_TEXT__' => '530.4.3',
-            '__BUILD_NUMBER__' => '530.4.3',
-            '__BUILD_NUMBER_SHORT__' => '530.4.3',
+            '__VERSION_TEXT__' => '530.4.3.2',
+            '__BUILD_NUMBER__' => '530.4.3.2',
+            '__BUILD_NUMBER_SHORT__' => '530.4.3.2',
             '__VERSION_MAJOR__' => '5',
             '__VERSION_MINOR__' => '30',
             '__VERSION_TINY__' => '4',
@@ -131,9 +131,9 @@ my @testCases =
     {
         'RC_ProjectSourceVersion' => '53.4.3.2',
         expectedResults => {
-            '__VERSION_TEXT__' => '53.4.3',
-            '__BUILD_NUMBER__' => '53.4.3',
-            '__BUILD_NUMBER_SHORT__' => '53.4.3',
+            '__VERSION_TEXT__' => '53.4.3.2',
+            '__BUILD_NUMBER__' => '53.4.3.2',
+            '__BUILD_NUMBER_SHORT__' => '53.4.3.2',
             '__VERSION_MAJOR__' => '5',
             '__VERSION_MINOR__' => '3',
             '__VERSION_TINY__' => '4',
@@ -147,9 +147,9 @@ my @testCases =
     {
         'RC_ProjectSourceVersion' => '5.4.3.2',
         expectedResults => {
-            '__VERSION_TEXT__' => '5.4.3',
-            '__BUILD_NUMBER__' => '5.4.3',
-            '__BUILD_NUMBER_SHORT__' => '5.4.3',
+            '__VERSION_TEXT__' => '5.4.3.2',
+            '__BUILD_NUMBER__' => '5.4.3.2',
+            '__BUILD_NUMBER_SHORT__' => '5.4.3.2',
             '__VERSION_MAJOR__' => '5',
             '__VERSION_MINOR__' => '',
             '__VERSION_TINY__' => '4',
@@ -227,9 +227,9 @@ my @testCases =
     {
         'RC_ProjectSourceVersion' => '5300.4',
         expectedResults => {
-            '__VERSION_TEXT__' => '300.4.0',
-            '__BUILD_NUMBER__' => '300.4.0',
-            '__BUILD_NUMBER_SHORT__' => '300.4.0',
+            '__VERSION_TEXT__' => '300.4',
+            '__BUILD_NUMBER__' => '300.4',
+            '__BUILD_NUMBER_SHORT__' => '300.4',
             '__VERSION_MAJOR__' => '3',
             '__VERSION_MINOR__' => '00',
             '__VERSION_TINY__' => '4',
@@ -243,9 +243,9 @@ my @testCases =
     {
         'RC_ProjectSourceVersion' => '530.4',
         expectedResults => {
-            '__VERSION_TEXT__' => '530.4.0',
-            '__BUILD_NUMBER__' => '530.4.0',
-            '__BUILD_NUMBER_SHORT__' => '530.4.0',
+            '__VERSION_TEXT__' => '530.4',
+            '__BUILD_NUMBER__' => '530.4',
+            '__BUILD_NUMBER_SHORT__' => '530.4',
             '__VERSION_MAJOR__' => '5',
             '__VERSION_MINOR__' => '30',
             '__VERSION_TINY__' => '4',
@@ -259,9 +259,9 @@ my @testCases =
     {
         'RC_ProjectSourceVersion' => '53.4',
         expectedResults => {
-            '__VERSION_TEXT__' => '53.4.0',
-            '__BUILD_NUMBER__' => '53.4.0',
-            '__BUILD_NUMBER_SHORT__' => '53.4.0',
+            '__VERSION_TEXT__' => '53.4',
+            '__BUILD_NUMBER__' => '53.4',
+            '__BUILD_NUMBER_SHORT__' => '53.4',
             '__VERSION_MAJOR__' => '5',
             '__VERSION_MINOR__' => '3',
             '__VERSION_TINY__' => '4',
@@ -275,9 +275,9 @@ my @testCases =
     {
         'RC_ProjectSourceVersion' => '5.4',
         expectedResults => {
-            '__VERSION_TEXT__' => '5.4.0',
-            '__BUILD_NUMBER__' => '5.4.0',
-            '__BUILD_NUMBER_SHORT__' => '5.4.0',
+            '__VERSION_TEXT__' => '5.4',
+            '__BUILD_NUMBER__' => '5.4',
+            '__BUILD_NUMBER_SHORT__' => '5.4',
             '__VERSION_MAJOR__' => '5',
             '__VERSION_MINOR__' => '',
             '__VERSION_TINY__' => '4',
@@ -291,9 +291,9 @@ my @testCases =
     {
         'RC_ProjectSourceVersion' => '5300',
         expectedResults => {
-            '__VERSION_TEXT__' => '300.0.0',
-            '__BUILD_NUMBER__' => '300.0.0',
-            '__BUILD_NUMBER_SHORT__' => '300.0.0',
+            '__VERSION_TEXT__' => '300',
+            '__BUILD_NUMBER__' => '300',
+            '__BUILD_NUMBER_SHORT__' => '300',
             '__VERSION_MAJOR__' => '3',
             '__VERSION_MINOR__' => '00',
             '__VERSION_TINY__' => '0',
@@ -307,9 +307,9 @@ my @testCases =
     {
         'RC_ProjectSourceVersion' => '530',
         expectedResults => {
-            '__VERSION_TEXT__' => '530.0.0',
-            '__BUILD_NUMBER__' => '530.0.0',
-            '__BUILD_NUMBER_SHORT__' => '530.0.0',
+            '__VERSION_TEXT__' => '530',
+            '__BUILD_NUMBER__' => '530',
+            '__BUILD_NUMBER_SHORT__' => '530',
             '__VERSION_MAJOR__' => '5',
             '__VERSION_MINOR__' => '30',
             '__VERSION_TINY__' => '0',
@@ -320,13 +320,125 @@ my @testCases =
         },
     },
 
+    {
+        'RC_ProjectSourceVersion' => '10530.1.1.1',
+        expectedResults => {
+            '__VERSION_TEXT__' => '530.1.1.1',
+            '__BUILD_NUMBER__' => '530.1.1.1',
+            '__BUILD_NUMBER_SHORT__' => '530.1.1.1',
+            '__VERSION_MAJOR__' => '5',
+            '__VERSION_MINOR__' => '30',
+            '__VERSION_TINY__' => '1',
+            '__VERSION_BUILD__' => '1',
+            '__BUILD_NUMBER_MAJOR__' => '530',
+            '__BUILD_NUMBER_MINOR__' => '1',
+            '__BUILD_NUMBER_VARIANT__' => '1',
+        },
+    },
+
+    {
+        'RC_ProjectSourceVersion' => '10530.30.20.10',
+        expectedResults => {
+            '__VERSION_TEXT__' => '530.30.20.10',
+            '__BUILD_NUMBER__' => '530.30.20.10',
+            '__BUILD_NUMBER_SHORT__' => '530.30.20.10',
+            '__VERSION_MAJOR__' => '5',
+            '__VERSION_MINOR__' => '30',
+            '__VERSION_TINY__' => '30',
+            '__VERSION_BUILD__' => '20',
+            '__BUILD_NUMBER_MAJOR__' => '530',
+            '__BUILD_NUMBER_MINOR__' => '30',
+            '__BUILD_NUMBER_VARIANT__' => '20',
+        },
+    },
+
+    {
+        'RC_ProjectSourceVersion' => '10530.300.200.100',
+        expectedResults => {
+            '__VERSION_TEXT__' => '530.300.200.100',
+            '__BUILD_NUMBER__' => '530.300.200.100',
+            '__BUILD_NUMBER_SHORT__' => '530.300.200.100',
+            '__VERSION_MAJOR__' => '5',
+            '__VERSION_MINOR__' => '30',
+            '__VERSION_TINY__' => '300',
+            '__VERSION_BUILD__' => '200',
+            '__BUILD_NUMBER_MAJOR__' => '530',
+            '__BUILD_NUMBER_MINOR__' => '300',
+            '__BUILD_NUMBER_VARIANT__' => '200',
+        },
+    },
+
+    {
+        'RC_ProjectSourceVersion' => '10530.3000.2000.1000',
+        expectedResults => {
+            '__VERSION_TEXT__' => '530.3000.2000.1000',
+            '__BUILD_NUMBER__' => '530.3000.2000.1000',
+            '__BUILD_NUMBER_SHORT__' => '530.3000.2000.1000',
+            '__VERSION_MAJOR__' => '5',
+            '__VERSION_MINOR__' => '30',
+            '__VERSION_TINY__' => '3000',
+            '__VERSION_BUILD__' => '2000',
+            '__BUILD_NUMBER_MAJOR__' => '530',
+            '__BUILD_NUMBER_MINOR__' => '3000',
+            '__BUILD_NUMBER_VARIANT__' => '2000',
+        },
+    },
+
+    {
+        'RC_ProjectSourceVersion' => '7530.3000.2000.1000',
+        expectedResults => {
+            '__VERSION_TEXT__' => '530.3000.2000.1000',
+            '__BUILD_NUMBER__' => '530.3000.2000.1000',
+            '__BUILD_NUMBER_SHORT__' => '530.3000.2000.1000',
+            '__VERSION_MAJOR__' => '5',
+            '__VERSION_MINOR__' => '30',
+            '__VERSION_TINY__' => '3000',
+            '__VERSION_BUILD__' => '2000',
+            '__BUILD_NUMBER_MAJOR__' => '530',
+            '__BUILD_NUMBER_MINOR__' => '3000',
+            '__BUILD_NUMBER_VARIANT__' => '2000',
+        },
+    },
+
+    {
+        'RC_ProjectSourceVersion' => '7530.300.200.100',
+        expectedResults => {
+            '__VERSION_TEXT__' => '530.300.200.100',
+            '__BUILD_NUMBER__' => '530.300.200.100',
+            '__BUILD_NUMBER_SHORT__' => '530.300.200.100',
+            '__VERSION_MAJOR__' => '5',
+            '__VERSION_MINOR__' => '30',
+            '__VERSION_TINY__' => '300',
+            '__VERSION_BUILD__' => '200',
+            '__BUILD_NUMBER_MAJOR__' => '530',
+            '__BUILD_NUMBER_MINOR__' => '300',
+            '__BUILD_NUMBER_VARIANT__' => '200',
+        },
+    },
+
+    {
+        'RC_ProjectSourceVersion' => '7530.30.20.10',
+        expectedResults => {
+            '__VERSION_TEXT__' => '530.30.20.10',
+            '__BUILD_NUMBER__' => '530.30.20.10',
+            '__BUILD_NUMBER_SHORT__' => '530.30.20.10',
+            '__VERSION_MAJOR__' => '5',
+            '__VERSION_MINOR__' => '30',
+            '__VERSION_TINY__' => '30',
+            '__VERSION_BUILD__' => '20',
+            '__BUILD_NUMBER_MAJOR__' => '530',
+            '__BUILD_NUMBER_MINOR__' => '30',
+            '__BUILD_NUMBER_VARIANT__' => '20',
+        },
+    },
+
     # Smallest "Valid" case
     {
         'RC_ProjectSourceVersion' => '53',
         expectedResults => {
-            '__VERSION_TEXT__' => '53.0.0',
-            '__BUILD_NUMBER__' => '53.0.0',
-            '__BUILD_NUMBER_SHORT__' => '53.0.0',
+            '__VERSION_TEXT__' => '53',
+            '__BUILD_NUMBER__' => '53',
+            '__BUILD_NUMBER_SHORT__' => '53',
             '__VERSION_MAJOR__' => '5',
             '__VERSION_MINOR__' => '3',
             '__VERSION_TINY__' => '0',
@@ -341,9 +453,9 @@ my @testCases =
     {
         'RC_ProjectSourceVersion' => '5',
         expectedResults => {
-            '__VERSION_TEXT__' => '5.0.0',
-            '__BUILD_NUMBER__' => '5.0.0',
-            '__BUILD_NUMBER_SHORT__' => '5.0.0',
+            '__VERSION_TEXT__' => '5',
+            '__BUILD_NUMBER__' => '5',
+            '__BUILD_NUMBER_SHORT__' => '5',
             '__VERSION_MAJOR__' => '5',
             '__VERSION_MINOR__' => '',
             '__VERSION_TINY__' => '0',
@@ -358,9 +470,60 @@ my @testCases =
     {
         'RC_ProjectSourceVersion' => '214747.99.99.99.99',
         expectedResults => {
-            '__VERSION_TEXT__' => '747.99.99',
-            '__BUILD_NUMBER__' => '747.99.99',
-            '__BUILD_NUMBER_SHORT__' => '747.99.99',
+            '__VERSION_TEXT__' => '747.99.99.99.99',
+            '__BUILD_NUMBER__' => '747.99.99.99.99',
+            '__BUILD_NUMBER_SHORT__' => '747.99.99.99.99',
+            '__VERSION_MAJOR__' => '7',
+            '__VERSION_MINOR__' => '47',
+            '__VERSION_TINY__' => '99',
+            '__VERSION_BUILD__' => '99',
+            '__BUILD_NUMBER_MAJOR__' => '747',
+            '__BUILD_NUMBER_MINOR__' => '99',
+            '__BUILD_NUMBER_VARIANT__' => '99',
+        },
+    },
+
+    # Leading Whitespace
+    {
+        'RC_ProjectSourceVersion' => '        214747.99.99.99.99',
+        expectedResults => {
+            '__VERSION_TEXT__' => '747.99.99.99.99',
+            '__BUILD_NUMBER__' => '747.99.99.99.99',
+            '__BUILD_NUMBER_SHORT__' => '747.99.99.99.99',
+            '__VERSION_MAJOR__' => '7',
+            '__VERSION_MINOR__' => '47',
+            '__VERSION_TINY__' => '99',
+            '__VERSION_BUILD__' => '99',
+            '__BUILD_NUMBER_MAJOR__' => '747',
+            '__BUILD_NUMBER_MINOR__' => '99',
+            '__BUILD_NUMBER_VARIANT__' => '99',
+        },
+    },
+
+    # Trailing Whitespace
+    {
+        'RC_ProjectSourceVersion' => '214747.99.99.99.99      ',
+        expectedResults => {
+            '__VERSION_TEXT__' => '747.99.99.99.99',
+            '__BUILD_NUMBER__' => '747.99.99.99.99',
+            '__BUILD_NUMBER_SHORT__' => '747.99.99.99.99',
+            '__VERSION_MAJOR__' => '7',
+            '__VERSION_MINOR__' => '47',
+            '__VERSION_TINY__' => '99',
+            '__VERSION_BUILD__' => '99',
+            '__BUILD_NUMBER_MAJOR__' => '747',
+            '__BUILD_NUMBER_MINOR__' => '99',
+            '__BUILD_NUMBER_VARIANT__' => '99',
+        },
+    },
+
+    # Leading and Trailing Whitespace
+    {
+        'RC_ProjectSourceVersion' => '        214747.99.99.99.99      ',
+        expectedResults => {
+            '__VERSION_TEXT__' => '747.99.99.99.99',
+            '__BUILD_NUMBER__' => '747.99.99.99.99',
+            '__BUILD_NUMBER_SHORT__' => '747.99.99.99.99',
             '__VERSION_MAJOR__' => '7',
             '__VERSION_MINOR__' => '47',
             '__VERSION_TINY__' => '99',
@@ -386,7 +549,7 @@ foreach my $testCase (@testCases) {
     my $toolsPath = $ENV{'WEBKIT_LIBRARIES'};
     my $autoVersionScript = File::Spec->catfile($toolsPath, 'tools', 'scripts', 'auto-version.pl');
     my $testOutputDir = tempdir(CLEANUP => 1);
-    `RC_ProjectSourceVersion=$testCase->{'RC_ProjectSourceVersion'} perl $autoVersionScript $testOutputDir`;
+    `RC_ProjectSourceVersion="$testCase->{'RC_ProjectSourceVersion'}" perl $autoVersionScript $testOutputDir`;
 
     my $expectedResults = $testCase->{expectedResults};
 
index 1dce3b7..3e5e73e 100644 (file)
@@ -1,3 +1,19 @@
+2014-07-22  Brent Fulgham  <bfulgham@apple.com>
+
+        Correct handling of __VERSION_TEXT__ for 4+-tuple versions
+        https://bugs.webkit.org/show_bug.cgi?id=135161
+        <rdar://problem/17763546>
+
+        Reviewed by David Kilzer.
+
+        Revise the auto-version.pl script to properly handle version
+        strings with 4 (or more) version tuples. Previously these were
+        being truncated from the version.
+
+        * win/tools/scripts/auto-version.pl:
+        (splitVersion): Return truncated version of
+        overall version string.
+
 2014-07-21  Brent Fulgham  <bfulgham@apple.com>
 
         [Win] Extend auto-version.pl to handle 5-tuple versions
index 800cb04..3989dcc 100755 (executable)
@@ -71,14 +71,12 @@ if (!defined $ENVIRONMENT_VERSION) {
 my $PROPOSED_VERSION = (defined $ENVIRONMENT_VERSION) ? $ENVIRONMENT_VERSION : $FALLBACK_VERSION;
 chomp($PROPOSED_VERSION);
 
-my ($BUILD_MAJOR_VERSION, $BUILD_MINOR_VERSION, $BUILD_TINY_VERSION) = splitVersion($PROPOSED_VERSION);
-
-$PROPOSED_VERSION = "$BUILD_MAJOR_VERSION.$BUILD_MINOR_VERSION.$BUILD_TINY_VERSION";
+my ($BUILD_MAJOR_VERSION, $BUILD_MINOR_VERSION, $BUILD_TINY_VERSION, $ADJUSTED_PROPOSED_VERSION) = splitVersion($PROPOSED_VERSION);
 
 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 = $ADJUSTED_PROPOSED_VERSION;
 my $VERSION_TEXT_SHORT = $VERSION_TEXT;
 
 my $SVN_REVISION = '';
@@ -124,9 +122,10 @@ 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.
+    $PROPOSED_VERSION =~ s/^\s+//g; # Get rid of any leading whitespace
+    $PROPOSED_VERSION =~ s/\s+$//g; # Get rid of any trailing whitespace
+
+    # Split out the components of the dotted version number.
     my @components = split(/\./, $PROPOSED_VERSION) or die "Couldn't parse $PROPOSED_VERSION";
     my $componentCount = scalar(@components);
 
@@ -145,9 +144,14 @@ sub splitVersion($)
     # 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.
+    my $originalLength = length($BUILD_MAJOR_VERSION);
     $BUILD_MAJOR_VERSION =~ s/^.*(\d\d\d)$/$1/;
 
-    return ($BUILD_MAJOR_VERSION, $BUILD_MINOR_VERSION, $BUILD_TINY_VERSION);
+    my $charactersToRemove = $originalLength - length($BUILD_MAJOR_VERSION);
+
+    $PROPOSED_VERSION = substr($PROPOSED_VERSION, $charactersToRemove);
+
+    return ($BUILD_MAJOR_VERSION, $BUILD_MINOR_VERSION, $BUILD_TINY_VERSION, $PROPOSED_VERSION);
 }
 
 sub splitBuildMajorVersion($)