From 7d663dd316e5ba366d9e2facac5fd5ec22d4f7e7 Mon Sep 17 00:00:00 2001 From: Alex Shinn Date: Wed, 11 Jun 2014 22:27:33 +0900 Subject: [PATCH] Fixing some missing imports. --- lib/chibi/snow/commands.scm | 15 ++++++++++----- lib/chibi/snow/commands.sld | 1 + 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/lib/chibi/snow/commands.scm b/lib/chibi/snow/commands.scm index 4bfc23df..b21a0d4e 100644 --- a/lib/chibi/snow/commands.scm +++ b/lib/chibi/snow/commands.scm @@ -37,6 +37,11 @@ (define (conf-for-implementation cfg impl) (conf-specialize cfg 'implementation impl)) +(define (call-with-output-string proc) + (let ((out (open-output-string))) + (proc out) + (get-output-string out))) + (define (write-to-string x) (call-with-output-string (lambda (out) (write x out)))) @@ -116,10 +121,10 @@ (equal? "." (path-directory (path-directory x))))) (tar-files unzipped-file)))) (and package-file - (guard (exn (else (print-exception exn) #f)) + (guard (exn (else #f)) (let* ((str (utf8->string (tar-extract-file unzipped-file package-file))) - (package (call-with-input-string str read))) + (package (read (open-input-string str)))) (and (pair? package) (eq? 'package (car package)) package))))))) @@ -219,7 +224,7 @@ (let lp ((ls (if version (append (cadr name) (list version)) (cadr name))) (res '())) (if (null? ls) - (string-concatenate (reverse (cons ".tgz" res))) + (string-join (reverse (cons ".tgz" res))) (lp (cdr ls) (cons (x->string (car ls)) (if (null? res) res (cons "-" res)))))))))) @@ -663,7 +668,7 @@ (repo-uri (remote-uri cfg "/s/repo.scm")) (repo-str (call-with-input-url repo-uri port->string)) (repo (guard (exn (else #f)) - (let ((repo (call-with-input-string repo-str read))) + (let ((repo (read (open-input-string repo-str)))) `(,(car repo) (url ,repo-uri) ,@(cdr repo)))))) (cond ((not (valid-repository? repo)) @@ -725,7 +730,7 @@ (process->sexp `(guile -c ,(write-to-string `(write ,expr)))))) (case impl ((chibi) - (let* ((dirs (reverse (current-module-path))) + (let* ((dirs (reverse (fast-eval '(current-module-path) '((chibi))))) (share-dir (find (lambda (d) (string-contains d "/share/")) dirs))) (if share-dir (cons share-dir (delete share-dir dirs)) diff --git a/lib/chibi/snow/commands.sld b/lib/chibi/snow/commands.sld index 6496a3eb..6e6d687a 100644 --- a/lib/chibi/snow/commands.sld +++ b/lib/chibi/snow/commands.sld @@ -18,6 +18,7 @@ (scheme file) (scheme process-context) (scheme time) + (scheme read) (scheme write) (srfi 1) (srfi 27)