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.12.3-1~3 X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=43600104d4f9a82f744e9bc4da8d4a0cb69047f9;p=lilypond.git Only delete intermediate file if it exists. Works around lilypond -o DIR. (cherry picked from commit 72f03ab0b0d29d52da9f59a7db347519752278e5) --- diff --git a/scm/backend-library.scm b/scm/backend-library.scm index 301868cb84..ca1a16b7f6 100644 --- a/scm/backend-library.scm +++ b/scm/backend-library.scm @@ -139,15 +139,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 '())