SPAN - span shell fixes

This commit is contained in:
erana 2012-01-18 18:20:07 +09:00
parent 8bed36a2d8
commit 2404ef828d
3 changed files with 15 additions and 7 deletions

View File

@ -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."))
(display "span> signing off."))

View File

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

View File

@ -35,5 +35,7 @@
;; Commands:
;; h : display help
;; get : fetch file
(questionaire)
(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"))