From cb751fb6d992d7342f7f82ea76f29caff73e69e5 Mon Sep 17 00:00:00 2001 From: Karl Berry Date: Tue, 29 Sep 2020 21:24:01 +0000 Subject: lilyglyphs (29sep20) git-svn-id: svn://tug.org/texlive/trunk@56473 c570f23f-e606-0410-a88d-b1316a301751 --- .../lilyglyphs/lily-glyph-commands.py | 20 ++++----- .../lilyglyphs/lily-image-commands.py | 50 +++++++++++----------- .../linked_scripts/lilyglyphs/lily-rebuild-pdfs.py | 36 ++++++++-------- .../texlive/linked_scripts/tlshell/tlshell.tcl | 13 ++++-- 4 files changed, 62 insertions(+), 57 deletions(-) (limited to 'Build') diff --git a/Build/source/texk/texlive/linked_scripts/lilyglyphs/lily-glyph-commands.py b/Build/source/texk/texlive/linked_scripts/lilyglyphs/lily-glyph-commands.py index 691652ece6d..dae48cda009 100755 --- a/Build/source/texk/texlive/linked_scripts/lilyglyphs/lily-glyph-commands.py +++ b/Build/source/texk/texlive/linked_scripts/lilyglyphs/lily-glyph-commands.py @@ -8,7 +8,7 @@ # https://github.com/openlilylib/lilyglyphs % # http://www.openlilylib.org/lilyglyphs % # % -# Copyright 2012-2013 Urs Liska and others, ul@openlilylib.org % +# Copyright 2012-2020 Urs Liska and others, ul@openlilylib.org % # % # 'lilyglyphs' is free software: you can redistribute it and/or modify % # it under the terms of the LaTeX Project Public License, either % @@ -80,10 +80,10 @@ def read_entries(): if not len(line): # skip if cmd and glyph haven't been filled both if not (entry['cmd'] and entry['element']): - print 'Skip malformed entry \'' + entry['cmd'] + '\'. Please check input file' + print('Skip malformed entry \'' + entry['cmd'] + '\'. Please check input file') reset_entry() else: - print 'Read entry \'' + entry['cmd'] + '\'' + print('Read entry \'' + entry['cmd'] + '\'') lg.in_cmds[entry['cmd']] = {} lg.in_cmds[entry['cmd']]['element'] = entry['element'] lg.in_cmds[entry['cmd']]['type'] = entry['type'] @@ -110,13 +110,13 @@ def read_entries(): def usage(): - print 'genGlyphCommands.py' - print 'is part of the lilyglyphs package' - print '' - print 'Usage:' - print 'Pass the name (without path) of an input definitions file' - print '(this has to be located in the /stash_new_commands directory.' - print 'Please refer to the manual (documentation/lilyglyphs.pdf).' + print('genGlyphCommands.py') + print('is part of the lilyglyphs package') + print('') + print('Usage:') + print('Pass the name (without path) of an input definitions file') + print('(this has to be located in the /stash_new_commands directory.') + print('Please refer to the manual (documentation/lilyglyphs.pdf).') # #################################### # Finally launch the program diff --git a/Build/source/texk/texlive/linked_scripts/lilyglyphs/lily-image-commands.py b/Build/source/texk/texlive/linked_scripts/lilyglyphs/lily-image-commands.py index fce67ad53c2..741ad40e9b4 100755 --- a/Build/source/texk/texlive/linked_scripts/lilyglyphs/lily-image-commands.py +++ b/Build/source/texk/texlive/linked_scripts/lilyglyphs/lily-image-commands.py @@ -8,7 +8,7 @@ # https://github.com/openlilylib/lilyglyphs % # http://www.openlilylib.org/lilyglyphs % # % -# Copyright 2012-2013 Urs Liska and others, ul@openlilylib.org % +# Copyright 2012-2020 Urs Liska and others, ul@openlilylib.org % # % # 'lilyglyphs' is free software: you can redistribute it and/or modify % # it under the terms of the LaTeX Project Public License, either % @@ -63,35 +63,35 @@ lily_src_score = """ def main(): """Do the actual work of the script""" - print '' - print 'buildglyphimages.py,' - print 'Part of lilyglyphs.' - print '' + print('') + print('buildglyphimages.py,') + print('Part of lilyglyphs.') + print('') # set CWD and ensure the necessary subdirs are present check_paths() - print '' + print('') # load and parse input file lg.read_input_file(in_file) read_entries() - print '' + print('') # generate LilyPond source files for each command # and compile them write_lily_src_files() - print '' + print('') lg.compile_lily_files() - print '' + print('') # remove intermediate files and move pdfs to pdf directory lg.cleanup_lily_files() - print '' + print('') # generate latex commands and example code # and write them to the output file lg.generate_latex_commands() - print '' + print('') write_latex_file() @@ -127,11 +127,11 @@ rais = '' def read_entries(): """Parses the input source file and extracts glyph entries""" - print 'Read entries of LilyPond commands:' + print('Read entries of LilyPond commands:') for i in range(len(lg.definitions_file)): if '%%lilyglyphs' in lg.definitions_file[i]: i = read_entry(i) - print lg.lily_files + print(lg.lily_files) def read_entry(i): """Reads a single glyph entry from the input file and stores it @@ -165,11 +165,11 @@ def read_entry(i): # read command name line = lg.definitions_file[i].strip() cmd_name = line[: line.find('=') - 1] - print '- ' + cmd_name, + print('- ' + cmd_name, end=' ') if is_protected: - print '(protected and skipped)' + print('(protected and skipped)') else: - print '' #(for line break only) + print('') #(for line break only) # read actual command until we find a line the begins with a closing curly bracket i += 1 @@ -193,7 +193,7 @@ def read_entry(i): def usage(): - print """buildglyphimages. Part of the lilyglyphs package. + print("""buildglyphimages. Part of the lilyglyphs package. Parses a template file, creates single .ly files from it, uses LilyPond to create single glyph pdf files and set up template files to be used in LaTeX. @@ -204,7 +204,7 @@ def usage(): For detailed instructions refer to the manual. Usage: buildglyphimages.py in-file-name. - """ + """) def write_file_info(name, fout): """Formats file specific information for the lilyPond source file""" @@ -225,22 +225,22 @@ def write_file_info(name, fout): def write_latex_file(): """Composes LaTeX file and writes it to disk""" - print 'Generate LaTeX file' - print lg.dir_cmd, in_basename + print('Generate LaTeX file') + print(lg.dir_cmd, in_basename) lg.write_latex_file(os.path.join(os.getcwd(), lg.dir_cmd, in_basename + '.tex')) def write_lily_src_files(): """Generates one .ly file for each found new command""" skip_cmds = [] - print 'Write .ly files for each entry:' + print('Write .ly files for each entry:') for cmd_name in lg.in_cmds: - print '- ' + cmd_name + print('- ' + cmd_name) gen_src_name = os.path.join(lg.dir_lysrc, cmd_filename(cmd_name) + '.ly') # handle existing commands if os.path.exists(gen_src_name): action = '' while not (action == 'Y' or action == 'N'): - action = raw_input('already present. Overwrite (y/n)? ') + action = input('already present. Overwrite (y/n)? ') action = action.upper() if action == 'N': skip_cmds.append(cmd_name) @@ -281,7 +281,7 @@ def write_lily_src_files(): fout.close() # remove skipped commands from in_cmds - print skip_cmds + print(skip_cmds) for cmd_name in skip_cmds: del lg.in_cmds[cmd_name] lg.lily_files.remove(cmd_filename(cmd_name)) @@ -314,7 +314,7 @@ if __name__ == "__main__": in_path, in_filename = os.path.split(in_file) in_path = os.path.normpath(in_path) if not (('lilyglyphs' in in_path) and (in_path.endswith('definitions'))): - print 'File in the wrong location: ' + in_path + print('File in the wrong location: ' + in_path) usage() sys.exit(2) in_basename, in_ext = os.path.splitext(in_filename) diff --git a/Build/source/texk/texlive/linked_scripts/lilyglyphs/lily-rebuild-pdfs.py b/Build/source/texk/texlive/linked_scripts/lilyglyphs/lily-rebuild-pdfs.py index b74ab26c6bf..03a94d87773 100755 --- a/Build/source/texk/texlive/linked_scripts/lilyglyphs/lily-rebuild-pdfs.py +++ b/Build/source/texk/texlive/linked_scripts/lilyglyphs/lily-rebuild-pdfs.py @@ -8,7 +8,7 @@ # https://github.com/openlilylib/lilyglyphs % # http://www.openlilylib.org/lilyglyphs % # % -# Copyright 2012-2013 Urs Liska and others, ul@openlilylib.org % +# Copyright 2012-2020 Urs Liska and others, ul@openlilylib.org % # % # 'lilyglyphs' is free software: you can redistribute it and/or modify % # it under the terms of the LaTeX Project Public License, either % @@ -54,9 +54,9 @@ import os, sys, subprocess, argparse, lilyglyphs_common as lg def main(): """Main walk through the program""" - print 'rebuild-pdfs.py' - print 'regenerate all pdf images that are not present (anymore)' - print '' + print('rebuild-pdfs.py') + print('regenerate all pdf images that are not present (anymore)') + print('') # Check if we are in a legal CWD and ensure a PDF subdir is present check_paths() @@ -66,14 +66,14 @@ def main(): # is there anything to be done at all? if len(src_files) == 0: - print '' - print 'No image files missing, nothing to be done.' - print 'If you want to re-create pdfs, then delete them first' + print('') + print('No image files missing, nothing to be done.') + print('If you want to re-create pdfs, then delete them first') sys.exit(0) - print '' - print 'Found ' + str(len(src_files)) + ' missing file(s).' + print('') + print('Found ' + str(len(src_files)) + ' missing file(s).') for cmd in src_files: - print '- ' + cmd + print('- ' + cmd) # compile all LilyPond files without matching pdf lg.lily_files = src_files @@ -86,7 +86,7 @@ def check_missing_pdfs(): """Compares the list of LilyPond source and resulting PDF files. Returns a list of LilyPond source file basenames which don't have a corresponding PDF file""" - print 'Reading file lists, counting missing pdf files' + print('Reading file lists, counting missing pdf files') # read existing .pdf files in lg.dir_pdfs img_files = [] @@ -114,21 +114,21 @@ def check_paths(): """Checks if we're in the right CWD and makes sure that there is a pdf output directory available""" - print 'Checking directories ...' + print('Checking directories ...') # check the presence of the necessary subdirectories ls = os.listdir('.') if not 'generated_src' in ls: - print 'No LilyPond source files directory found.' - print 'Sorry, there is something wrong :-(' - print 'Current working directory is: ' + os.getcwd() - print 'Please consult the manual.' + print('No LilyPond source files directory found.') + print('Sorry, there is something wrong :-(') + print('Current working directory is: ' + os.getcwd()) + print('Please consult the manual.') sys.exit(2) if not 'pdfs' in ls: os.mkdir('pdfs') - print '... done' - print '' + print('... done') + print('') # #################################### diff --git a/Build/source/texk/texlive/linked_scripts/tlshell/tlshell.tcl b/Build/source/texk/texlive/linked_scripts/tlshell/tlshell.tcl index 0db1b8d86ac..6b363dbb884 100755 --- a/Build/source/texk/texlive/linked_scripts/tlshell/tlshell.tcl +++ b/Build/source/texk/texlive/linked_scripts/tlshell/tlshell.tcl @@ -905,17 +905,19 @@ proc get_packages_info_remote {} { unset -nocomplain ::loaded track_err + set catv "rcat-version" + if {[dict get $::pkgs texlive.infra localrev] < 56458} { set catv "cat-version" } if [catch {run_cmd \ - "info --data name,localrev,remoterev,cat-version,category,shortdesc"}] { + "info --data name,remoterev,$catv,category,shortdesc"}] { do_debug [get_stacktrace] tk_messageBox -message [__ "A configured repository is unavailable."] return 0 } vwait ::done_waiting set ::loaded 1 - set re {^([^,]+),([0-9]+),([0-9]+),([^,]*),([^,]*),(.*)$} + set re {^([^,]+),([0-9]+),([^,]*),([^,]*),(.*)$} foreach l $::out_log { - if [regexp $re $l m nm lrev rrev rcatv catg pdescr] { + if [regexp $re $l m nm rrev rcatv catg pdescr] { # double-quotes in short description: remove outer, unescape inner if {[string index $pdescr 0] eq "\""} { set pdescr [string range $pdescr 1 end-1] @@ -942,7 +944,9 @@ proc get_packages_info_remote {} { ## update ::pkgs after installing packages without going online again. proc update_local_revnumbers {} { do_debug "update_local_revnumbers" - run_cmd_waiting "info --only-installed --data name,localrev,cat-version" + set catv "lcat-version" + if {[dict get $::pkgs texlive.infra localrev] < 56458} { set catv "cat-version" } + run_cmd_waiting "info --only-installed --data name,localrev,$catv" set re {^([^,]+),([0-9]+),(.*)$} dict for {pk pk_dict} $::pkgs { do_debug "zeroing local data for $pk" @@ -955,6 +959,7 @@ proc update_local_revnumbers {} { set pk_dict [dict get $::pkgs $pk] dict set pk_dict "localrev" $lr dict set pk_dict "lcatv" $lv + dict set pk_dict "rcatv" $lv dict set ::pkgs $pk $pk_dict } } -- cgit v1.2.3