]> git.saurik.com Git - apple/javascriptcore.git/blobdiff - offlineasm/self_hash.rb
JavaScriptCore-7600.1.4.11.8.tar.gz
[apple/javascriptcore.git] / offlineasm / self_hash.rb
index 2c300fccc87d653a5af5d2f7c4e56779c31070ae..6c736ff5bfc9f219ccce21c51aa04fdfb7ccb7bf 100644 (file)
@@ -21,6 +21,7 @@
 # ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
 # THE POSSIBILITY OF SUCH DAMAGE.
 
+require "config"
 require "digest/sha1"
 require "pathname"
 
@@ -43,6 +44,21 @@ def dirHash(directory, regexp)
     return Digest::SHA1.hexdigest(contents)
 end
 
+#
+# fileListHash(fileList) -> SHA1 hexdigest
+#
+# Returns a hash of all files in the list.
+#
+
+def fileListHash(fileList)
+    contents = ""
+    fileList.each {
+        | fileName |
+        contents += IO::read(fileName)
+    }
+    return Digest::SHA1.hexdigest(contents)
+end
+
 #
 # selfHash -> SHA1 hexdigest
 #