Reviewers: ,
Message:
A small patch to fix makelsr's handling of local updates. Don't want to
wait for countdown, but a review by those who understand this would be
helpful.
Description:
I omitted to specify properly what makelsr should do when it's doing a
"local" update - i.e. with no tarball specified. In this case it should
only update snippets/new into snippets. This patch fixes that.
Please review this at http://codereview.appspot.com/6416045/
Affected files:
M scripts/auxiliar/makelsr.py
Index: scripts/auxiliar/makelsr.py
diff --git a/scripts/auxiliar/makelsr.py b/scripts/auxiliar/makelsr.py
index
278173f6361b288b8d7ac30e753884e3734fee4d..099418b86f7534204ad10a2a216c70def82a5ceb
100755
--- a/scripts/auxiliar/makelsr.py
+++ b/scripts/auxiliar/makelsr.py
@@ -149,6 +149,7 @@ def exit_with_usage (n=0):
options_parser.print_help (sys.stderr)
sys.exit (n)
+tags=[]
if len (args):
in_dir = args[0]
if not (os.path.isdir (in_dir)):
@@ -156,6 +157,7 @@ if len (args):
sys.exit (4)
if len (args) > 1:
exit_with_usage (2)
+ tags = os.listdir (in_dir)
else:
in_dir = '.'
@@ -175,8 +177,6 @@ if not os.path.exists (lilypond_bin):
lilypond_bin = "lilypond"
sys.stderr.write ("Using %s, %s\n" % (convert_ly, lilypond_bin))
-tags = os.listdir (in_dir)
-
unsafe = []
unconverted = []
notags_files = []
@@ -305,9 +305,13 @@ def dump_file_list (file, file_list, update=False):
f = open (file, 'w')
f.write ('\n'.join (sorted (new_list)) + '\n')
-## clean out existing lys and generated files
-map (os.remove, glob.glob (os.path.join (lys_from_lsr, '*.ly')) +
- glob.glob (os.path.join (lys_from_lsr, '*.snippet-list')))
+## clean out existing lys and generated files - but only when we're
+## completely recreating them from the tarball. Otherwise
+## tags will be empty and so we can use this to skip this step
+
+if len(args) > 0:
+ map (os.remove, glob.glob (os.path.join (lys_from_lsr, '*.ly')) +
+ glob.glob (os.path.join (lys_from_lsr, '*.snippet-list')))
# read LSR source where tags are defined by subdirs
snippets, tag_lists = read_source_with_dirs (in_dir)
_______________________________________________
lilypond-devel mailing list
lilypond-devel@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-devel