aboutsummaryrefslogtreecommitdiff
path: root/module
diff options
context:
space:
mode:
authorHugo Hörnquist <hugo@lysator.liu.se>2022-04-11 19:17:34 +0200
committerHugo Hörnquist <hugo@lysator.liu.se>2022-04-11 19:17:34 +0200
commit0ad4ffb0c9d7a5b81a728ea9b3b3efa0699befa7 (patch)
treee414db90bc70f62cd31ec8582cd0975d1cfec2ed /module
parentRewrote script get-config. (diff)
downloadcalp-0ad4ffb0c9d7a5b81a728ea9b3b3efa0699befa7.tar.gz
calp-0ad4ffb0c9d7a5b81a728ea9b3b3efa0699befa7.tar.xz
Remove config sandbox.
Old sandbox approach always felt like bit of a hack.
Diffstat (limited to 'module')
-rw-r--r--module/calp/config-base.scm16
-rw-r--r--module/calp/main.scm22
2 files changed, 17 insertions, 21 deletions
diff --git a/module/calp/config-base.scm b/module/calp/config-base.scm
new file mode 100644
index 00000000..cdd810de
--- /dev/null
+++ b/module/calp/config-base.scm
@@ -0,0 +1,16 @@
+;;; Commentary:
+;; Module intended to be included by user config, which exports some base
+;; bindings basically everyone should want.
+;;; Code:
+
+(define-module (calp config-base))
+
+(define cm (module-public-interface (current-module)))
+(for-each (lambda (name) (module-use! cm (resolve-interface name)))
+ `((ice-9 regex)
+ (srfi srfi-1)
+ (srfi srfi-88)
+ (datetime)
+ (vcomponent)
+ (glob)
+ ))
diff --git a/module/calp/main.scm b/module/calp/main.scm
index 9b3676dd..8efaf5ae 100644
--- a/module/calp/main.scm
+++ b/module/calp/main.scm
@@ -138,27 +138,7 @@ the same code as <b>ical</b>.</p>")
;; assumed to be "safe". Instead it's so we can control the environment in
;; which it is executed.
(catch #t
- (lambda ()
- (eval
- `(begin
- (use-modules (srfi srfi-1)
- (srfi srfi-88)
- (datetime)
- (vcomponent)
- (calp util config)
- (glob))
- ,@(with-input-from-file config-file
- (lambda ()
- (let loop ((done '()))
- (let ((form (read)))
- (if (eof-object? form)
- (reverse done)
- (loop (cons form done))))))))
- (make-sandbox-module
- `(((guile) use-modules resolve-interface module-ref)
- ,@all-pure-and-impure-bindings
- ))
- ))
+ (lambda () (load config-file))
(lambda args
(format (current-error-port)
;; Two arguments: