Commit b5a78bcb authored by Francois-Rene Rideau's avatar Francois-Rene Rideau
Browse files

Better document parameter passing between make and asdf-tools

Count (values) as returning code 0 (success) for main.
parent 2fd31ee0
......@@ -38,8 +38,26 @@ Makefile:
### Default fall back rule: delegate to asdf-tools.
# Note that the l= L= etc. are the only way I (Faré) have found to
# pass arguments from the Makefile to the underlying script:
# l= overrides $ASDF_TEST_LISPS to specify which lisp implementations to use
# L= overrides $ASDF_UPGRADE_TEST_LISPS (defaults to the former) to lisps during upgrade
# s= overrides $ASDF_TEST_SYSTEMS to specify systems with which to test ASDF
# t= overrides $ASDF_TESTS to specify test script patterns to use (default to *.script)
# u= overrides $ASDF_UPGRADE_TEST_TAGS to specify versions to upgrade from (e.g. 3.0.3 or REQUIRE)
# U= overrides $ASDF_UPGRADE_TEST_METHODS to specify upgrade methods
# v= overrides the default next version for bump-version or bump.
# see in tools/test-environment.lisp for details.
# To have a list of commands, see make help or ./tools/asdf-tools help
# Note that when you call ./tools/asdf-tools directly,
# you may have to use positional parameters instead (unless you use env as below), as in
# ./tools/asdf-tools bump 3.2.1
# instead of
# make bump v=3.2.1
# or
# ./tools/asdf-tools env v=3.2.1 bump
%: build/asdf.lisp
@echo "Delegating $@ to asdf-tools" ; \
./tools/asdf-tools make-target $@ l="$l" L="$L" u="$u" U="$u" v="$v" s="$s" t="$t"
./tools/asdf-tools env l="$l" L="$L" u="$u" U="$u" v="$v" s="$s" t="$t" $@
.PHONY: all driver-files defsystem-files
......@@ -44,12 +44,12 @@
(defun fix-local-git-tags ()
"delete wrongful tags from local git repository"
(dolist (tag *wrongful-tags*)
(git `(tag -d ,tag) :on-error t)))
(git `(tag -d ,tag) :on-error nil)))
(defun fix-remote-git-tags (&optional (remote "origin"))
"delete wrongful tags from remote git repository"
(dolist (tag *wrongful-tags*)
(git `(push ,remote (:refs/tags/,tag)) :on-error t)))
(git `(push ,remote (:refs/tags/,tag)) :on-error nil)))
(defun git-all-committed-p ()
"is your checkout clean, with all files committed?"
;;;; Generic code to interface a Lisp script to the shell command-line.
(in-package :asdf-tools)
(defun re (arg)
......@@ -58,7 +57,7 @@
(loop :for x :in (sort (public-commands) 'string< :key 'command-name)
:do (format t "~(~27A~)~@[ ~A~]~%"
(command-name x) (short-function-description x)))
(let ((x (find-command x)))
(when x
......@@ -66,7 +65,7 @@
(command-name x)
(or ()) ;; TODO: remember the arguments to deftestcmd, translate to v=, etc
(documentation x 'function))
;;; Main entry point.
;;; NB: For access control, you could check that only exported symbols are used as entry points.
......@@ -80,7 +79,7 @@
(multiple-value-list (apply fun (rest args)))))
(when results
(format t "~&~{~S~%~}" results))
(return (first results))))
(return (or (null results) (first results))))) ;; Trick: (values) counts as T, not NIL.
(format t "Command ~A not found~%" (first args))
......@@ -72,18 +72,22 @@
(declare (ignore r))
(unless (emptyp val)
(setf (symbol-value sym) (funcall transformer val)))
(return t))
(error "Unknown variable ~A" var)))
(error "Unrecognized argument ~A" def)))
(defun show-environment ()
(loop :for (v) :in *environment-variable-specs* :do
(format t "~A = ~S~%" v (symbol-value v)))
(defun make-target (target &rest env)
(map () 'test-definition env)
(shell-boolean-exit (main (list target))))
(defun env (&rest env)
(loop :for (first . rest) :on env
:unless (test-definition first)
:return (if-let (c (find-command first))
(apply c rest)
(progn (format t "Command ~A not found~%" first) nil))
:finally (progn (format t "No command provided~%") (return))))
(eval-when (:compile-toplevel :load-toplevel :execute)
(defun decl-or-docstring-p (form)
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment