From f2deaa09068338dbb59c5bf5f81569c09d528fdc Mon Sep 17 00:00:00 2001 From: Han-Wen Nienhuys Date: Mon, 22 Aug 2005 16:07:41 +0000 Subject: [PATCH] remove dir-re function. (make-ps-images): generate page names, instead of globbing them. This brings down LilyPond memory usage for make web by a factor 10. (backportme?) --- ChangeLog | 6 +++--- scm/ps-to-png.scm | 9 ++++----- 2 files changed, 7 insertions(+), 8 deletions(-) diff --git a/ChangeLog b/ChangeLog index 0296084058..cec3a6f1d7 100644 --- a/ChangeLog +++ b/ChangeLog @@ -3,12 +3,12 @@ * scm/ps-to-png.scm: remove dir-re function. (make-ps-images): generate page names, instead of globbing them. This brings down LilyPond memory usage for make web by a factor - 10. + 10. (backportme?) * scripts/lilypond-book.py (Lilypond_snippet.png_is_outdated): don't use glob. With 3000 files, globbing - Documentation/user/out-www/ can take too much time. - + Documentation/user/out-www/ can take too much time. (backportme?) + * lily/lily-guile.cc (gulp_file_to_string): take size argument. * lily/general-scheme.cc (LY_DEFINE): take optional size argument. diff --git a/scm/ps-to-png.scm b/scm/ps-to-png.scm index ee16349a83..ab0ac5d672 100644 --- a/scm/ps-to-png.scm +++ b/scm/ps-to-png.scm @@ -68,8 +68,7 @@ (status (system cmd)) (s (gulp-file d bbox 10240)) (m (string-match BOUNDING_BOX_RE s))) - (display m) - (newline) + (if m (list->vector (map (lambda (x) (string->number (car x))) (vector->list m))) @@ -100,7 +99,7 @@ (let* ((status 0) (percentage (* 100 (/ 1.0 factor))) (old (string-append file ".old"))) - + (rename-file file old) (my-system be-verbose #t @@ -173,7 +172,7 @@ (set! files (map (lambda (n) - (format "~a-page~a.png" base n)) + (format "~a-page~a.png" base (1+ n))) (iota page-count))) (list (format "~a.png" base))) @@ -181,7 +180,7 @@ (begin (map delete-file files) (exit 1))) - + (if (and rename-page-1? multi-page?) (begin (rename-file (re-sub "%d" "1" pngn) png1) -- 2.39.5