Improved lisp wrapper script generation.

* Added a per-node instead of a per-package init file that lies in
  $ROS_HOME/roslisp/<package>/<exec_name>-init.lisp

* Removed loading of the global ~/.sbclrc-ros init file.
This commit is contained in:
Lorenz Moesenlechner 2010-04-27 22:11:54 +00:00
parent ea8f28c2c6
commit 21be1b4021
1 changed files with 8 additions and 8 deletions

View File

@ -8,7 +8,8 @@
(let ((p (sb-ext:posix-getenv "ROS_ROOT")))
(unless p (error "ROS_ROOT not set"))
(let ((roslisp-path (merge-pathnames (make-pathname :directory '(:relative "asdf"))
(ros-load:ros-package-path "roslisp"))))
(ros-load:ros-package-path "roslisp")))
(output-filename (pathname (fifth sb-ext:*posix-argv*))))
(handler-case
(let ((ros-load:*current-ros-package* (second sb-ext:*posix-argv*)))
(asdf:operate 'asdf:compile-op (third sb-ext:*posix-argv*)))
@ -16,7 +17,7 @@
(format *error-output* "Compilation failed due to condition: ~a~&" e)
(sb-ext:quit :unix-status 1)))
(with-open-file (strm (fifth sb-ext:*posix-argv*) :if-exists :supersede :direction :output)
(with-open-file (strm output-filename :if-exists :supersede :direction :output)
(let ((*standard-output* strm))
(pprint '(require :asdf))
(pprint '(defmethod asdf:perform :around ((o asdf:load-op)
@ -28,7 +29,6 @@
(call-next-method)))))
(pprint '(push :roslisp-standalone-executable *features*))
(pprint '(declaim (sb-ext:muffle-conditions sb-ext:compiler-note)))
(pprint '(load (format nil "~a/.sbclrc-roslisp" (sb-ext:posix-getenv "HOME")) :if-does-not-exist nil))
(pprint `(push ,roslisp-path asdf:*central-registry*))
(pprint '(defun roslisp-debugger-hook (condition me)
(declare (ignore me))
@ -52,14 +52,14 @@
,(second sb-ext:*posix-argv*))
(let ((*standard-output* (make-broadcast-stream))
(sys ,(third sb-ext:*posix-argv*)))
(handler-case (asdf:operate 'asdf:load-op sys :verbose nil)
(handler-case (asdf:operate 'asdf:load-op sys :verbose nil)
(asdf:missing-component (c)
(error "Couldn't find asdf system (filename ~a.asd and system name ~a) or some dependency. Original condition was ~a."
sys sys c))))
(load (merge-pathnames (make-pathname :name ,(format nil "~a-init.lisp" (third sb-ext:*posix-argv*))
sys sys c))))
(load (merge-pathnames (make-pathname :name ,(format nil "~a-init.lisp" (pathname-name output-filename))
:directory '(:relative "roslisp" ,(second sb-ext:*posix-argv*)))
(funcall (symbol-function (intern "ROS-HOME" :ros-load))))
:if-does-not-exist nil)
(funcall (symbol-function (read-from-string ,(fourth sb-ext:*posix-argv*))))
(sb-ext:quit)))))))
(sb-ext:quit)
(sb-ext:quit))))))
(sb-ext:quit))