From eb030129e9e045ad849b04a470e36c872d2022ce Mon Sep 17 00:00:00 2001 From: Neil Puttock Date: Tue, 28 Apr 2009 23:37:29 +0100 Subject: [PATCH] Add version message to snippets copied from input/new. --- scripts/auxiliar/makelsr.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/scripts/auxiliar/makelsr.py b/scripts/auxiliar/makelsr.py index 97791055bf..80628cbf16 100755 --- a/scripts/auxiliar/makelsr.py +++ b/scripts/auxiliar/makelsr.py @@ -66,10 +66,16 @@ lsr_comment_re = re.compile (r'\s*%+\s*LSR.*') begin_header_re = re.compile (r'\\header\s*{', re.M) +ly_new_version_re = re.compile (r'\\version\s*"(.+?)"') + # add tags to ly files from LSR def add_tags (ly_code, tags): return begin_header_re.sub ('\\g<0>\n lsrtags = "' + tags + '"\n', ly_code, 1) +# for snippets from input/new, add message for earliest working version +def add_version (ly_code): + return '''%% Note: this file works from version ''' + ly_new_version_re.search (ly_code).group (1) + '\n' + def copy_ly (srcdir, name, tags): global unsafe global unconverted @@ -90,7 +96,7 @@ def copy_ly (srcdir, name, tags): if in_dir and in_dir in srcdir: s = LY_HEADER_LSR + add_tags (s, tags) else: - s = LY_HEADER_NEW + s + s = LY_HEADER_NEW + add_version (s) + s s = mark_verbatim_section (s) s = lsr_comment_re.sub ('', s) -- 2.39.5