From 7e9058dd2a9e7d0efe2e4fb67dcc93f4b8ce36bf Mon Sep 17 00:00:00 2001 From: Jan Nieuwenhuizen Date: Fri, 14 Aug 2009 11:48:11 +0200 Subject: [PATCH] Only delete intermediate file if it exists. Works around lilypond -o DIR. --- scm/backend-library.scm | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) 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 '()) -- 2.39.5