generate-unified-source-bundles.rb shouldn't write a file that isn't going to change
authorkeith_miller@apple.com <keith_miller@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 15 Sep 2017 21:06:49 +0000 (21:06 +0000)
committerkeith_miller@apple.com <keith_miller@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 15 Sep 2017 21:06:49 +0000 (21:06 +0000)
https://bugs.webkit.org/show_bug.cgi?id=177021

Reviewed by Tim Horton.

* generate-unified-source-bundles.rb:

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

Source/WTF/ChangeLog
Source/WTF/generate-unified-source-bundles.rb

index 5492c8b..bbc2f93 100644 (file)
@@ -1,3 +1,12 @@
+2017-09-15  Keith Miller  <keith_miller@apple.com>
+
+        generate-unified-source-bundles.rb shouldn't write a file that isn't going to change
+        https://bugs.webkit.org/show_bug.cgi?id=177021
+
+        Reviewed by Tim Horton.
+
+        * generate-unified-source-bundles.rb:
+
 2017-09-14  Saam Barati  <sbarati@apple.com>
 
         We should have a way of preventing a caller from making a tail call and we should use it for ProxyObject instead of using build flags
index 4ffedea..91ebb0a 100644 (file)
@@ -87,10 +87,13 @@ class BundleManager
         @bundleCount += 1
         bundleFile = "UnifiedSource#{@bundleCount}#{extension}"
         bundleFile = $derivedSourcesPath + bundleFile
-        log("writing bundle #{bundleFile} with: \n#{@currentBundleText}")
-        IO::write(bundleFile, @currentBundleText)
         $generatedSources << bundleFile
 
+        if (!bundleFile.exist? || IO::read(bundleFile) != @currentBundleText)
+            log("writing bundle #{bundleFile} with: \n#{@currentBundleText}")
+            IO::write(bundleFile, @currentBundleText)
+        end
+
         @currentBundleText = ""
         @fileCount = 0
     end