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

4.1.3: release.

Bump ASDF dependency to 3.1.2.

Use package-inferred-system for dispatch and release.

Update release script to depend on inferior-shell 2.0.3, and
check that the manual is up-to-date.

Update manual, debian stuff.
parent 143faded
......@@ -2,9 +2,12 @@
build.xcvb
cl-launch
cl-launch.asd
cl-launch.1
cl-launch.1.md
launcher.lisp
wrapper.sh
cl-shim
cl
# Generated when compiling with e.g. SLIME
*.*f*sl
......
TODO for cl-launch as of 4.1.2
TODO for cl-launch as of 4.1.3
* When resuming from an image then dumping another, the INCLUDE_PATH
becomes a very bad variable to look for the image.
......@@ -68,14 +68,8 @@ TODO for cl-launch as of 4.1.2
When starting cl-launch, I experience a pause of ~1s.
Half of it is loading the asdf fasl, then the upgraded asdf fasl.
The other half is scanning the source registry.
At least this scanning can be sped up, by patching ASDF
to support a source-registry cache or something.
* Improve release script to check and/or update that the date in
cl-launch.sh matches the date of the commit being released,
and generate cl-launch.1 from it using something.
pandoc? Ugly. ronn? Looks OK, if we replace its first lines
by our first line.
At least this scanning can be sped up, using ASDF 3.1.4's
tools/cl-source-registry-cache.lisp
* Use #+sbcl (setf sb-ext:*evaluator-mode* :interpret)
and a series of (declaim (optimize (speed 0) (size 0) (debug 0)
......
(defsystem "cl-launch-dispatch"
:depends-on (#-asdf3.1 (:version "uiop" "3.1"))
:components ((:file "dispatch")))
#!/bin/sh
#| cl-launch.sh -- shell wrapper for Common Lisp -*- Lisp -*-
CL_LAUNCH_VERSION='4.1.2.2'
CL_LAUNCH_VERSION='4.1.3'
license_information () {
AUTHOR_NOTE="\
# Please send your improvements to the author:
......@@ -88,7 +88,7 @@ PROGBASE="${0##*/}" # "$(basename "$0")"
CL_LAUNCH_URL="http://fare.tunes.org/files/cl-launch/cl-launch.sh"
HELP_HEADER="cl-launch.sh $CL_LAUNCH_VERSION \"(March 2015)\" \"Francois-Rene Rideau's\" \"shell wrapper for Common Lisp\""
HELP_HEADER="cl-launch.sh $CL_LAUNCH_VERSION \"(April 2015)\" \"Francois-Rene Rideau's\" \"shell wrapper for Common Lisp\""
print_help_header () {
ECHO "$HELP_HEADER"
ECHO "============"
......@@ -176,8 +176,8 @@ EOF
}
print_more_help () {
cat<<EOF
Invocation of \`cl-launch\`
-------------------------
Invocation of cl-launch
-----------------------
\`cl-launch\` will evaluate Common Lisp code or create shell scripts or
executable binaries that evaluate Common Lisp code. cl-launch follows
......@@ -194,7 +194,7 @@ Recent Linux kernels support a script interpreter itself being a script;
BSD kernels don't and require a small C program cl-shim to be compiled and
installed as /usr/bin/cl to use cl-launch this way.
To work properly, \`cl-launch\` 4.0.8 depends on \`ASDF\` 3.0.1 or later, and
To work properly, \`cl-launch\` 4.1.3 depends on \`ASDF\` 3.1.2 or later, and
on its portability layer \`UIOP\`, to manage compilation and image life cycle.
The software is specified as the evaluation of code in several phases;
......@@ -207,7 +207,7 @@ In the first phase, the Lisp image is initialized:
(option \`-I --image\`)
* loading a small header of code that provides common \`cl-launch\` functionality
* loading \`ASDF3\`.
The \`cl-launch\` header will try hard to load \`ASDF 3.0.1\` or later.
The \`cl-launch\` header will try hard to load \`ASDF 3.1.2\` or later.
If your implementation does not provide it via \`(require "asdf")\`,
you can configure your implementation's \`ASDF\` (if any) to find it.
Or you can put it in your home, under \`~/common-lip/asdf/\`
......@@ -308,8 +308,8 @@ at which point it happens when you invoke the executable output file:
if multiple are provided, the last one provided overrides previous ones.
If you want several functions to be called, you may \`DEFUN\` one that calls
them and use it as a restart, or you may use multiple init forms as below.
See also below options `-DE --dispatch-entry`, \`-sm --system-main\`,
\`-Ds --dispatch-system\` that behave as if `-E --entry` had been specified
See also below options \`-DE --dispatch-entry\`, \`-sm --system-main\`,
\`-Ds --dispatch-system\` that behave as if \`-E --entry\` had been specified
among other things.
* If neither restart nor entry function is provided, the program will exit with
status \`0\` (success). If a function was provided, the program will exit
......@@ -343,16 +343,16 @@ The following derived options work as if by a combination of simpler options:
* If option \`-DE --dispatch-entry\` is used, then the next argument must follow
the format \`NAME/ENTRY\`, where \`NAME\` is a name that the program may be
invoked as (the basename of the \`uiop:argv0\` argument), and \`ENTRY\` is
a function to be invoked as if by `--entry` when that is the case.
a function to be invoked as if by \`--entry\` when that is the case.
If the \`ENTRY\` is left out, function \`main\` in current package is used.
Support for option \`-DE --dispatch-entry\` is delegated to a dispatch library,
distributed with \`cl-launch\` but not part of \`cl-launch\` itself, by
(1) registering a dependency on the dispatch library as if by
\`--system cl-launch-dispatch\` (if not already)
\`--system cl-launch/dispatch\` (if not already)
(2) if neither \`--restart\` nor \`--entry\` was specified yet, registering a
default entry function as if by \`--entry cl-launch-dispatch:dispatch-entry\`.
default entry function as if by \`--entry cl-launch/dispatch:dispatch-entry\`.
(3) registering a build-form that registers the dispatch entry as if by
\`--eval '(cl-launch-dispatch:register-name/entry "NAME/ENTRY" :PACKAGE)'\`
\`--eval '(cl-launch/dispatch:register-name/entry "NAME/ENTRY" :PACKAGE)'\`
where \`PACKAGE\` is the current package.
See the documentation of said library for further details.
......@@ -1213,13 +1213,13 @@ set_entry () {
}
add_dispatch_entry () {
if [ -z "$DISPATCH_ENTRY_P" ] ; then
add_build_form "(:load-system \"cl-launch-dispatch\")"
add_build_form "(:load-system \"cl-launch/dispatch\")"
DISPATCH_ENTRY_P=t
fi
if [ -z "$RESTART" ] ; then
set_entry "cl-launch-dispatch:dispatch-entry"
set_entry "cl-launch/dispatch:dispatch-entry"
fi
add_build_form "(:eval \"$(kwote "(cl-launch-dispatch:register-name/entry \"$(kwote "$1")\" :$2)")\")"
add_build_form "(:eval \"$(kwote "(cl-launch/dispatch:register-name/entry \"$(kwote "$1")\" :$2)")\")"
}
add_build_form () {
SOFTWARE_BUILD_FORMS="$SOFTWARE_BUILD_FORMS${SOFTWARE_BUILD_FORMS+
......@@ -1746,7 +1746,9 @@ print_cl_launch_asd () {
;; If the initial ASDF isn't, you're likely in trouble.
;;
(asdf:defsystem :cl-launch
:depends-on ((:version "asdf" "3.0.1")) ; we need UIOP, included in ASDF 3 and later
:defsystem-depends-on ("asdf-package-system")
:class :package-inferred-system
:depends-on ((:version "asdf" "3.1.2")) ; we want some recent enough ASDF and UIOP
:licence "MIT"
:components ((:file "launcher")))
END
......@@ -2287,7 +2289,7 @@ NIL
;; only if ASDF 3 is in a predictable place under the user's homedir, thus
;; ~/common-lisp/asdf/ or ~/.local/share/common-lisp/source/asdf/ only.
(block nil
(let ((required-asdf-version "3.0.1")
(let ((required-asdf-version "3.1.2")
(verbose *load-verbose*))
(labels ((asdf-symbol (name)
(and (find-package :asdf) (find-symbol (string name) :asdf)))
......@@ -2349,8 +2351,8 @@ NIL
;; Most implementations provide ASDF, but while most of them are case-insensitive,
;; CLISP is case-sensitive, so we need to specify a lowercase string,
;; and not the keyword :asdf or symbol 'asdf.
;; Most implementations provide ASDF 3, but some of them only ASDF 2
;; and antique versions only ASDF 1.
;; Most recent implementations provide ASDF 3, but some of them only ASDF 2
;; and antique versions only of ASDF 1.
#'(lambda () (funcall 'require "asdf")))
(try-file-stage-1 "asdf" "default (visible)" (user-homedir-pathname)
"~/" '("common-lisp"))
......@@ -2412,8 +2414,8 @@ NIL
":" 't #-cl-launch ;'; cl_fragment<<'NIL'
;; Because of ASDF upgrade punting, this ASDF package may be a new one.
(eval-when (:compile-toplevel :load-toplevel :execute)
(unless (or #+asdf2 (asdf:version-satisfies (asdf:asdf-version) "3.0.1"))
(error "cl-launch requires ASDF 3.0.1 or later (3.1.1 for dumping images)")))
(unless (or #+asdf2 (asdf:version-satisfies (asdf:asdf-version) "3.1.2"))
(error "cl-launch requires ASDF 3.1.2 or later")))
NIL
":" 't #-cl-launch ;'; cl_fragment<<'NIL'
;;;; Create cl-launch with UIOP.
......
cl-launch (4.1.3-1) unstable; urgency=low
* New options --system-main and --dispatch-system
* updated manual and release script
-- Francois-Rene Rideau <fare@tunes.org> Wed, 22 Apr 2015 15:01:28 -0400
cl-launch (4.1.2-2) unstable; urgency=low
* Multiple entry binaries with --dispatched-entry,
......
.TH cl\-launch.sh 1 "(March 2015)" "Francois\-Rene Rideau's" "Shell Scripting with Common Lisp"
.\" generated with Ronn/v0.7.3
.\" http://github.com/rtomayko/ronn/tree/0.7.3
.
.TH "CL\-LAUNCH" "1" "April 2015" "Francois-Rene Rideau" "Shell Scripting with Common Lisp"
.
.SH "Name"
cl\-launch \- shell wrapper for Common Lisp
.
......@@ -81,7 +85,7 @@ cl [options] \-\-output EXECUTABLE [options]
.
.fi
.
.SH "Invocation of <code>cl\-launch</code>"
.SH "Invocation of cl\-launch"
\fBcl\-launch\fR will evaluate Common Lisp code or create shell scripts or executable binaries that evaluate Common Lisp code\. cl\-launch follows the invocation conventions of both Unix script interpreters and Common Lisp implementations\.
.
.P
......@@ -101,7 +105,7 @@ A suggested short\-hand name for \fBcl\-launch\fR is \fBcl\fR (you may create a
(See \fISimple cl\-launch scripts\fR below for caveats with \fB#!\fR scripts though\.) Recent Linux kernels support a script interpreter itself being a script; BSD kernels don\'t and require a small C program cl\-shim to be compiled and installed as /usr/bin/cl to use cl\-launch this way\.
.
.P
To work properly, \fBcl\-launch\fR 4\.0\.8 depends on \fBASDF\fR 3\.0\.1 or later, and on its portability layer \fBUIOP\fR, to manage compilation and image life cycle\.
To work properly, \fBcl\-launch\fR 4\.1\.3 depends on \fBASDF\fR 3\.1\.2 or later, and on its portability layer \fBUIOP\fR, to manage compilation and image life cycle\.
.
.P
The software is specified as the evaluation of code in several phases; the distinction matters most for creating executable binaries, but understanding the evaluation model can avoid surprises in other cases too\.
......@@ -116,7 +120,7 @@ optionally having your Lisp start from a Lisp \fBIMAGE\fR (option \fB\-I \-\-ima
loading a small header of code that provides common \fBcl\-launch\fR functionality
.
.IP "\(bu" 4
loading \fBASDF3\fR\. The \fBcl\-launch\fR header will try hard to load \fBASDF 3\.0\.1\fR or later\. If your implementation does not provide it via \fB(require "asdf")\fR, you can configure your implementation\'s \fBASDF\fR (if any) to find it\. Or you can put it in your home, under \fB~/common\-lip/asdf/\fR and \fBcl\-launch\fR will find it\. Or it may be installed in \fB/usr/share/common\-lisp/source/cl\-asdf/\fR in which case \fBcl\-launch\fR will also find it\. Failing any of the above, \fBcl\-launch\fR will be unable to proceed\.
loading \fBASDF3\fR\. The \fBcl\-launch\fR header will try hard to load \fBASDF 3\.1\.2\fR or later\. If your implementation does not provide it via \fB(require "asdf")\fR, you can configure your implementation\'s \fBASDF\fR (if any) to find it\. Or you can put it in your home, under \fB~/common\-lip/asdf/\fR and \fBcl\-launch\fR will find it\. Or it may be installed in \fB/usr/share/common\-lisp/source/cl\-asdf/\fR in which case \fBcl\-launch\fR will also find it\. Failing any of the above, \fBcl\-launch\fR will be unable to proceed\.
.
.IP "\(bu" 4
optionally loading quicklisp \fIhttp://beta\.quicklisp\.org/\fR (option \fB\-Q \-\-quicklisp\fR)
......@@ -162,20 +166,34 @@ Hooks from \fBASDF3\fR\'s \fBUIOP:*IMAGE\-RESTORE\-HOOK*\fR are called (in FIFO
a series of \fBFORMS\fR specified via options \fB\-i \-\-init\fR, \fB\-ip \-\-print\fR, \fB\-iw \-\-write\fR, stored as a text string, are read and evaluated in order of appearance, each in the context of the package that was current at the time it was requested\. (Concatenated together with separating whitespace, these forms constitute the \fBUIOP:*IMAGE\-PRELUDE*\fR as handled by \fBRESTORE\-IMAGE\fR)\. Arguments that start with an open parenthesis are assumed to be \fBFORMS\fR that follow an implicit \fB\-\-print\fR\. Loading from a stream means you don\'t have to worry about nasty read\-time issues; forms will be read by the fully built Lisp image; however it also means that if you care a lot about the very last drop of startup delay when invoking a dumped image, you\'ll only use option \fB\-r \-\-restart\fR or \fB\-E \-\-entry\fR and avoid using \fB\-\-init\fR and its variants\. Option \fB\-ip \-\-print\fR specifies \fBFORMS\fR such that the result of the last form will be printed as if by \fBPRINC\fR, followed by a newline\. Option \fB\-iw \-\-write\fR is similar to \fB\-\-print\fR, using \fBWRITE\fR instead of \fBPRINC\fR\.
.
.IP "\(bu" 4
An optional \fBFUNCTION\fR provided option \fB\-r \-\-restart\fR or \fB\-E \-\-entry\fR is invoked\. If the function was provided with option \fB\-r \-\-restart\fR (compatible with earlier versions of \fBcl\-launch\fR), it will be called with no argument\. If it was provided with option \fB\-E \-\-entry\fR (compatible with \fBbuildapp\fR), it will be called with one argument, being the list of arguments passed to the program, not including \fBargv[0]\fR, which is available on most implementations via the function \fBuiop:argv0\fR (available in \fBASDF\fR 3\.1\.2 and later)\. Using either option, the argument may be a function name or a lambda expression, that is read from the current package (see below option \fB\-p \-\-package\fR and \fB\-sp \-\-system\-package\fR)\. Only one restart or entry function may be specified; if multiple are provided, the last one provided overrides previous ones\. If you want several functions to be called, you may \fBDEFUN\fR one that calls them and use it as a restart, or you may use multiple init forms as below\.
An optional \fBFUNCTION\fR provided option \fB\-r \-\-restart\fR or \fB\-E \-\-entry\fR is invoked\. If the function was provided with option \fB\-r \-\-restart\fR (compatible with earlier versions of \fBcl\-launch\fR), it will be called with no argument\. If it was provided with option \fB\-E \-\-entry\fR (compatible with \fBbuildapp\fR), it will be called with one argument, being the list of arguments passed to the program, not including \fBargv[0]\fR, which is available on most implementations via the function \fBuiop:argv0\fR (available in \fBASDF\fR 3\.1\.2 and later)\. Using either option, the argument may be a function name or a lambda expression, that is read from the current package (see below option \fB\-p \-\-package\fR and \fB\-sp \-\-system\-package\fR)\. Only one restart or entry function may be specified; if multiple are provided, the last one provided overrides previous ones\. If you want several functions to be called, you may \fBDEFUN\fR one that calls them and use it as a restart, or you may use multiple init forms as below\. See also below options \fB\-DE \-\-dispatch\-entry\fR, \fB\-sm \-\-system\-main\fR, \fB\-Ds \-\-dispatch\-system\fR that behave as if \fB\-E \-\-entry\fR had been specified among other things\.
.
.IP "\(bu" 4
If neither restart nor entry function is provided, the program will exit with status \fB0\fR (success)\. If a function was provided, the program will exit after the function returns (if it returns), with status \fB0\fR if and only if the primary return value of result is generalized boolean true, and with status 1 if this value is \fBNIL\fR\. See documentation for \fBUIOP:RESTORE\-IMAGE\fR for details\.
.
.IP "\(bu" 4
If option \fB\-DE \-\-dispatch\-entry\fR is used, then the next argument must follow the format \fBNAME/ENTRY\fR, where \fBNAME\fR is a name that the program may be invoked as (the basename of the \fBuiop:argv0\fR argument), and \fBENTRY\fR is a function to be invoked as if by \-\-entry when that is the case\. Support for option \fB\-DE \-\-dispatch\-entry\fR is delegated to a dispatch library, distributed with \fBcl\-launch\fR but not part of \fBcl\-launch\fR itself, by (1) registering a dependency on the dispatch library as if \fB\-\-system cl\-launch\-dispatch\fR had been specified (if not already) (2) if neither \fB\-\-restart\fR nor \fB\-\-entry\fR was specified yet, registering a default entry function as if by \fB\-\-entry cl\-launch\-dispatch:dispatch\-entry\fR\. (3) registering an init\-form that registers the dispatch entry as if \fB(cl\-launch\-dispatch:register\-name/entry "NAME/ENTRY" :PACKAGE)\fR had been specified where PACKAGE is the current package\. See the documentation of said library for further details\.
.
.IP "" 0
.
.P
The current package can be controlled by option \fB\-p \-\-package\fR and its variant \fB\-sp \-\-system\-package\fR that also behaves like \fB\-s \-\-system\fR\. All forms passed to \fB\-\-eval\fR, \fB\-\-init\fR, \fB\-\-print\fR, \fB\-\-write\fR, \fB\-\-final\fR, \fB\-\-restart\fR, \fB\-\-entry\fR, etc\., are read in the current package\. Files specified with \fB\-f \-\-file \-\-load\fR are read in the current package\. Current means the package specified by the latest option \fB\-p \-\-package\fR or \fB\-sp \-\-system\-package\fR preceding the option being processed, or \fBcl\-user\fR if there was none\. Note that multiple \fB\-i \-\-init\fR or \fB\-F \-\-final\fR forms may be evaluated consecutively after a package has been changed, and that if one of these form itself modifies the package, or some other syntax control mechanism such as the reader, it may adversely affect later forms in the same category, but not those in other categories (if reached)\.
.
.P
The following derived options work as if by a combination of simpler options:
.
.IP "\(bu" 4
As mentioned above, option \fB\-sp \-\-system\-package\fR combines \fB\-\-system\fR and \fB\-\-package\fR in one option, so that given the argument \fBSYSTEM\fR, the system is loaded as if by \fB\-\-system SYSTEM\fR that creates a package \fBSYSTEM\fR that then becomes the current package\.
.
.IP "\(bu" 4
If option \fB\-DE \-\-dispatch\-entry\fR is used, then the next argument must follow the format \fBNAME/ENTRY\fR, where \fBNAME\fR is a name that the program may be invoked as (the basename of the \fBuiop:argv0\fR argument), and \fBENTRY\fR is a function to be invoked as if by \fB\-\-entry\fR when that is the case\. If the \fBENTRY\fR is left out, function \fBmain\fR in current package is used\. Support for option \fB\-DE \-\-dispatch\-entry\fR is delegated to a dispatch library, distributed with \fBcl\-launch\fR but not part of \fBcl\-launch\fR itself, by (1) registering a dependency on the dispatch library as if by \fB\-\-system cl\-launch/dispatch\fR (if not already) (2) if neither \fB\-\-restart\fR nor \fB\-\-entry\fR was specified yet, registering a default entry function as if by \fB\-\-entry cl\-launch/dispatch:dispatch\-entry\fR\. (3) registering a build\-form that registers the dispatch entry as if by \fB\-\-eval \'(cl\-launch/dispatch:register\-name/entry "NAME/ENTRY" :PACKAGE)\'\fR where \fBPACKAGE\fR is the current package\. See the documentation of said library for further details\.
.
.IP "\(bu" 4
If option \fB\-Ds \-\-dispatch\-system\fR is used with \fBSYSTEM\fR as its argument, it is as if option \fB\-s \-\-system\fR had been used with the same argument, followed by option \fB\-DE \-\-dispatch\-entry\fR for the basename of the system (last \fB/\fR (slash) separated component of the system name) and the function \fBmain\fR in the package of the system, but without otherwise changing the current package\.
.
.IP "\(bu" 4
If option \fB\-sm \-\-system\-main\fR is used with \fBSYSTEM\fR as its argument, it is as if option \fB\-s \-\-system\fR had been used with the same argument, followed by option \fB\-E \-\-entry\fR with the \fBmain\fR function in the package of the system, but without otherwise changing the current package\.
.
.IP "" 0
.
.P
General note on \fBcl\-launch\fR invocation: options are processed from left to right; usually, repeated options accumulate their effects, with the earlier instances taking effect before latter instances\. In case of conflicting or redundant options, the latter override the former\.
.
.P
......@@ -361,13 +379,13 @@ xcl: XCL 0\.0\.0\.291 (cannot dump an image) (get a recent checkout)
There are some issues regarding standalone executables on \fBCLISP\fR\. See below in the section regarding \fIStandalone executables\fR\.
.
.P
\fBLispWorks\fR requires the Professional Edition\. Personal edition isn\'t supported as it won\'t let you control the command line or dump images\. Dumped images will print a banner, unless you dump a standalone executable\. To dump an image, make sure you have a license file in your target directory (or use a trampoline shell script to \fBexec /path/to/lispworks "$@"\fR), create a build script with:
\fBLispWorks\fR requires the Professional Edition; the Personal Edition isn\'t supported as it won\'t let you either control the command line or dump images\. Dumped images will print a banner, unless you dump a standalone executable\. To dump an image, make sure you have a license file in your target directory and/or to \.\.\./lispworks/lib/6\-1\-0\-0/config/lwlicense (or use a trampoline shell script to \fBexec /path/to/lispworks "$@"\fR), create a build script with:
.
.IP "" 4
.
.nf
echo \'(hcl:save\-image "lispworks" :environment nil)\' > si\.lisp
echo \'(hcl:save\-image "lispworks\-console" :environment nil)\' > si\.lisp
lispworks\-6\-1\-0\-x86\-linux \-siteinit \- \-init \- \-build si\.lisp
.
.fi
......@@ -375,7 +393,7 @@ There are some issues regarding standalone executables on \fBCLISP\fR\. See belo
.IP "" 0
.
.P
LispWorks also requires that you have \fBASDF 3\.1\.2\fR or later; make sure you have it installed and configured in your source registry\.
LispWorks also requires that you have \fBASDF 3\.1\.2\fR or later; make sure you have it installed and configured in your source registry\. There is no standard name for a console\-only variant of LispWorks; older versions of cl\-launch assume a default \fBlispworks\fR; since 4\.1\.2\.1, \fBlispworks\-console\fR is assumed instead, to avoid conflicts\. You can control the name you use with the shell variable \fB$LISPWORKS\fR, or you can just leave \fBlispworks\-console\fR in your path, and use a symlink, copy, shell alias or trivial wrapper script to enable your favorite shorter name \fBlispworks\fR, \fBlw\fR, \fBlwcon\fR, \fBlw\-console\fR, etc\.
.
.P
Similarly, a mlisp image for allegro can be created as follows:
......
......@@ -12,8 +12,8 @@ Package: cl-launch
Architecture: all
Depends: ${misc:Depends}
Suggests: cl-asdf (>= 2:3.1.4)
Recommends: sbcl (>= 1:1.1.10), cl-asdf (>= 2:3.1.1)
Breaks: cl-asdf (<< 2:3.0.1), common-lisp-controller (<= 7.2)
Recommends: sbcl (>= 1:1.2.3), cl-asdf (>= 2:3.1.2)
Breaks: cl-asdf (<< 2:3.1.1), common-lisp-controller (<= 7.2)
Description: uniform frontend to running Common Lisp code from the shell
CL-Launch will allow you to invoke Common Lisp source code from the shell
command line, from a shell script or as a Common Lisp script. It will also
......
......@@ -44,7 +44,7 @@ install: build
dh_installdirs -p ${debpkg} $(include_dir) $(doc-dir)
dh_install -i cl-launch usr/bin
dh_install -i launcher.lisp wrapper.sh cl-launch.asd build.xcvb \
cl-launch-dispatch.asd dispatch.lisp ${include_dir}
dispatch.lisp ${include_dir}
dh_installman -i debian/*.1
......
(defpackage :cl-launch-dispatch
(defpackage :cl-launch/dispatch
(:use :uiop :cl)
(:export #:dispatch-entry #:get-entry
#:register-name/entry #:register-entry
#:dispatch-entry-error #:get-name #:basename #:all-entry-names
#:dispatcher #:not-found))
(in-package :cl-launch-dispatch)
(in-package :cl-launch/dispatch)
(defvar *default-behavior* 'dispatcher
"the default behavior if the argv0 invocation name is not recognized.")
......
#!/bin/sh
#| -*- Lisp -*-
#!/usr/bin/cl -s inferior-shell -s optima.ppcre -E cl-launch-release::main
exec "$(dirname $0)/cl-launch.sh" \
--system inferior-shell --system optima.ppcre \
-X --package cl-launch-release --entry main -- "$0" "$@" ; exit
#!/usr/bin/cl -sm cl-launch/release
exec "$(dirname $0)/cl-launch.sh" -X --system-main cl-launch/release -- "$0" "$@" ; exit
|#
(defpackage :cl-launch-release
(defpackage :cl-launch/release
(:use :cl :uiop :asdf :inferior-shell :optima :optima.ppcre)
;; Note: the exports are the list of available commands.
(:export #:rep #:clean
;; Note: these exports are also the list of available commands.
(:export #:rep #:clean #:manpage
#:source #:quickrelease
#:debian-package #:publish-debian-package #:debian-package-all))
(in-package :cl-launch-release)
(in-package :cl-launch/release)
(eval-when (:compile-toplevel :load-toplevel :execute)
(unless (fboundp 'argv0) (defun argv0 () "release.lisp")) ;; only in ASDF 3.1.2 or later
(flet ((check-system-version (name version)
(let ((system (find-system name)))
(unless (version-satisfies system version)
(die 2 "~A requires ~A at least ~A but only got version ~A"
(argv0) name version (component-version system))))))
(check-system-version "inferior-shell" "2.0.0"))) ;; for default run outputs
(check-system-version "asdf" "3.1.2") ;; for package-inferred-system, uiop:argv0
(check-system-version "inferior-shell" "2.0.3"))) ;; for default run outputs, on-error error.
(defvar *cl-launch-directory* ;; interactive users may want to override that.
(truenamize
(pathname-directory-pathname
(ensure-absolute-pathname
(or (argv0) *load-pathname* (nil-pathname)) #'getcwd))))
(or (argv0) *compile-file-pathname* *load-pathname* (nil-pathname)) #'getcwd))))
(defun pn (&optional x)
(subpathname *cl-launch-directory* x))
(defun rep (argument)
;; read-eval-print, no loop.
(eval-input (strcat "(in-package :cl-launch-release) " argument)))
(eval-input (strcat "(in-package :cl-launch/release) " argument)))
(defun script-version ()
(match (read-file-line (pn "cl-launch.sh") :at 2)
......@@ -73,6 +70,7 @@ exec "$(dirname $0)/cl-launch.sh" \
(home (user-homedir-pathname))
(cl-launch-version (strcat "cl-launch-" version))
(cldir (subpathname home "files/cl-launch/")))
(check-manual)
(with-current-directory ((pn))
(run `(pwd) :show t)
(clean)
......@@ -111,14 +109,56 @@ exec "$(dirname $0)/cl-launch.sh" \
(values))
(defun source ()
(with-current-directory ()
(with-current-directory ((pn))
(run `(./cl-launch.sh --include ,(getcwd) "-B" install_path))))
(defparameter *months* #("January" "February" "March" "April" "May" "June"
"July" "August" "September" "October" "November" "December"))
(defun get-date-from-manual ()
(with-current-directory ((pn))
(match (first (run/lines `(./cl-launch.sh --help)))
((ppcre "\"[(]([A-Z][a-z]+) ([0-9]+)[)]\"" month year)
(if-let (pos (position month *months* :test 'equal))
(list (parse-integer year) (1+ pos))
(error "Invalid month ~a" month)))
(_ (error "Can't extract month from manual")))))
(defun get-date-from-git (&optional tag)
(with-current-directory ((pn))
(match (first (run/lines `(git log -1 "--pretty=format:%cI" ,tag)))
((ppcre "^([0-9]+)-([0-9]+)-([0-9]+)T" year month day)
(list (parse-integer year) (parse-integer month) (parse-integer day))))))
(defun check-manual-git-dates-match ()
(let ((date-from-manual (get-date-from-manual))
(date-from-git (subseq (get-date-from-git) 0 2)))
(assert (equal date-from-manual date-from-git) ()
"Manual says it's from ~{~D-~2,'0D~} but git commit is from ~{~D-~2,'0D~}"
date-from-manual date-from-git)))
(defun manpage ()
(check-manual-git-dates-match)
(with-current-directory ((pn))
(run `(ln -sf cl-launch.sh cl))
(run `(env ("PATH=.:" ,(getenv "PATH")) cl --more-help (> cl-launch.1.md)))
(run `(ronn "--roff" "--manual=Shell Scripting with Common Lisp"
"--organization=Francois-Rene Rideau"
,(format nil "--date=~{~D-~2,'0D-~2,'0D~}" (get-date-from-git))
cl-launch.1.md (> 2 /dev/null)))))
(defun check-manual ()
(check-manual-git-dates-match)
(manpage)
(with-current-directory ((pn))
(run `(cmp ./cl-launch.1 ./debian/cl-launch.1))))
(defun quickrelease ()
(let* ((version (script-version)) ;; no need to compare with the debian version
(link (strcat "cl-launch-" version))
(tarball (strcat link ".tar.gz")))
(with-current-directory ()
(check-manual)
(with-current-directory ((pn))
(clean)
(source))
(with-current-directory ((pn "../"))
......@@ -137,11 +177,11 @@ exec "$(dirname $0)/cl-launch.sh" \
(publish-debian-package))
(defun valid-commands ()
(sort (while-collecting (c) (do-external-symbols (x :cl-launch-release) (c x))) #'string<))
(sort (while-collecting (c) (do-external-symbols (x :cl-launch/release) (c x))) #'string<))
(defun main (argv)
(multiple-value-bind (command status)
(find-symbol (string-upcase (first argv)) :cl-launch-release)
(find-symbol (string-upcase (first argv)) :cl-launch/release)
(if (eq status :external)
(format t "~@[~{~S~^ ~}~%~]" (multiple-value-list (apply command (rest argv))))
(die 2 "~A ~:[requires a command~;doesn't recognize command ~:*~A~].~%Try one of: ~(~{~A~^ ~}~)~%"
......
Markdown is supported
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