From 016e9fbb67d9d905e90f89bdcd200bd33f56b671 Mon Sep 17 00:00:00 2001 From: Francois-Rene Rideau <fare@tunes.org> Date: Tue, 16 Mar 2010 14:35:05 -0400 Subject: [PATCH] Make system-relative-pathname more useful by accepting the same string-as-pathname-specifiers as components. --- asdf.lisp | 15 +++++++-------- asdf.texinfo | 11 ++++++++--- 2 files changed, 15 insertions(+), 11 deletions(-) diff --git a/asdf.lisp b/asdf.lisp index de11e4ab..b1cf8a2a 100644 --- a/asdf.lisp +++ b/asdf.lisp @@ -147,7 +147,7 @@ :use '(:common-lisp :asdf-utilities) :unintern '(#:*asdf-revision* #:around #:asdf-method-combination #:split #:make-collector) :fmakunbound '(#:perform #:explain #:output-files #:operation-done-p - #:component-relative-pathname) + #:component-relative-pathname #:system-relative-pathname) :export '(#:defsystem #:oos #:operate #:find-system #:run-shell-command #:system-definition-pathname #:find-component ; miscellaneous @@ -2071,13 +2071,12 @@ output to `*verbose-out*`. Returns the shell's exit code." :directory (relativize-directory (pathname-directory p)) :defaults p))) -(defun system-relative-pathname (system pathname &key name type) - (let ((directory (pathname-directory pathname))) - (merge-pathnames* - (make-pathname :name (or name (pathname-name pathname)) - :type (or type (pathname-type pathname)) - :directory (relativize-directory directory)) - (system-source-directory system)))) +(defun system-relative-pathname (system name &key type) + (merge-pathnames* + (merge-component-name-type + :name name + :type type) + (system-source-directory system))) ;;; --------------------------------------------------------------------------- diff --git a/asdf.texinfo b/asdf.texinfo index 89478ebd..4b1a11c7 100644 --- a/asdf.texinfo +++ b/asdf.texinfo @@ -1803,7 +1803,6 @@ for the sake of keeping ASDF no more complex than strictly necessary. @section TODO @itemize -@item Integrate into the rest of the documentation. @item Add examples @item Add proper defaults. @item Get inspired by the XDG base directory specification? @@ -1821,7 +1820,7 @@ Thanks to Rommel Martinez for the initial implementation attempt. All bad design ideas and implementation bugs are to mine, not theirs. But so are good design ideas and elegant implementation tricks. - -- Francois-Rene Rideau @email{fare@@tunes.org}, Mon, 22 Feb 2010 00:07:33 -0500 + --- Francois-Rene Rideau @email{fare@@tunes.org}, Mon, 22 Feb 2010 00:07:33 -0500 @@ -2231,10 +2230,16 @@ It returns a pathname built from the location of the system's source file and the relative pathname. For example @lisp -> (asdf:system-relative-pathname 'cl-ppcre "regex.data") +> (asdf:system-relative-pathname 'cl-ppcre #p"regex.data") #P"/repository/other/cl-ppcre/regex.data" @end lisp +Instead of a pathname, you can provide a symbol or a string, +and optionally a keyword argument @code{type}. +The arguments will then be interpreted in the same way +as pathname specifiers for components. +@xref{The defsystem grammar,,Pathname specifiers}. + @end enumerate -- GitLab