]> git.donarmstrong.com Git - lilypond.git/commitdiff
(Lilypond_snippet.is_outdated): Check
authorJan Nieuwenhuizen <janneke@gnu.org>
Fri, 16 Jul 2004 08:45:32 +0000 (08:45 +0000)
committerJan Nieuwenhuizen <janneke@gnu.org>
Fri, 16 Jul 2004 08:45:32 +0000 (08:45 +0000)
for lilypondend.

ChangeLog
scripts/lilypond-book.py

index 3fa75feeb7a967b88b89cc572711994d22da441a..6ccb989ebe0961c715de9cb21e909b720f02326d 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2004-07-16  Jan Nieuwenhuizen  <janneke@gnu.org>
+
+       * scripts/lilypond-book.py (Lilypond_snippet.is_outdated): Check
+       for lilypondend.
+
 2004-07-16  Han-Wen Nienhuys   <hanwen@xs4all.nl>
 
        * make/mutopia-vars.make ($(addprefix $(outdir)/,$(LYM4_FILES):
index 618390253bc4bbbdce43a09e159a93424b2a9117..f5cc59d722572aa079b5fc20a738f5399e1dbc7a 100644 (file)
@@ -549,15 +549,18 @@ class Lilypond_snippet (Snippet):
        def is_outdated (self):
                base = self.basename ()
 
-               found = os.path.exists (base + '.ly') and \
-                       os.path.exists (base + '.tex')
+               tex_file = '%s.tex' % base
+               ly_file = '%s.ly' % base
+               ok = os.path.exists (ly_file) and os.path.exists (tex_file)\
+                    and os.stat (tex_file)[stat.ST_SIZE] \
+                    and open (tex_file).readlines ()[-1][1:-1] \
+                    == 'lilypondend'
 
                if format == HTML or format == TEXINFO:
-                       found = found and (os.path.exists (base + '.png')
-                                          or glob.glob (base + '-page*.png'))
+                       ok = ok and (os.path.exists (base + '.png')
+                                    or glob.glob (base + '-page*.png'))
                        
-               if found and (use_hash_p \
-                       or self.ly () == open (base + '.ly').read ()):
+               if ok and (use_hash_p or self.ly () == open (ly_file).read ()):
                        # TODO: something smart with target formats
                        # (ps, png) and m/ctimes
                        return None