--- asdf-jar.lisp@14695 2015-11-24 10:29:22.000000000 +0000 +++ asdf-jar.lisp-jdp 2015-11-24 11:03:57.000000000 +0000 @@ -56,23 +56,26 @@ (format verbose "~&Packaging contents in ~A" package-jar)) (when (and verbose recursive dependencies) (format verbose "~& with recursive dependencies~{ ~A~^, ~}." dependencies)) + (flet ((set-mapping (from to) + (unless (string-equal (subseq (namestring from) 0 4) "jar:") + (setf (gethash from mapping) to)))) + (dolist (system (append (list system) (when recursive (mapcar #'asdf:find-system dependencies)))) (let ((base (slot-value system 'asdf::absolute-pathname)) (name (slot-value system 'asdf::name)) (asdf (slot-value system 'asdf::source-file))) - (setf (gethash asdf mapping) (let ((relative-path (archive-relative-path - base name asdf))) + (set-mapping asdf (let ((relative-path (archive-relative-path base name asdf))) (if root - (merge-pathnames - relative-path + (merge-pathnames relative-path (make-pathname :directory root)) relative-path))) (loop :for component :in (all-files system) :for source = (slot-value component 'asdf::absolute-pathname) :for source-entry = (archive-relative-path base name source) - :do (setf (gethash source mapping) + :when (stringp (pathname-type source)) + :do (set-mapping source (if root (merge-pathnames source-entry (make-pathname :directory root)) source-entry)) @@ -80,19 +83,19 @@ (format verbose "~&~A~& => ~A" source source-entry)) :when (and (typep component 'asdf::source-file) (not (typep component 'asdf::static-file))) - :do (let ((output - (make-pathname - :defaults (asdf:apply-output-translations source) + :do (let* ((output + (make-pathname :defaults (asdf:apply-output-translations source) :type "abcl")) + (directory (pathname-directory source-entry)) (output-entry (make-pathname :defaults source-entry :type "abcl" - :directory (append root - (rest (pathname-directory source-entry)))))) + :directory (if root + (append root (rest directory)) + directory)))) (when *debug* (format verbose "~&~A~& => ~A" output output-entry)) - (setf (gethash output mapping) - output-entry))))) + (set-mapping output output-entry)))))) (system:zip package-jar mapping))) (defun all-files (component)