-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathsnow2-client-gambit.scm
52 lines (39 loc) · 1.38 KB
/
snow2-client-gambit.scm
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
#! /bin/sh
#| -*- scheme -*-
exec gsi $0 "$@"
|#
(import (scheme base) (scheme read) (scheme write) (scheme process-context))
(import (prefix (seth snow2-utils) snow2-))
(import (seth string-read-write) (seth srfi-27-random))
;; (scheme char) (scheme lazy)
;; (scheme inexact) (scheme complex) (scheme time)
;; (scheme file) (scheme eval) (scheme case-lambda)
;; (except (scheme r5rs) write) (srfi 64)
;; (chibi test)
(define (usage pargs)
(display (car pargs))
(display " ")
(display "<operation> '(library name)'")
(newline)
(display " <operation> can be \"install\" or \"uninstall\"")
(newline))
(define (main-program)
(random-source-randomize! default-random-source)
(let* ((repository-url
"http://snow2.s3-website-us-east-1.amazonaws.com/")
(repository (snow2-get-repository repository-url))
(pargs (command-line)))
(display "repository=")
(display repository)
(newline)
(cond ((not (= (length pargs) 3))
(usage pargs))
(else
(let ((operation (list-ref pargs 1))
(library-name (read-from-string (list-ref pargs 2))))
(cond ((equal? operation "install")
(snow2-install repository library-name))
((equal? operation "uninstall")
(snow2-uninstall repository library-name))
))))))
(main-program)