X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=scripts%2Fconvert-ly.py;h=2772acc7382c144590cb73ca2da6c3db58603059;hb=21c9f487462d40436299a4e3a1e3289a1bc4bf15;hp=383f2fb855a5437c8edd0b601e37a2e5b84e927b;hpb=8c197373e3dfce4382469a541b38be1f13a48e13;p=lilypond.git diff --git a/scripts/convert-ly.py b/scripts/convert-ly.py index 383f2fb855..2772acc738 100644 --- a/scripts/convert-ly.py +++ b/scripts/convert-ly.py @@ -5,7 +5,7 @@ # This file is part of LilyPond, the GNU music typesetter. # -# Copyright (C) 1998--2011 Han-Wen Nienhuys +# Copyright (C) 1998--2012 Han-Wen Nienhuys # Jan Nieuwenhuizen # # LilyPond is free software: you can redistribute it and/or modify @@ -39,6 +39,8 @@ import convertrules lilypond_version_re_str = '\\\\version *\"([0-9.]+)"' lilypond_version_re = re.compile (lilypond_version_re_str) +lilypond_version_strict_re_str = '\\\\version *\"([0-9]+[.][0-9]+[.][0-9]+)"' +lilypond_version_strict_re = re.compile (lilypond_version_strict_re_str) help_summary = ( _ ('''Update LilyPond input to newer version. By default, update from the @@ -70,7 +72,7 @@ def warranty (): %s %s -''' % ( _ ('Copyright (c) %s by') % '2001--2011', +''' % ( _ ('Copyright (c) %s by') % '2001--2012', ' '.join (authors), _ ('Distributed under terms of the GNU General Public License.'), _ ('It comes with NO WARRANTY.'))) @@ -206,9 +208,12 @@ string.""" def guess_lilypond_version (input): - m = lilypond_version_re.search (input) + m = lilypond_version_strict_re.search (input) if m: return m.group (1) + m = lilypond_version_re.search (input) + if m: + raise InvalidVersion (m.group (1)) else: return ''