Skip to content

Commit

Permalink
Backport: Compute truenames of commandline-supplied files in src/comm…
Browse files Browse the repository at this point in the history
…ands/functions-input.lisp

Otherwise `recipe-name' may not work.

* src/commands/functions-input.lisp (collect-inputs): for existing
  files, return the `truename'
* src/model/project/concrete-syntax/recipe-repository.lisp
  (recipe-name recipe-repository t pathname): assert that the recipe
  path is an absolute pathname

(cherry picked from commit 2395e48)
  • Loading branch information
scymtym committed Jul 1, 2019
1 parent 737e9e8 commit d442910
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/commands/functions-input.lisp
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,11 @@
((wild-pathname-p spec)
(directory spec))
((pathnamep spec)
(unless (probe-file spec)
(if-let ((truename (probe-file spec)))
(list truename)
(project::object-error
(list (list spec "included here" :error))
"~@<File does not exist: ~A.~@:>" spec))
(list spec))
"~@<File does not exist: ~A.~@:>" spec)))
(t
(error "~@<Invalid input specification: ~S.~@:>" spec))))

Expand Down
1 change: 1 addition & 0 deletions src/model/project/concrete-syntax/recipe-repository.lisp
Original file line number Diff line number Diff line change
Expand Up @@ -209,6 +209,7 @@
(defmethod recipe-name ((repository recipe-repository)
(kind t)
(path pathname))
(assert (uiop:absolute-pathname-p path))
(let ((directory (recipe-directory kind repository))
(without-type (make-pathname :type nil :defaults path)))
(when (uiop:subpathp without-type directory)
Expand Down

0 comments on commit d442910

Please sign in to comment.