|
From: rtoy <rt...@us...> - 2025-11-21 15:10:56
|
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "Maxima CAS".
The branch, rtoy-lisp-list-avail-consistently has been updated
via 6e49a965367ebb5410dcfa195147d433e92d0012 (commit)
via 5c0df12aadf24e0ed8bf0a9dcaf654a295fea9bf (commit)
via ac7f321aa11bfc2eb0aa98f1f9ebdd1468fc5028 (commit)
via 71ff3c56185e723a9d0bacfecdb6f96b732d99f2 (commit)
from d2edf1daed08af4ea45ddd7d1ae79604a7e15d28 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit 6e49a965367ebb5410dcfa195147d433e92d0012
Author: Raymond Toy <toy...@gm...>
Date: Fri Nov 21 07:09:42 2025 -0800
Let lisp handle --list-avail
This script handled --list-avail if it was the first arg. That's
weird if it's not. Remove this and let lisp handle all of the
command-line args as usual.
diff --git a/maxima-local.in b/maxima-local.in
index ceb735c08..a819dc770 100755
--- a/maxima-local.in
+++ b/maxima-local.in
@@ -17,17 +17,6 @@ export MAXIMA_HTMLDIR
MAXIMA_LOCAL=yes
export MAXIMA_LOCAL
-# report the compiled in Lisp versions
-if [ x"$1" = "x--list-avail" ]; then
- V="@VERSION@"
- echo "Available versions:"
- for i in src/binary-* ; do
- L=`echo $i | sed s/src.binary-//`
- echo "version $V, lisp $L"
- done;
- exit;
-fi;
-
# quick fix for plotting with plot_format=openmath (bug 3052)
if [ ! -d "@abs_top_srcdir@/bin" ]; then
mkdir -p "@abs_top_srcdir@/bin"
commit 5c0df12aadf24e0ed8bf0a9dcaf654a295fea9bf
Author: Raymond Toy <toy...@gm...>
Date: Wed Nov 19 07:31:22 2025 -0800
Add more info to unix-like-dirname docstring
I expect was expecting "a/b/c/" to return "a/b/c", but it doesn't. It
returns "a/b". Add that as an example, even though it's fairly clear
from the dirname manpage that that is the expected answer.
diff --git a/src/mload.lisp b/src/mload.lisp
index 5f737548c..b39e5706f 100644
--- a/src/mload.lisp
+++ b/src/mload.lisp
@@ -44,7 +44,8 @@
(defun unix-like-dirname (path)
"A Lisp equivalent of the Unix program dirname. This strips the last
component from the given PATH. The last non-slash component and
- trailing slashes are removed."
+ trailing slashes are removed. In particular for \"a/b/c/\", this
+ returns \"a/b\", not \"a/b/c/\"."
(let* ((pathstring (namestring path))
(len (length pathstring)))
(when (equal (subseq pathstring (- len 1) len) "/")
commit ac7f321aa11bfc2eb0aa98f1f9ebdd1468fc5028
Author: Raymond Toy <toy...@gm...>
Date: Wed Nov 19 07:25:52 2025 -0800
Update get-dirs to support cmucl and add some comments
`get-dirs` was returning all the files in the given `path` for cmucl
because a trailing slash was not appended. Append the slash.
Also add some docstrings and comments to `get-dirs`.
Finally, add comments to `unix-like-dirname` because I was confused on
what `unix-like-dirname` was returning. It is doing what the program
`dirname` does.
diff --git a/src/mload.lisp b/src/mload.lisp
index dfce018e4..5f737548c 100644
--- a/src/mload.lisp
+++ b/src/mload.lisp
@@ -21,11 +21,15 @@
(errset (pathname x))))
(defun get-dirs (path &aux (ns (namestring path)))
+ "Find all the directories in the directory given by PATH. We do not
+ descend into the subdirectories."
+ ;; Basically get a directory listing from "<path>/*/". The last
+ ;; slash tells DIRECTORY to return just the directories in PATH.
(directory (concatenate 'string
ns
(if (eql #\/ (char ns (1- (length ns)))) "" "/")
"*"
- #+(or :clisp :sbcl :ecl :openmcl :gcl) "/")
+ #+(or :clisp :sbcl :ecl :openmcl :gcl :cmucl) "/")
#+openmcl :directories #+openmcl t))
(defun unix-like-basename (path)
@@ -38,16 +42,19 @@
(position #\\ pathstring :from-end t) -1)) len)))
(defun unix-like-dirname (path)
+ "A Lisp equivalent of the Unix program dirname. This strips the last
+ component from the given PATH. The last non-slash component and
+ trailing slashes are removed."
(let* ((pathstring (namestring path))
(len (length pathstring)))
(when (equal (subseq pathstring (- len 1) len) "/")
(decf len)
(setf pathstring (subseq pathstring 0 len)))
(let ((last-slash (or (position #\/ pathstring :from-end t)
- (position #\\ pathstring :from-end t))))
+ (position #\\ pathstring :from-end t))))
(if last-slash
- (subseq pathstring 0 last-slash)
- "."))))
+ (subseq pathstring 0 last-slash)
+ "."))))
(defmfun $filename_merge (&rest file-specs)
(when (or (null file-specs) (cddr file-specs))
commit 71ff3c56185e723a9d0bacfecdb6f96b732d99f2
Author: Raymond Toy <toy...@gm...>
Date: Wed Nov 19 07:13:05 2025 -0800
Use get-dirs to get directories and add some comments
Use `get-dirs` to get a list of directories instead of calling
`directory` ourselves.
Add some more comments about regexp pattern.
diff --git a/src/init-cl.lisp b/src/init-cl.lisp
index c5ab0a2de..771897d8d 100644
--- a/src/init-cl.lisp
+++ b/src/init-cl.lisp
@@ -332,7 +332,8 @@ maxima [options] --batch-string='batch_answers_from_file:false; ...'
(let ((maxima-dir (maxima-getenv "MAXIMA_PREFIX"))
;; I (rtoy) am lazy. Just use regexp to match
;; "src/binary-foo" which is the directory containing the
- ;; build using lisp "foo".
+ ;; build using lisp "foo". Since it's a directory, the
+ ;; pattern should not include the slash.
(pattern (pregexp:pregexp "src/binary-([^/]+)")))
;; maxima-local MUST define MAXIMA_PREFIX envvar so we know where we are.
(unless maxima-dir
@@ -341,7 +342,7 @@ maxima [options] --batch-string='batch_answers_from_file:false; ...'
(bye))
(setf maxima-dir (combine-path maxima-dir "src"))
(format t "Available versions:~%")
- (dolist (p (directory (concatenate 'string maxima-dir "/*")))
+ (dolist (p (get-dirs (concatenate 'string maxima-dir "/*")))
(destructuring-bind (&optional whole-match lisp-name)
(pregexp:pregexp-match pattern (namestring p))
(declare (ignore whole-match))
@@ -360,11 +361,7 @@ maxima [options] --batch-string='batch_answers_from_file:false; ...'
(format t "Available versions:~%")
(unless (equal (subseq maxima-verpkglibdir (- len 1) len) "/")
(setf maxima-verpkglibdir (concatenate 'string maxima-verpkglibdir "/")))
- (format t "maxima-verpkglibdir = ~A~%" maxima-verpkglibdir)
- (format t "unix-like-dirname = ~A~%" (unix-like-dirname maxima-verpkglibdir))
- (format t "get-dirs = ~A~%" (get-dirs (unix-like-dirname maxima-verpkglibdir)))
(dolist (version (get-dirs (unix-like-dirname maxima-verpkglibdir)))
- (format t "version = ~A~%" version)
(dolist (lisp (get-dirs version))
(setf lisp-string (unix-like-basename lisp))
(when (search "binary-" lisp-string)
-----------------------------------------------------------------------
Summary of changes:
maxima-local.in | 11 -----------
src/init-cl.lisp | 9 +++------
src/mload.lisp | 16 ++++++++++++----
3 files changed, 15 insertions(+), 21 deletions(-)
hooks/post-receive
--
Maxima CAS
|