From dd6352451a8d831724fb919d66fd9900241769e1 Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Fri, 14 Dec 2007 12:57:21 +0100 Subject: Fix `convert-image' so that it does not copy several times. * src/guile/skribilo/utils/images.scm (builtin-convert-image): Add `~%'. (convert-image): Check `(file-exists? dest-path)' before invoking `copy-file'. This makes `distcheck' happy: a second `copy-file' would fail if the file was already copied and is marked read-only. --- src/guile/skribilo/utils/images.scm | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'src') diff --git a/src/guile/skribilo/utils/images.scm b/src/guile/skribilo/utils/images.scm index 6dcbda0..29535a3 100644 --- a/src/guile/skribilo/utils/images.scm +++ b/src/guile/skribilo/utils/images.scm @@ -1,7 +1,7 @@ ;;; images.scm -- Images handling utilities. ;;; +;;; Copyright 2005, 2006, 2007 Ludovic Courtès ;;; Copyright 2003, 2004 Erick Gallesio - I3S-CNRS/ESSI -;;; Copyright 2005, 2006 Ludovic Courtès ;;; ;;; ;;; This program is free software; you can redistribute it and/or modify @@ -59,9 +59,9 @@ from " " to)))) (cond ((> (*verbose*) 1) - (format (current-error-port) " [converting image: ~S (~S)]" from c)) + (format (current-error-port) " [converting image: ~S (~S)]~%" from c)) ((> (*verbose*) 0) - (format (current-error-port) " [converting image: ~S]" from))) + (format (current-error-port) " [converting image: ~S]~%" from))) (and (zero? (system c)) to)))))) @@ -78,8 +78,9 @@ (if dir (let* ((dest (basename path)) (dest-path (string-append dir "/" dest))) - (if (not (string=? path dest-path)) - (copy-file path dest-path)) + (if (and (not (string=? path dest-path)) + (not (file-exists? dest-path))) + (copy-file path dest-path)) dest) path)) (let loop ((fmts formats)) -- cgit v1.2.3