From 0ad4ffb0c9d7a5b81a728ea9b3b3efa0699befa7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hugo=20H=C3=B6rnquist?= Date: Mon, 11 Apr 2022 19:17:34 +0200 Subject: Remove config sandbox. Old sandbox approach always felt like bit of a hack. --- module/calp/config-base.scm | 16 ++++++++++++++++ module/calp/main.scm | 22 +--------------------- 2 files changed, 17 insertions(+), 21 deletions(-) create mode 100644 module/calp/config-base.scm (limited to 'module/calp') 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 ical.

") ;; 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: -- cgit v1.2.3