mirror of
https://github.com/roswell/roswell.git
synced 2026-09-10 07:16:17 -04:00
prepare for env swticher.
This commit is contained in:
parent
8066d9011b
commit
09a6e9d715
|
|
@ -34,7 +34,7 @@ exec ros -- $0 "$@"
|
|||
((and (equal (first params) "-o"))
|
||||
(format *error-output* "Missing the pathname for an image.~%"))
|
||||
(t (let ((path (merge-pathnames (format nil "~A.~A" (first params) (core-extention))
|
||||
(dump-dir (equal (first params) "roswell")))))
|
||||
(dump-dir (and (equal (first params) "roswell") "roswell")))))
|
||||
(%dump (ensure-directories-exist path) :normal))))))
|
||||
|
||||
(defun executable (func params)
|
||||
|
|
|
|||
|
|
@ -78,16 +78,16 @@ exec ros -Q -L sbcl-bin -- $0 "$@"
|
|||
(directory (merge-pathnames "cmds/*.ros" (homedir)))
|
||||
(directory (merge-pathnames "lisp/*.lisp" (homedir)))
|
||||
(directory (merge-pathnames "bin/*" (homedir))))) #'string< :key 'pathname-name))
|
||||
(use-env (equal dump "roswell")))
|
||||
(dump-dir (dump-dir (and (equal "roswell" dump) "roswell"))))
|
||||
(when (roswell:verbose)
|
||||
(format *error-output* "Targets for dump:~%~{~A~%~}~%" dir))
|
||||
(when (or (not (equal dump "roswell"))
|
||||
(roswell:verbose))
|
||||
(format *error-output* "building dump:~A~%" (make-pathname :defaults (dump-dir use-env) :name dump :type "core")))
|
||||
(format *error-output* "building dump:~A~%" (make-pathname :defaults dump-dir :name dump :type "core")))
|
||||
(force-output *error-output*)
|
||||
(unless (ignore-errors
|
||||
(when (> (file-write-date
|
||||
(make-pathname :defaults (dump-dir use-env) :name dump :type "core"))
|
||||
(make-pathname :defaults dump-dir :name dump :type "core"))
|
||||
(loop for i in dir
|
||||
maximize (file-write-date i)))
|
||||
(format *error-output* "up to date. stop~%")
|
||||
|
|
@ -98,5 +98,8 @@ exec ros -Q -L sbcl-bin -- $0 "$@"
|
|||
collect "--load "
|
||||
collect (format nil "~A " i))
|
||||
"dump output -f " ,dump)
|
||||
t nil))))
|
||||
t nil)))
|
||||
(when (equal dump "roswell")
|
||||
(ignore-errors
|
||||
(roswell:roswell '("init" "env" "roswell")))))
|
||||
;;; vim: set ft=lisp lisp:
|
||||
|
|
|
|||
|
|
@ -31,12 +31,12 @@ The default value contains the minimal blacklist.")
|
|||
These are appended to the blacklist before destroying the package system.
|
||||
Notably, it must include all nicknames.")
|
||||
|
||||
(defun dump-dir (use-env)
|
||||
(defun dump-dir (&optional env)
|
||||
(merge-pathnames (format nil "~Aimpls/~A/~A/~A/dump/"
|
||||
(if (and (not use-env)
|
||||
(opt "roswellenv"))
|
||||
(format nil "env/~A/" (opt "roswellenv"))
|
||||
"")
|
||||
(let ((env (or env (opt "roswellenv"))))
|
||||
(if env
|
||||
(format nil "env/~A/" env)
|
||||
""))
|
||||
(uname-m) (uname) (opt "impl"))
|
||||
(homedir)))
|
||||
|
||||
|
|
|
|||
|
|
@ -125,16 +125,15 @@ void star_set_opt(void) {
|
|||
char* config=configdir();
|
||||
char*lisp=get_opt("lisp",1);
|
||||
char*image=get_opt("image",0);
|
||||
if(!image ||
|
||||
strcmp("roswell",image)!=0) {
|
||||
if(!get_opt(PACKAGE_NAME"env",0))
|
||||
set_env_opt("."PACKAGE_NAME"env");
|
||||
/*If 'roswellenv' not set the below would endup fail to open cause it will be taken as a directory.*/
|
||||
set_env_opt(s_escape_string(cat(configdir(),"env",SLASH,get_opt(PACKAGE_NAME"env",1),SLASH,"config",NULL)));
|
||||
}
|
||||
/*If 'roswellenv' not set the below would endup fail to open cause it will be taken as a directory.*/
|
||||
set_env_opt(s_escape_string(cat(configdir(),"env",SLASH,get_opt(PACKAGE_NAME"env",1),SLASH,"config",NULL)));
|
||||
|
||||
lisp=lisp?lisp:get_opt("*lisp",0);
|
||||
set_opt(&local_opt,"impl",determin_impl(lisp));
|
||||
if(!get_opt("quicklisp",0))
|
||||
set_opt(&local_opt,"quicklisp",s_escape_string(cat(basedir(),"lisp",SLASH,"quicklisp",SLASH,NULL)));
|
||||
set_opt(&local_opt,"quicklisp",s_escape_string(cat(config,"lisp",SLASH,"quicklisp",SLASH,NULL)));
|
||||
set_opt(&local_opt,"argv0",argv_orig[0]);
|
||||
set_opt(&local_opt,"wargv0",which(argv_orig[0]));
|
||||
set_opt(&local_opt,"homedir",q(config));
|
||||
|
|
|
|||
Loading…
Reference in a new issue