[Qt] Store build config immediately instead of waiting for a successfull build
authorvestbo@webkit.org <vestbo@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 30 Jan 2012 12:47:28 +0000 (12:47 +0000)
committervestbo@webkit.org <vestbo@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 30 Jan 2012 12:47:28 +0000 (12:47 +0000)
Otherwise we will not pick up changes to the config if the build is aborted,
for example due to build errors or if the user pressed Ctrl+Z. We now write
the new config before starting a build, but still defer to write the SVN
revision once the build completes successfully.

Reviewed by Ossy.

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

Tools/ChangeLog
Tools/Scripts/webkitdirs.pm

index 562b2df..0b62ac3 100644 (file)
@@ -1,3 +1,17 @@
+2012-01-30  Tor Arne Vestbø  <tor.arne.vestbo@nokia.com>
+
+        [Qt] Store build config immediately instead of waiting for a successfull build
+
+        Otherwise we will not pick up changes to the config if the build is aborted,
+        for example due to build errors or if the user pressed Ctrl+Z. We now write
+        the new config before starting a build, but still defer to write the SVN
+        revision once the build completes successfully.
+
+        Reviewed by Ossy.
+
+        * Scripts/webkitdirs.pm:
+        (buildQMakeProjects):
+
 2012-01-30  Alexander Færøy  <ahf@0x90.dk>
 
         [Qt] Add "New Window" button to the Qt MiniBrowser
index e8fe3d2..cc3e597 100755 (executable)
@@ -2188,6 +2188,15 @@ sub buildQMakeProjects
         #}
     }
 
+    # Save config up-front so we can detect changes to the build config even
+    # when the user re-configures after aborting the build.
+    open(DEFAULTS, ">$pathToDefinesCache");
+    print DEFAULTS "# These defines were set when building WebKit last time\n";
+    foreach my $key (sort keys %defines) {
+        print DEFAULTS "$key=$defines{$key}\n";
+    }
+    close(DEFAULTS);
+
     my $result = 0;
 
     my $makefile = File::Spec->catfile($dir, "Makefile");
@@ -2221,12 +2230,9 @@ sub buildQMakeProjects
     chdir ".." or die;
 
     if ($result eq 0) {
-        $defines{"SVN_REVISION"} = $svnRevision;
-        open(DEFAULTS, ">$pathToDefinesCache");
-        print DEFAULTS "# These defines were set when building WebKit last time\n";
-        foreach my $key (sort keys %defines) {
-            print DEFAULTS "$key=$defines{$key}\n";
-        }
+        # Now that the build completed successfully we can save the SVN revision
+        open(DEFAULTS, ">>$pathToDefinesCache");
+        print DEFAULTS "SVN_REVISION=$svnRevision\n";
         close(DEFAULTS);
     } elsif ($buildHint eq "" && exitStatus($result)) {
         my $exitCode = exitStatus($result);