From: Jan Nieuwenhuizen Date: Fri, 14 Aug 2009 09:48:11 +0000 (+0200) Subject: Only delete intermediate file if it exists. Works around lilypond -o DIR. X-Git-Tag: release/2.13.4-1~179^2~70 X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=7e9058dd2a9e7d0efe2e4fb67dcc93f4b8ce36bf;p=lilypond.git Only delete intermediate file if it exists. Works around lilypond -o DIR. --- diff --git a/scm/backend-library.scm b/scm/backend-library.scm index 9fa094f518..3a4ccab817 100644 --- a/scm/backend-library.scm +++ b/scm/backend-library.scm @@ -140,15 +140,15 @@ (define-public (postprocess-output paper-book module filename formats) (let* ((completed (completize-formats formats)) - (base (string-regexp-substitute "\\.[a-z]+$" "" filename)) + (base (dir-basename filename ".ps" ".eps")) (intermediate (remove (lambda (x) (member x formats)) completed))) - (for-each (lambda (f) ((eval (string->symbol (format "convert-to-~a" f)) module) paper-book filename)) completed) (if (ly:get-option 'delete-intermediate-files) (for-each (lambda (f) - (delete-file (string-append base "." f))) intermediate)))) + (if (file-exists? f) (delete-file f))) + (map (lambda (x) (string-append base "." x)) intermediate))))) (define-public (completize-formats formats) (define new-fmts '())