From: hanwen <hanwen>
Date: Mon, 22 Aug 2005 16:07:41 +0000 (+0000)
Subject: remove dir-re function.
X-Git-Tag: release/2.6.4~17^2~7
X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=8a1a79bc788191fe8fbc3bbb1f3c1b81c884bb17;p=lilypond.git

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?)
---

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)