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 http://lsr.dsi.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 following script on a copy of the ‘all’ subdirectory:
    #!/bin/bash
    
    for LILYFILE in *.ly
    do
      STEM=$(basename "$LILYFILE" .ly)
      echo "running $LILYFILE..."
      convert-ly -e -t<version> "$LILYFILE" >& "$STEM".txt
    done
    
    grep refer *.txt
    grep smart *.txt
    TODO: better script
    
  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 http://lilypond.org/website/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 filenames. 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 all ‘.ly’ files in a directory and redirect terminal output to text files, which are then searched for the word "failed" to see which snippets do not compile.

 
#!/bin/bash

for LILYFILE in *.ly
do
  STEM=$(basename "$LILYFILE" .ly)
  echo "running $LILYFILE..."
  lilypond --format=png -ddelete-intermediate-files "$LILYFILE" >& "$STEM".txt
done

grep failed *.txt
TODO: better script

Sometimes grep failed *.txt will not discover all problematic files. In addition you may want to use:

grep ERROR *.txt
grep error *.txt
grep warning *.txt

LilyPond — Contributor’s Guide

inserted by FC2 system