From 2404ef828d757abc473c9e818597b27eae657cc0 Mon Sep 17 00:00:00 2001 From: erana Date: Wed, 18 Jan 2012 18:20:07 +0900 Subject: [PATCH] SPAN - span shell fixes --- scsh/SPAN/SPAN-util.scm | 6 +++++- scsh/SPAN/SPAN.scm | 10 ++++++---- scsh/SPAN/load.scm | 6 ++++-- 3 files changed, 15 insertions(+), 7 deletions(-) diff --git a/scsh/SPAN/SPAN-util.scm b/scsh/SPAN/SPAN-util.scm index 576ad65..9be2a10 100644 --- a/scsh/SPAN/SPAN-util.scm +++ b/scsh/SPAN/SPAN-util.scm @@ -38,8 +38,12 @@ (set! s ""))))) (define (SPAN-shell-spawn mirror) + (newline) + (display "span> ") (do ((s (read)(read))) ((null? s)0) + (newline) + (display "span> ") (cond ((symbol? s) (cond ((string<=? (symbol->string s)(string #\return)) 0) @@ -52,4 +56,4 @@ (url-bite-off mirror) 6969)) )) )) - (display "Signing off.")) \ No newline at end of file + (display "span> signing off.")) \ No newline at end of file diff --git a/scsh/SPAN/SPAN.scm b/scsh/SPAN/SPAN.scm index b08369f..fdd1247 100644 --- a/scsh/SPAN/SPAN.scm +++ b/scsh/SPAN/SPAN.scm @@ -218,16 +218,17 @@ cpan shell -- CPAN exploration and modules installation (v1.9402) Enter 'h' for help.") + (define questionaire - (lambda () + (lambda (SPAN-dir) (define answer "") - (define SPAN-build-and-cache-dir (string-append (getenv "HOME") "/.span")) - (define SPAN-download-target-dir (string-append (getenv "HOME") "/.span")) + (define SPAN-build-and-cache-dir SPAN-dir) + (define SPAN-download-target-dir SPAN-dir) (define SPAN-mirror-url "localhost") ;; question 1 (cond ((and (file-exists? SPAN-build-and-cache-dir) - (file-exists? (string-append SPAN-build-and-cache-dir "/mirror"))) + (file-exists? (string-append SPAN-dir "/mirror"))) (let ((SPAN-mirror-url (make-string-input-port (open-input-file (string-append SPAN-build-and-cache-dir "/mirror"))))) (SPAN-shell-spawn SPAN-mirror-url))) @@ -240,6 +241,7 @@ Enter 'h' for help.") (lambda (answer) (let ((dir (create-directory answer))) (if (file-directory? dir) + (set! SPAN-dir answer) (set! SPAN-build-and-cache-dir answer) #f)))) answer) diff --git a/scsh/SPAN/load.scm b/scsh/SPAN/load.scm index 15e32ba..ff60587 100644 --- a/scsh/SPAN/load.scm +++ b/scsh/SPAN/load.scm @@ -35,5 +35,7 @@ ;; Commands: ;; h : display help ;; get : fetch file - -(questionaire) \ No newline at end of file +(define SPAN-dir (string-append (getenv "HOME") "/.span")) +(questionaire SPAN-dir) ;; this changes the SPAN-dir +;; NOTE : after init of questionaire, you can spawn a shell: +;; (SPAN-shell-spawn (string-append SPAN-dir "/mirror")) \ No newline at end of file