diff --git a/lisp/config.ros b/lisp/config.ros index e7d40c2..6b7ecf7 100644 --- a/lisp/config.ros +++ b/lisp/config.ros @@ -12,12 +12,15 @@ exec ros +R +Q -m roswell -N roswell -- $0 "$@" (in-package :ros.script.config.3668210854) (defun main (&rest argv) - (let* ((path (cond ((and (equal (first argv) "--env") - (roswell:opt "roswellenv")) - (setf argv (cdr argv)) - (merge-pathnames (format nil "env/~A/config" - (roswell:opt "roswellenv")) - (roswell:opt "homedir"))) + (let* ((path (cond ((equal (first argv) "--env") + (prog1 + (merge-pathnames (format nil "env/~A/config" + (or (roswell:opt "*roswellenv") + (third (assoc "roswellenv" + (load-config ".roswellenv") + :test 'equal)))) + (roswell:opt "homedir")) + (setf argv (cdr argv)))) ((equal (first argv) "--local") (setf argv (cdr argv)) ".roswellenv") diff --git a/lisp/install-quicklisp.lisp b/lisp/install-quicklisp.lisp index e2750b0..ddb1536 100644 --- a/lisp/install-quicklisp.lisp +++ b/lisp/install-quicklisp.lisp @@ -39,8 +39,13 @@ (sb-posix:setgid (parse-integer gid))) (let ((uid (sb-posix:getenv "SUDO_UID"))) (sb-posix:setuid (parse-integer uid)))) - (let ((archive (opt "download.archive")) - (path (opt "quicklisp"))) + (let*((archive (opt "download.archive")) + (env (opt "roswellenv")) + (path (if env + (merge-pathnames (format nil "env/~A/lisp/quicklisp/" env) (homedir)) + (opt "quicklisp")))) + (when env + (setf (config "quicklisp" :where env) env)) (quicklisp-patch path) (cond ((probe-file (merge-pathnames "setup.lisp" path)) @@ -57,7 +62,7 @@ ;; use roswell to download everithing. (setf (fdefinition (find-symbol (string :fetch) :qlqs-http)) (lambda (url file &key (follow-redirects t) quietly - (maximum-redirects 10)) + (maximum-redirects 10)) "Request URL and write the body of the response to FILE." (declare (ignorable url file follow-redirects quietly maximum-redirects)) diff --git a/lisp/util.lisp b/lisp/util.lisp index cdc082d..55fb5ee 100644 --- a/lisp/util.lisp +++ b/lisp/util.lisp @@ -142,11 +142,15 @@ Example: (defun (setf config) (val item &key where) "Interface to roswell C binary." (roswell:roswell - `("config" ,@(when where `(,(format nil "--~(~A~)" where))) - ,(if val "set" "unset") - ,item - ,@(when val `(,val))) - :string t) + `(,@(when (stringp where) + `("-N" ,where)) + "config" ,@(cond + ((stringp where) `("--env")) + (where `(,(format nil "--~(~A~)" where)))) + ,(if val "set" "unset") + ,item + ,@(when val `(,val))) + :string t) val) (defun chdir (dir &optional (verbose t)) diff --git a/src/register-commands.c b/src/register-commands.c index d4b869e..8881640 100644 --- a/src/register-commands.c +++ b/src/register-commands.c @@ -31,7 +31,10 @@ DEF_SUBCMD(opt_take1) { int argc=length(arg_); const char* arg=cmd->name; if(arg && argc>1) { - cond_printf(1,"take1:%s:%s\n",arg,firsts(nthcdr(1,arg_))); + char* current=get_opt(arg,0); + cond_printf(1,"take1:%s:%s,%s\n",arg,firsts(nthcdr(1,arg_)),current); + if(current) + set_opt(&local_opt,cat("*",arg,NULL),current); set_opt(&local_opt,arg,firsts(nthcdr(1,arg_))); return 2; }