From: Jan Nieuwenhuizen Date: Fri, 16 Jul 2004 08:45:32 +0000 (+0000) Subject: (Lilypond_snippet.is_outdated): Check X-Git-Tag: release/2.3.7~39 X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=d43a1bfb4fc93eb9d6ec73f52e93c9c79f9ba214;p=lilypond.git (Lilypond_snippet.is_outdated): Check for lilypondend. --- diff --git a/ChangeLog b/ChangeLog index 3fa75feeb7..6ccb989ebe 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2004-07-16 Jan Nieuwenhuizen + + * scripts/lilypond-book.py (Lilypond_snippet.is_outdated): Check + for lilypondend. + 2004-07-16 Han-Wen Nienhuys * make/mutopia-vars.make ($(addprefix $(outdir)/,$(LYM4_FILES): diff --git a/scripts/lilypond-book.py b/scripts/lilypond-book.py index 618390253b..f5cc59d722 100644 --- a/scripts/lilypond-book.py +++ b/scripts/lilypond-book.py @@ -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