SPAN to CSAN name change

This commit is contained in:
erana 2012-01-26 01:57:25 +09:00
parent 9d75ae6b1f
commit dc9c38885d
16 changed files with 166 additions and 166 deletions

1
scsh/CSAN/BLURB Normal file
View File

@ -0,0 +1 @@
CSAN : The Comprehensive Scheme Archive Network

View File

@ -26,7 +26,7 @@
;;; (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF ;;; (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
;;; THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ;;; THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
(define (SPAN-ask-server request hostname port) (define (CSAN-ask-server request hostname port)
(call-with-values (call-with-values
(lambda () (lambda ()
(socket-client hostname port)) (socket-client hostname port))

View File

@ -1,4 +1,4 @@
;;; SPAN-server-daemon-record.scm - records for SPAN server side ;;; CSAN-server-daemon-record.scm - records for CSAN server side
;;; ;;;
;;; Copyright (c) 2011-2012 Johan Ceuppens ;;; Copyright (c) 2011-2012 Johan Ceuppens
;;; ;;;
@ -26,17 +26,17 @@
;;; (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF ;;; (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
;;; THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ;;; THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
(define :SPAN-daemon-record (define :CSAN-daemon-record
(make-record-type 'SPAN-daemon-record (make-record-type 'CSAN-daemon-record
'(hostname port sock motd ack bye))) '(hostname port sock motd ack bye)))
(define make-SPAN-daemon-record (define make-CSAN-daemon-record
(record-constructor :SPAN-daemon-record (record-constructor :CSAN-daemon-record
'(hostname port sock motd ack bye))) '(hostname port sock motd ack bye)))
(define hostname (record-accessor :SPAN-daemon-record 'hostname)) (define hostname (record-accessor :CSAN-daemon-record 'hostname))
(define port (record-accessor :SPAN-daemon-record 'port)) (define port (record-accessor :CSAN-daemon-record 'port))
(define sock (record-accessor :SPAN-daemon-record 'sock)) (define sock (record-accessor :CSAN-daemon-record 'sock))
(define motd (record-accessor :SPAN-daemon-record 'motd)) (define motd (record-accessor :CSAN-daemon-record 'motd))
(define ack (record-accessor :SPAN-daemon-record 'ack)) (define ack (record-accessor :CSAN-daemon-record 'ack))
(define bye (record-accessor :SPAN-daemon-record 'bye)) (define bye (record-accessor :CSAN-daemon-record 'bye))

View File

@ -28,7 +28,7 @@
;; NOTE : files stored on this server are retrieved from its runtime directory ;; NOTE : files stored on this server are retrieved from its runtime directory
(load "SPAN-server-daemon-record.scm") (load "CSAN-server-daemon-record.scm")
(define (errormsg) (display " message not understood. ")) (define (errormsg) (display " message not understood. "))
(define (eoln) (string #\newline)) (define (eoln) (string #\newline))
@ -43,7 +43,7 @@
((eof-object? c)contents) ((eof-object? c)contents)
(set! contents (string-append contents (string c)))))) (set! contents (string-append contents (string c))))))
(define (run-daemon-child-SPAN rec) (define (run-daemon-child-CSAN rec)
(let ((*hostname (hostname rec)) (let ((*hostname (hostname rec))
(*port (port rec)) (*port (port rec))
(*socket (socket rec)) (*socket (socket rec))
@ -56,7 +56,7 @@
(set! *socket (open-socket *port)) (set! *socket (open-socket *port))
(for-each display '("Opening SPAN server side : listening on host : " (for-each display '("Opening CSAN server side : listening on host : "
*hostname *hostname
" port : " " port : "
*port *port
@ -97,9 +97,9 @@
"localhost" ;; virtual host "localhost" ;; virtual host
6969 6969
#f #f
"SPAN server side ready." "CSAN server side ready."
"Scheming..." "Scheming..."
"SPAN server signing off." "CSAN server signing off."
)) ))
(run-daemon-child-SPAN rc) (run-daemon-child-CSAN rc)

View File

@ -26,7 +26,7 @@
;;; (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF ;;; (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
;;; THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ;;; THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
(define (SPAN-tell-client request port-number sock) (define (CSAN-tell-client request port-number sock)
(call-with-values (call-with-values
(lambda () (lambda ()
(socket-accept sock)) (socket-accept sock))
@ -36,4 +36,4 @@
(let ((answer (make-string-input-port in))) ; returns any server response into some string (let ((answer (make-string-input-port in))) ; returns any server response into some string
(close-input-port in) (close-input-port in)
answer) answer)
))) )))

View File

@ -1,4 +1,4 @@
;;; SPAN-util.scm - Scheme Perl Archive Network utilities ;;; CSAN-util.scm - Compehensive Scheme Archive Network utilities
;;; ;;;
;;; Copyright (c) 2012 Johan Ceuppens ;;; Copyright (c) 2012 Johan Ceuppens
;;; ;;;
@ -37,15 +37,15 @@
(if (or (eq? s "http://")(eq? s "ftp://")) (if (or (eq? s "http://")(eq? s "ftp://"))
(set! s ""))))) (set! s "")))))
(define SPAN-generators (make-table)) (define CSAN-generators (make-table))
(table-set! SPAN-generators "helpfile" (lambda () (table-set! CSAN-generators "helpfile" (lambda ()
(display "Type in your helpfile : commands are 'get <filename-on-server>' and 'h'") (display "Type in your helpfile : commands are 'get <filename-on-server>' and 'h'")
(let ((*out (open-outputfile (string-append "/help")))) (let ((*out (open-outputfile (string-append "/help"))))
(do ((s (read)(read))) (do ((s (read)(read)))
((eof-object? s)0) ((eof-object? s)0)
(write s)(write " "))))) (write s)(write " ")))))
(define (SPAN-shell-spawn SPAN-dir mirror) (define (CSAN-shell-spawn CSAN-dir mirror)
(newline) (newline)
(display "span> ") (display "span> ")
(do ((s (read)(read))) (do ((s (read)(read)))
@ -57,18 +57,18 @@
0) 0)
((string=? "h" (symbol->string s)) ((string=? "h" (symbol->string s))
(display "Generating helpfile...")(newline) (display "Generating helpfile...")(newline)
(let ((*helpfilename (string-append SPAN-dir "/help"))) (let ((*helpfilename (string-append CSAN-dir "/help")))
(let ((*in (if (file-exists? *helpfilename) (let ((*in (if (file-exists? *helpfilename)
(open-input-file *helpfilename) (open-input-file *helpfilename)
(begin (begin
(display "no helpfile...") (display "no helpfile...")
((SPAN-generate "helpfile")))))) ((CSAN-generate "helpfile"))))))
(for-each write (read *in)))) (for-each write (read *in))))
0) 0)
((string<=? "get" (symbol->string s)) ((string<=? "get" (symbol->string s))
(display "enter package to fetch : ") (display "enter package to fetch : ")
(SPAN-ask-server (string-append "get " (symbol->string (read))) (CSAN-ask-server (string-append "get " (symbol->string (read)))
(url-bite-off mirror) 6969)) (url-bite-off mirror) 6969))
)) ))
)) ))
(display "span> signing off.")) (display "span> signing off."))

