From ff0d4cb4d68eb1099de9a3357a6a6e0b7d73d5ec Mon Sep 17 00:00:00 2001 From: SANO Masatoshi Date: Sun, 11 Dec 2016 17:36:38 +0900 Subject: [PATCH] introduce module --- lisp/util-install.lisp | 6 +----- lisp/util-run.lisp | 5 +---- lisp/util.lisp | 9 ++++++++- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/lisp/util-install.lisp b/lisp/util-install.lisp index b4a94b6..6f7ce3b 100644 --- a/lisp/util-install.lisp +++ b/lisp/util-install.lisp @@ -24,11 +24,7 @@ ARGV2 contains a (possibly modified) ARGV.") (defvar *checkout-default* 'checkout-github) (defun probe-impl (impl) - (or (ignore-errors - (let ((imp (format nil "roswell.install.~A" impl))) - (and (or (read-call "ql-dist:find-system" imp) - (read-call "ql:where-is-system" imp)) - (read-call "ql:quickload" imp :silent t)))) + (or (module "install" impl) (and ;; before setup quicklisp (find impl '("sbcl-bin" "quicklisp") :test 'equal) (load (make-pathname :name (format nil "install-~A" impl) :type "lisp" :defaults *load-pathname*))))) diff --git a/lisp/util-run.lisp b/lisp/util-run.lisp index 24d796e..8dbbdfa 100644 --- a/lisp/util-run.lisp +++ b/lisp/util-run.lisp @@ -8,7 +8,4 @@ (defun probe-run-script (impl) (ignore-errors (quicklisp-client:register-local-projects) - (let ((imp (format nil "roswell.run.~A" impl))) - (and (or (ql-dist:find-system imp) - (ql:where-is-system imp)) - (ql:quickload imp :silent t))))) + (module "run" impl))) diff --git a/lisp/util.lisp b/lisp/util.lisp index d064aa2..ed4b6b6 100644 --- a/lisp/util.lisp +++ b/lisp/util.lisp @@ -6,7 +6,7 @@ (:use :cl) (:import-from :ros :opt) (:export :uname :uname-m :homedir :config :use :impl :which :list% - :parse-version-spec :download :expand :sh :chdir :system + :parse-version-spec :download :expand :sh :chdir :system :module :core-extention :clone-github :opt :read-call :set-opt :copy-dir)) (in-package :ros.util) @@ -30,6 +30,13 @@ (merge-pathnames l path) (ensure-directories-exist (merge-pathnames l to))))))) +(defun module (prefix name) + (ignore-errors + (let ((imp (format nil "roswell.~A.~A" prefix impl))) + (and (or (read-call "ql-dist:find-system" imp) + (read-call "ql:where-is-system" imp)) + (read-call "ql:quickload" imp :silent t))))) + (defun set-opt (item val) (let ((found (assoc item (ros::ros-opts) :test 'equal))) (if found