7.7 Updating the LSR to a new version

To update the LSR, perform the following steps:

  1. Start by emailing the LSR maintainer, Sebastiano, and liaising with him to ensure that updating the snippets is synchronised with updating the binary running the LSR.
  2. Download the latest snippet tarball from https://lsr.di.unimi.it/download/ and extract it. The relevant files can be found in the all subdirectory. Make sure your shell is using an English language version, for example LANG=en_US, then run convert-ly on all the files. Use the command-line option --to=version to ensure the snippets are updated to the correct stable version.
  3. Make sure that you are using convert-ly from the latest available release to gain best advantage from the latest converting-rules-updates.

    For example:

    • LSR-version: 2.12.2
    • intended LSR-update to 2.14.2
    • latest release 2.15.30

    Use convert-ly from 2.15.30 and the following terminal command for all files:

    convert-ly -e -t2.14.2 *.ly
    
  4. There might be no conversion rule for some old commands. To make an initial check for possible problems you can run the script at the end of this list on a copy of the all subdirectory.
  5. Copy relevant snippets (i.e., snippets whose version is equal to or less than the new version of LilyPond running on the LSR) from Documentation/snippets/new/ into the set of files to be used to make the tarball. Make sure you only choose snippets which are already present in the LSR, since the LSR software isn’t able to create new snippets this way. If you don’t have a Git repository for LilyPond, you’ll find these snippets in the source-tarball on https://lilypond.org/development.html. Don’t rename any files at this stage.
  6. Verify that all files compile with the new version of LilyPond, ideally without any warnings or errors. To ease the process, you may use the shell script that appears after this list.

    Due to the workload involved, we do not require that you verify that all snippets produce the expected output. If you happen to notice any such snippets and can fix them, great; but as long as all snippets compile, don’t delay this step due to some weird output. If a snippet is not compiling, update it manually. If it’s not possible, delete it for now.

  7. Remove all headers and version-statements from the files. Phil Holmes has a python script that will do this and which needs testing. Please ask him for a copy if you wish to do this.
  8. Create a tarball and send it back to Sebastiano. Don’t forget to tell him about any deletions.
  9. Use the LSR web interface to change any descriptions you want to. Changing the titles of snippets is a bit fraught, since this also changes the file names. Only do this as a last resort.
  10. Use the LSR web interface to add the other snippets from Documentation/snippets/new/ which compile with the new LilyPond version of the LSR. Ensure that they are correctly tagged, including the tag docs and that they are approved.
  11. When LSR has been updated, wait a day for the tarball to update, then download another snippet tarball. Verify that the relevant snippets from Documentation/snippets/new/ are now included, then delete those snippets from Documentation/snippets/new/.
  12. Commit all the changes. Don’t forget to add new files to the git repository with git add. Run make, make doc and make test to ensure the changes don’t break the build. Any snippets that have had their file name changed or have been deleted could break the build, and these will need correcting step by step.

Below is a shell script to run LilyPond on all .ly files in a directory. If the script is run with a -s parameter, it runs silently except for reporting failed files. If run with -c it also runs convert-ly prior to running LilyPond.

#!/bin/bash

while getopts sc opt; do
    case $opt in
        s)
            silent=true
            ;;
        c)
            convert=true
            ;;
    esac
done
param=$ if [ $silent ]; then
    param=${param:3}
fi
if [ $convert ]; then
    param=${param:3}
fi
filter=${param:-"*.ly"}

for LILYFILE in $filter
do
    STEM=$(basename "$LILYFILE" .ly)
    if [ $convert ]; then
        if [ $silent ]; then
            $LILYPOND_BUILD_DIR/out/bin/convert-ly -e "$LILYFILE" >& "$STEM".con.txt
        else
            $LILYPOND_BUILD_DIR/out/bin/convert-ly -e "$LILYFILE"
        fi
    fi
    if [ ! $silent ]; then
        echo "running $LILYFILE..."
    fi
    $LILYPOND_BUILD_DIR/out/bin/lilypond --format=png "$LILYFILE" >& "$STEM".txt
    RetVal=$?
    if [ $RetVal -gt 0 ]; then
       echo "$LILYFILE failed"
    fi
done

Output from LilyPond is in filename.txt and convert-ly in filename.con.txt.


LilyPond Contributor’s Guide v2.25.22 (development-branch).