]> git.donarmstrong.com Git - lilypond.git/commitdiff
Fix convert-ly and make --current-version really work
authorJohn Mandereau <john.mandereau@gmail.com>
Fri, 29 Feb 2008 21:11:40 +0000 (22:11 +0100)
committerJohn Mandereau <john.mandereau@gmail.com>
Fri, 29 Feb 2008 21:11:40 +0000 (22:11 +0100)
scripts/convert-ly.py

index 32345fc5ba503f16f784e10e9cb308e1fce00c8a..708214d3154fce87e7d8698328bdb95a15e761ca 100644 (file)
@@ -126,7 +126,7 @@ def get_option_parser ():
 
 
 def str_to_tuple (s):
-    return tuple ([int n for n in s.split ('.')])
+    return tuple ([int(n) for n in s.split ('.')])
 
 def tup_to_str (t):
     return '.'.join (['%s' % x for x in t])
@@ -143,8 +143,6 @@ def get_conversions (from_version, to_version):
     return filter (is_applicable, convertrules.conversions)
 
 def latest_version ():
-    if global_options.force_current_version:
-        return str_to_tuple (program_version)
     return convertrules.conversions[-1][0]
 
 def show_rules (file, from_version, to_version):
@@ -222,9 +220,11 @@ def do_one_file (infile_name):
 
 
     (last, result) = do_conversion (input, from_version, to_version)
-    infile.close ()
 
     if last:
+        if global_options.force_current_version and last == to_version:
+            last = str_to_tuple (program_version)
+
         newversion = r'\version "%s"' % tup_to_str (last)
         if lilypond_version_re.search (result):
             result = re.sub (lilypond_version_re_str,