-
Notifications
You must be signed in to change notification settings - Fork 12
/
Copy pathconfigure.cl
34 lines (31 loc) · 1.02 KB
/
configure.cl
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
(in-package :user)
(defparameter *configfile* nil)
(defun read-nfs-cfg (configfile)
(let ((host-lists (make-hash-table :test #'equalp))
(user-lists (make-hash-table :test #'equalp))
config cmd name)
(prepare-exports)
(setf config (read-from-string (file-contents configfile)))
(dolist (entry config)
(when (not (listp entry))
(error "Invalid configuration entry: ~S~%" entry))
(setf cmd (pop entry))
(case cmd
(define-host-list
(setf name (pop entry))
(let ((res '()) temp)
(dolist (thing entry)
(if* (setq temp (ignore-errors (parse-addr thing)))
then (push temp res)
else (logit "Warning: could not resolve host ~s~%" thing)))
(setf (gethash name host-lists) res)))
(define-user-list
(setf name (pop entry))
(setf (gethash name user-lists) entry))
(define-export
(setf entry (append entry (list :host-lists host-lists
:user-lists user-lists)))
(apply #'define-export entry))
(t
(set cmd (pop entry)))))
(finalize-exports)))