View File

@ -1,4 +1,4 @@
;;; SPAN.scm - Scheme Perl Archive Network ;;; CSAN.scm - Scheme Perl Archive Network
;;; ;;;
;;; Copyright (c) 2012 Johan Ceuppens ;;; Copyright (c) 2012 Johan Ceuppens
;;; ;;;
@ -28,7 +28,7 @@
;; FXIME refactor ;; FXIME refactor
(define (SPAN-question~ droptext question answer defaultchoice procedure) (define (CSAN-question~ droptext question answer defaultchoice procedure)
(let ((s "")) (let ((s ""))
(display droptext) (display droptext)
(newline) (newline)
@ -47,62 +47,62 @@
(set! answer (symbol->string s))) (set! answer (symbol->string s)))
((and (number? s)(string? (number->string s))) ((and (number? s)(string? (number->string s)))
(set! answer (number->string s))) (set! answer (number->string s)))
(else (SPAN-question~ droptext question answer defaultchoice))) (else (CSAN-question~ droptext question answer defaultchoice)))
procedure)) procedure))
(define SPAN-shell-droptext-1 (define CSAN-shell-droptext-1
"1. The following questions are intended to help you with the "1. The following questions are intended to help you with the
configuration. The SPAN module needs a directory of its own to cache configuration. The CSAN module needs a directory of its own to cache
important index files and maybe keep a temporary mirror of SPAN files. important index files and maybe keep a temporary mirror of CSAN files.
This may be a site-wide or a personal directory.") This may be a site-wide or a personal directory.")
(define SPAN-shell-droptext-2 (define CSAN-shell-droptext-2
"2. Unless you are accessing the CPAN on your filesystem via a file: URL, "2. Unless you are accessing the CSAN on your filesystem via a file: URL,
CPAN.pm needs to keep the source files it downloads somewhere. Please CSAN.pm needs to keep the source files it downloads somewhere. Please
supply a directory where the downloaded files are to be kept.") supply a directory where the downloaded files are to be kept.")
(define SPAN-shell-droptext-3 (define CSAN-shell-droptext-3
"3. ") "3. ")
(define SPAN-shell-droptext-4 (define CSAN-shell-droptext-4
"4. Normally CPAN.pm keeps config variables in memory and changes need to "4. Normally CSAN.pm keeps config variables in memory and changes need to
be saved in a separate 'o conf commit' command to make them permanent be saved in a separate 'o conf commit' command to make them permanent
between sessions. If you set the 'auto_commit' option to true, changes between sessions. If you set the 'auto_commit' option to true, changes
to a config variable are always automatically committed to disk.") to a config variable are always automatically committed to disk.")
(define SPAN-shell-droptext-5 (define CSAN-shell-droptext-5
"5. CPAN.pm can limit the size of the disk area for keeping the build "5. CSAN.pm can limit the size of the disk area for keeping the build
directories with all the intermediate files.") directories with all the intermediate files.")
(define SPAN-shell-droptext-6 (define CSAN-shell-droptext-6
"6. The CPAN indexes are usually rebuilt once or twice per hour, but the "6. The CSAN indexes are usually rebuilt once or twice per hour, but the
typical CPAN mirror mirrors only once or twice per day. Depending on typical CSAN mirror mirrors only once or twice per day. Depending on
the quality of your mirror and your desire to be on the bleeding edge, the quality of your mirror and your desire to be on the bleeding edge,
you may want to set the following value to more or less than one day you may want to set the following value to more or less than one day
(which is the default). It determines after how many days CPAN.pm (which is the default). It determines after how many days CSAN.pm
downloads new indexes.") downloads new indexes.")
(define SPAN-shell-droptext-7 (define CSAN-shell-droptext-7
"7. By default, each time the CPAN module is started, cache scanning is "7. By default, each time the CSAN module is started, cache scanning is
performed to keep the cache size in sync. To prevent this, answer performed to keep the cache size in sync. To prevent this, answer
'never'.") 'never'.")
(define SPAN-shell-droptext-8 (define CSAN-shell-droptext-8
"8. To considerably speed up the initial CPAN shell startup, it is "8. To considerably speed up the initial CSAN shell startup, it is
possible to use Storable to create a cache of metadata. If Storable is possible to use Storable to create a cache of metadata. If Storable is
not available, the normal index mechanism will be used. not available, the normal index mechanism will be used.
Note: this mechanism is not used when use_sqlite is on and SQLLite is Note: this mechanism is not used when use_sqlite is on and SQLLite is
running.") running.")
(define SPAN-shell-droptext-9 (define CSAN-shell-droptext-9
"9. The CPAN module can detect when a module which you are trying to build "9. The CSAN module can detect when a module which you are trying to build
depends on prerequisites. If this happens, it can build the depends on prerequisites. If this happens, it can build the
prerequisites for you automatically ('follow'), ask you for prerequisites for you automatically ('follow'), ask you for
confirmation ('ask'), or just ignore them ('ignore'). Please set your confirmation ('ask'), or just ignore them ('ignore'). Please set your
policy to one of the three values.") policy to one of the three values.")
;; (define SPAN-shell-droptext-10 ;;FIXME ;; (define CSAN-shell-droptext-10 ;;FIXME
;; "Every Makefile.PL is run by perl in a separate process. Likewise we ;; "Every Makefile.PL is run by perl in a separate process. Likewise we
;; run 'make' and 'make install' in separate processes. If you have ;; run 'make' and 'make install' in separate processes. If you have
;; any parameters (e.g. PREFIX, UNINST or the like) you want to ;; any parameters (e.g. PREFIX, UNINST or the like) you want to
@ -118,7 +118,7 @@ policy to one of the three values.")
;; Parameters for the 'perl Makefile.PL' command? [] ") ;; Parameters for the 'perl Makefile.PL' command? [] ")
;; (define SPAN-shell-droptext-11 ;;FIXME ;; (define CSAN-shell-droptext-11 ;;FIXME
;; "Typical frequently used settings: ;; "Typical frequently used settings:
;; PREFIX=~/perl # non-root users (please see manual for more hints) ;; PREFIX=~/perl # non-root users (please see manual for more hints)
@ -134,7 +134,7 @@ policy to one of the three values.")
;; Your choice: [] ") ;; Your choice: [] ")
;; (define SPAN-shell-droptext-12 ;;FIXME ;; (define CSAN-shell-droptext-12 ;;FIXME
;; "Parameters for the 'make install' command? ;; "Parameters for the 'make install' command?
;; Typical frequently used setting: ;; Typical frequently used setting:
@ -143,7 +143,7 @@ policy to one of the three values.")
;; <make_install_arg> ;; <make_install_arg>
;; Your choice: []" ;; Your choice: []"
;; (define SPAN-shell-droptext-13 ;;FIXME ;; (define CSAN-shell-droptext-13 ;;FIXME
;; "A Build.PL is run by perl in a separate process. Likewise we run ;; "A Build.PL is run by perl in a separate process. Likewise we run
;; './Build' and './Build install' in separate processes. If you have any ;; './Build' and './Build install' in separate processes. If you have any
;; parameters you want to pass to the calls, please specify them here. ;; parameters you want to pass to the calls, please specify them here.
@ -155,7 +155,7 @@ policy to one of the three values.")
;; <mbuildpl_arg> ;; <mbuildpl_arg>
;; Parameters for the 'perl Build.PL' command? [] ") ;; Parameters for the 'perl Build.PL' command? [] ")
;; (define SPAN-shell-droptext-14 ;;FIXME ;; (define CSAN-shell-droptext-14 ;;FIXME
;; "Parameters for the './Build' command? Setting might be: ;; "Parameters for the './Build' command? Setting might be:
;; --extra_linker_flags -L/usr/foo/lib # non-standard library location ;; --extra_linker_flags -L/usr/foo/lib # non-standard library location
@ -163,7 +163,7 @@ policy to one of the three values.")
;; <mbuild_arg> ;; <mbuild_arg>
;; Your choice: [] ") ;; Your choice: [] ")
;; (define SPAN-shell-droptext-15 ;;FIXME ;; (define CSAN-shell-droptext-15 ;;FIXME
;; "Do you want to use a different command for './Build install'? Sudo ;; "Do you want to use a different command for './Build install'? Sudo
;; users will probably prefer: ;; users will probably prefer:
@ -175,7 +175,7 @@ policy to one of the three values.")
;; <mbuild_install_build_command>") ;; <mbuild_install_build_command>")
;; (define SPAN-shell-droptext-16 ;;FIXME ;; (define CSAN-shell-droptext-16 ;;FIXME
;; "Parameters for the './Build install' command? Typical frequently used ;; "Parameters for the './Build install' command? Typical frequently used
;; setting: ;; setting:
@ -184,52 +184,52 @@ policy to one of the three values.")
;; <mbuild_install_arg> ;; <mbuild_install_arg>
;; Your choice: [] ") ;; Your choice: [] ")
;; (define SPAN-shell-droptext-17 ;;FIXME ;; (define CSAN-shell-droptext-17 ;;FIXME
;; "If you're accessing the net via proxies, you can specify them in the ;; "If you're accessing the net via proxies, you can specify them in the
;; CPAN configuration or via environment variables. The variable in ;; CSAN configuration or via environment variables. The variable in
;; the $CPAN::Config takes precedence. ;; the $CSAN::Config takes precedence.
;; <ftp_proxy> ;; <ftp_proxy>
;; Your ftp_proxy? []") ;; Your ftp_proxy? []")
;; (define SPAN-shell-droptext-18 ;;FIXME ;; (define CSAN-shell-droptext-18 ;;FIXME
;; " <http_proxy> ;; " <http_proxy>
;; Your http_proxy? []") ;; Your http_proxy? []")
;; (define SPAN-shell-droptext-19 ;;FIXME ;; (define CSAN-shell-droptext-19 ;;FIXME
;; "<no_proxy> ;; "<no_proxy>
;; Your no_proxy? []") ;; Your no_proxy? []")
(define SPAN-shell-droptext-20 (define CSAN-shell-droptext-20
"20. CPAN needs access to at least one CPAN mirror. "20. CSAN needs access to at least one CSAN mirror.
As you did not allow me to connect to the internet you need to supply As you did not allow me to connect to the internet you need to supply
a valid CPAN URL now. a valid CSAN URL now.
") ")
(define SPAN-shell-droptext-21 (define CSAN-shell-droptext-21
"21. Enter another URL or RETURN to quit: []") "21. Enter another URL or RETURN to quit: []")
(define SPAN-shell-droptext-22 (define CSAN-shell-droptext-22
"22. Please remember to call 'o conf commit' to make the config permanent! "22. Please remember to call 'o conf commit' to make the config permanent!
cpan shell -- CPAN exploration and modules installation (v1.9402) cpan shell -- CSAN exploration and modules installation (v1.9402)
Enter 'h' for help.") Enter 'h' for help.")
(define questions (make-table)) (define questions (make-table))
(table-set! questions 1 SPAN-shell-droptext-1) (table-set! questions 1 CSAN-shell-droptext-1)
(table-set! questions 2 SPAN-shell-droptext-2) (table-set! questions 2 CSAN-shell-droptext-2)
(table-set! questions 3 SPAN-shell-droptext-3) (table-set! questions 3 CSAN-shell-droptext-3)
(table-set! questions 4 SPAN-shell-droptext-4) (table-set! questions 4 CSAN-shell-droptext-4)
(table-set! questions 5 SPAN-shell-droptext-5) (table-set! questions 5 CSAN-shell-droptext-5)
(table-set! questions 6 SPAN-shell-droptext-6) (table-set! questions 6 CSAN-shell-droptext-6)
(table-set! questions 7 SPAN-shell-droptext-7) (table-set! questions 7 CSAN-shell-droptext-7)
(table-set! questions 8 SPAN-shell-droptext-8) (table-set! questions 8 CSAN-shell-droptext-8)
(table-set! questions 9 SPAN-shell-droptext-9) (table-set! questions 9 CSAN-shell-droptext-9)
(table-set! questions 20 SPAN-shell-droptext-20) (table-set! questions 20 CSAN-shell-droptext-20)
(table-set! questions 21 SPAN-shell-droptext-21) (table-set! questions 21 CSAN-shell-droptext-21)
(table-set! questions 22 SPAN-shell-droptext-22) (table-set! questions 22 CSAN-shell-droptext-22)
(define question? (define question?
(lambda (n) (lambda (n)
@ -237,113 +237,113 @@ Enter 'h' for help.")
(table-ref n))))) (table-ref n)))))
(define questionaire (define questionaire
(lambda (SPAN-dir) (lambda (CSAN-dir)
;; (fork-and-forget ;; (fork-and-forget
(define answer "") (define answer "")
(define SPAN-build-and-cache-dir SPAN-dir) (define CSAN-build-and-cache-dir CSAN-dir)
(define SPAN-download-target-dir SPAN-dir) (define CSAN-download-target-dir CSAN-dir)
(define SPAN-mirror-url (if (file-exists? (string-append SPAN-dir "/mirror")) (define CSAN-mirror-url (if (file-exists? (string-append CSAN-dir "/mirror"))
(read (string-append SPAN-dir "/mirror")) (read (string-append CSAN-dir "/mirror"))
"localhost")) "localhost"))
;; question 1 ;; question 1
;;((lambda () ;;((lambda ()
(cond (cond
((and (file-exists? SPAN-build-and-cache-dir) ((and (file-exists? CSAN-build-and-cache-dir)
(file-exists? (string-append SPAN-dir "/mirror"))) (file-exists? (string-append CSAN-dir "/mirror")))
(let ((SPAN-mirror-url (make-string-input-port (let ((CSAN-mirror-url (make-string-input-port
(open-input-file (string-append SPAN-build-and-cache-dir "/mirror"))))) (open-input-file (string-append CSAN-build-and-cache-dir "/mirror")))))
(SPAN-shell-spawn SPAN-dir SPAN-mirror-url))) (CSAN-shell-spawn CSAN-dir CSAN-mirror-url)))
(else (else
;;;;;;;;prototype (define (SPAN-question~ droptext question answer defaultchoice) ;;;;;;;;prototype (define (CSAN-question~ droptext question answer defaultchoice)
((SPAN-question~ (question? 1) ((CSAN-question~ (question? 1)
"SPAN build and cache directory" "CSAN build and cache directory"
"" ""
SPAN-build-and-cache-dir CSAN-build-and-cache-dir
(lambda (answer) (lambda (answer)
(let ((dir (create-directory answer))) (let ((dir (create-directory answer)))
(run (touch (string-append dir "/help"))) (run (touch (string-append dir "/help")))
(let ((out (open-output-file (string-append dir "/help")))) (let ((out (open-output-file (string-append dir "/help"))))
(write "Commands : 'h' and 'get <filename-on-server>")) (write "Commands : 'h' and 'get <filename-on-server>"))
(if (file-directory? dir) (if (file-directory? dir)
(set! SPAN-dir answer) (set! CSAN-dir answer)
(set! SPAN-build-and-cache-dir answer) (set! CSAN-build-and-cache-dir answer)
#f)))) answer) #f)))) answer)
(define SPAN-download-target-dir (string-append SPAN-build-and-cache-dir "/" "sources")) (define CSAN-download-target-dir (string-append CSAN-build-and-cache-dir "/" "sources"))
((SPAN-question~ (question? 2) ((CSAN-question~ (question? 2)
"Download target directory" "Download target directory"
"" ""
SPAN-download-target-dir CSAN-download-target-dir
(lambda (answer) (lambda (answer)
(let ((dir (create-directory answer))) (let ((dir (create-directory answer)))
(if (file-directory? answer) (if (file-directory? answer)
(set! SPAN-download-target-dir answer) (set! CSAN-download-target-dir answer)
#f)))) answer) #f)))) answer)
(define SPAN-build-dir (string-append SPAN-build-and-cache-dir "/" "build")) (define CSAN-build-dir (string-append CSAN-build-and-cache-dir "/" "build"))
((SPAN-question~ (question? 3) ((CSAN-question~ (question? 3)
"Directory where the build process takes place?" "Directory where the build process takes place?"
"" ""
SPAN-download-target-dir CSAN-download-target-dir
(lambda (answer) (lambda (answer)
(let ((dir (create-directory answer))) (let ((dir (create-directory answer)))
(if (file-directory? answer) (if (file-directory? answer)
(set! SPAN-build-dir answer) (set! CSAN-build-dir answer)
#f)))) answer) #f)))) answer)
(define SPAN-config "no") (define CSAN-config "no")
((SPAN-question~ (question? 4) ((CSAN-question~ (question? 4)
"Always commit changes to config variables to disk?" "Always commit changes to config variables to disk?"
"" ""
SPAN-config CSAN-config
(lambda (answer) (lambda (answer)
(set! SPAN-config answer) (set! CSAN-config answer)
#f)) answer) #f)) answer)
(define SPAN-build-Mb 100) (define CSAN-build-Mb 100)
((SPAN-question~ (question? 5) ((CSAN-question~ (question? 5)
"Cache size for build directory (in MB)?" "Cache size for build directory (in MB)?"
"" ""
SPAN-build-Mb CSAN-build-Mb
(lambda (answer) (lambda (answer)
(set! SPAN-build-Mb answer) (set! CSAN-build-Mb answer)
#f)) answer) #f)) answer)
(define SPAN-expire 1) (define CSAN-expire 1)
((SPAN-question~ (question? 6) ((CSAN-question~ (question? 6)
"Let the index expire after how many days?" "Let the index expire after how many days?"
"" ""
SPAN-expire CSAN-expire
(lambda (answer) (lambda (answer)
(set! SPAN-expire answer) (set! CSAN-expire answer)
#f)) answer) #f)) answer)
(define SPAN-scan-cache "atstart") (define CSAN-scan-cache "atstart")
((SPAN-question~ (question? 7) ((CSAN-question~ (question? 7)
"Perform cache scanning (atstart or never)?" "Perform cache scanning (atstart or never)?"
"" ""
SPAN-scan-cache CSAN-scan-cache
(lambda (answer) (lambda (answer)
(set! SPAN-scan-cache answer) (set! CSAN-scan-cache answer)
#f)) answer) #f)) answer)
(define SPAN-cache-metadata "yes") (define CSAN-cache-metadata "yes")
((SPAN-question~ (question? 8) ((CSAN-question~ (question? 8)
"Cache metadata (yes/no)?" "Cache metadata (yes/no)?"
"" ""
SPAN-cache-metadata CSAN-cache-metadata
(lambda (answer) (lambda (answer)
(set! SPAN-cache-metadata answer) (set! CSAN-cache-metadata answer)
#f)) answer) #f)) answer)
(define SPAN-policy-building "ask") (define CSAN-policy-building "ask")
((SPAN-question~ (question? 9) ((CSAN-question~ (question? 9)
"Policy on building prerequisites (follow, ask or ignore)? [ask]" "Policy on building prerequisites (follow, ask or ignore)? [ask]"
"" ""
SPAN-policy-building CSAN-policy-building
(lambda (answer) (lambda (answer)
(set! SPAN-policy-building answer) (set! CSAN-policy-building answer)
#f)) answer) #f)) answer)
;; question 10 is under dev ;; question 10 is under dev
@ -354,27 +354,27 @@ Enter 'h' for help.")
;; ... until 20 ;; ... until 20
((SPAN-question~ (question? 20) ((CSAN-question~ (question? 20)
"Please enter the URL of your CPAN mirror " "Please enter the URL of your CSAN mirror "
"" ""
SPAN-mirror-url CSAN-mirror-url
(lambda (answer) (lambda (answer)
(set! SPAN-mirror-url answer) (set! CSAN-mirror-url answer)
(run (touch (string-append SPAN-dir "/mirror"))) (run (touch (string-append CSAN-dir "/mirror")))
(let ((out (open-output-file (string-append SPAN-dir "/mirror")))) (let ((out (open-output-file (string-append CSAN-dir "/mirror"))))
(write answer out)) (write answer out))
#f)) answer) #f)) answer)
(define SPAN-mirror-url-2 "") (define CSAN-mirror-url-2 "")
((SPAN-question~ (question? 21) ((CSAN-question~ (question? 21)
"Enter another URL or RETURN to quit: [] " "Enter another URL or RETURN to quit: [] "
"" ""
SPAN-mirror-url-2 CSAN-mirror-url-2
(lambda (answer) (lambda (answer)
(set! SPAN-mirror-url-2 answer) (set! CSAN-mirror-url-2 answer)
#f)) answer) #f)) answer)
(display (question? 22)) (display (question? 22))
(SPAN-shell-spawn SPAN-dir SPAN-mirror-url)) (CSAN-shell-spawn CSAN-dir CSAN-mirror-url))
))) )))

View File

@ -1,4 +1,4 @@
;;; load.scm - a scheme SPAN ;;; load.scm - a scheme CSAN
;;; ;;;
;;; Copyright (c) 2012 Johan Ceuppens ;;; Copyright (c) 2012 Johan Ceuppens
;;; ;;;

View File

@ -1,4 +1,4 @@
;;; load.scm - a scheme SPAN ;;; load.scm - a scheme CSAN
;;; ;;;
;;; Copyright (c) 2012 Johan Ceuppens ;;; Copyright (c) 2012 Johan Ceuppens
;;; ;;;
@ -26,16 +26,16 @@
;;; (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF ;;; (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
;;; THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ;;; THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
(load "SPAN-util.scm") (load "CSAN-util.scm")
(load "SPAN.scm") (load "CSAN.scm")
(load "SPAN-client.scm") (load "CSAN-client.scm")
;; initialization ;; initialization
;; ;;
;; Commands: ;; Commands:
;; h : display help ;; h : display help
;; get <filename> : fetch file ;; get <filename> : fetch file
(define SPAN-dir (string-append (getenv "HOME") "/.span")) (define CSAN-dir (string-append (getenv "HOME") "/.span"))
(questionaire SPAN-dir) ;; this changes the SPAN-dir (questionaire CSAN-dir) ;; this changes the CSAN-dir
;; NOTE : after init of questionaire, you can spawn a shell: ;; NOTE : after init of questionaire, you can spawn a shell:
;; (SPAN-shell-spawn SPAN-dir (string-append SPAN-dir "/mirror")) ;; (CSAN-shell-spawn CSAN-dir (string-append CSAN-dir "/mirror"))

9
scsh/CSAN/packages.scm Normal file
View File

@ -0,0 +1,9 @@
(define-interface CSAN-interface
(export
CSAN-question~))
(define-structure CSAN
schemedoc-interface
(open scheme)
(files CSAN-client CSAN-server CSAN load CSAN-util))

View File

@ -1,4 +1,4 @@
(define-package "SPAN" (define-package "CSAN"
(0 1) (0 1)
((install-lib-version (1 3 0))) ((install-lib-version (1 3 0)))
(write-to-load-script (write-to-load-script
@ -9,10 +9,10 @@
(install-file "NEWS" 'doc) (install-file "NEWS" 'doc)
(install-string (COPYING) "COPYING" 'doc) (install-string (COPYING) "COPYING" 'doc)
(install-file "packages.scm" 'scheme) (install-file "packages.scm" 'scheme)
(install-file "SPAN-client.scm" 'scheme) (install-file "CSAN-client.scm" 'scheme)
(install-file "SPAN-server.scm" 'scheme) (install-file "CSAN-server.scm" 'scheme)
(install-file "SPAN-server-daemon.scm" 'scheme) (install-file "CSAN-server-daemon.scm" 'scheme)
(install-file "SPAN-server-daemon-record.scm" 'scheme) (install-file "CSAN-server-daemon-record.scm" 'scheme)
(install-file "SPAN-util.scm" 'scheme) (install-file "CSAN-util.scm" 'scheme)
(install-file "load.scm" 'scheme) (install-file "load.scm" 'scheme)
(install-file "SPAN.scm" 'scheme)) (install-file "CSAN.scm" 'scheme))

View File

@ -1 +0,0 @@
SPAN : Scheme Perl Archive Network

View File

@ -1,9 +0,0 @@
(define-interface SPAN-interface
(export
SPAN-question~))
(define-structure SPAN
schemedoc-interface
(open scheme)
(files SPAN-client SPAN-server SPAN load SPAN-util))