]> git.donarmstrong.com Git - lilypond.git/commitdiff
lilypond-book: Change md5 hashing strategy
authorPatrick McCarty <pnorcks@gmail.com>
Mon, 28 Sep 2009 20:22:47 +0000 (13:22 -0700)
committerPatrick McCarty <pnorcks@gmail.com>
Mon, 28 Sep 2009 20:30:46 +0000 (13:30 -0700)
Previously, the md5 hash for folder/file names was based on the entire
.ly file contents.  This worked okay until the preamble changed, which
then broke `make check'.

This commit changes the strategy so that only the LY code (without the
preamble) is used when computing the md5 hash.  This will fix the regtest
comparison output between releases from now on.

scripts/lilypond-book.py

index 276c2aae509b42794145f9f05fd7d572fc600425..6abbe5393b7c48cc208ec970d18334dbc15e5288 100644 (file)
@@ -1227,7 +1227,9 @@ class LilypondSnippet (Snippet):
             except ImportError:
                 from md5 import md5
 
-            hash = md5 (self.relevant_contents (self.full_ly ()))
+            # We only want to calculate the hash based
+            # on the snippet code, not the snippet + preamble
+            hash = md5 (self.relevant_contents (self.ly ()))
 
             ## let's not create too long names.
             self.checksum = hash.hexdigest ()[:10]