summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'dev-scheme/gauche/files/gauche-0.9.1-bzip2-info.diff')
-rw-r--r--dev-scheme/gauche/files/gauche-0.9.1-bzip2-info.diff66
1 files changed, 66 insertions, 0 deletions
diff --git a/dev-scheme/gauche/files/gauche-0.9.1-bzip2-info.diff b/dev-scheme/gauche/files/gauche-0.9.1-bzip2-info.diff
new file mode 100644
index 000000000000..5cfe8d8264d0
--- /dev/null
+++ b/dev-scheme/gauche/files/gauche-0.9.1-bzip2-info.diff
@@ -0,0 +1,66 @@
+From 49401e54747a1eb3e6d0ad684b01fb289f4fcce0 Mon Sep 17 00:00:00 2001
+From: Shiro Kawai <shiro@acm.org>
+Date: Fri, 18 Feb 2011 23:28:47 +0000
+Subject: support bzip2-ed info
+
+
+diff --git a/lib/gauche/interactive/info.scm b/lib/gauche/interactive/info.scm
+index fa27a5a..926473c 100644
+--- a/lib/gauche/interactive/info.scm
++++ b/lib/gauche/interactive/info.scm
+@@ -83,7 +83,8 @@
+ :paths paths
+ :pred (lambda (p)
+ (or (file-is-readable? p)
+- (file-is-readable? #`",|p|.gz"))))
++ (file-is-readable? #`",|p|.gz")
++ (file-is-readable? #`",|p|.bz2"))))
+ (errorf "couldn't find info file ~s in paths: ~s" *info-file* paths))
+ ))
+
+diff --git a/lib/text/info.scm b/lib/text/info.scm
+index 4fdc8f5..b433d66 100644
+--- a/lib/text/info.scm
++++ b/lib/text/info.scm
+@@ -62,25 +62,27 @@
+
+ ;; Find gunzip location
+ (define gunzip (find-file-in-paths "gunzip"))
++(define bzip2 (find-file-in-paths "bzip2"))
+
+ ;; Read an info file FILE, and returns a list of strings splitted by ^_ (#\x1f)
+-;; If FILE is not found, look for gzipped one (FILE.gz) and decompress it.
++;; If FILE is not found, look for compressed one.
+ (define (read-info-file-split file opts)
+ (define (with-input-from-info thunk)
+- (cond ((file-exists? file)
+- (with-input-from-file file thunk))
+- ((file-exists? #`",|file|.gz")
+- (with-input-from-process #`",gunzip -c ,file" thunk))
+- (else
+- (error "can't find info file" file))))
++ (cond [(file-exists? file)
++ (with-input-from-file file thunk)]
++ [(and gunzip (file-exists? #`",|file|.gz"))
++ (with-input-from-process #`",gunzip -c ,file" thunk)]
++ [(and bzip2 (file-exists? #`",|file|.bz2"))
++ (with-input-from-process #`",bzip2 -c -d ,|file|.bz2" thunk)]
++ [else (error "can't find info file" file)]))
+ (with-input-from-info
+ (lambda ()
+- (let loop ((c (skip-while (char-set-complement #[\x1f])))
+- (r '()))
++ (let loop ([c (skip-while (char-set-complement #[\x1f]))]
++ [r '()])
+ (if (eof-object? c)
+ (reverse! r)
+- (let* ((head (next-token #[\x1f\n] '(#[\x1f\n] *eof*)))
+- (body (next-token #[\n] '(#[\x1f] *eof*))))
++ (let* ([head (next-token #[\x1f\n] '(#[\x1f\n] *eof*))]
++ [body (next-token #[\n] '(#[\x1f] *eof*))])
+ (loop (read-char) (acons head body r)))))))
+ )
+
+--
+1.7.3.4
+