chiark / gitweb /
runlisp-base.conf (inhibit-asdf-upgrade): Fix for old ASDF versions.
authorMark Wooding <mdw@distorted.org.uk>
Mon, 4 Mar 2024 14:39:58 +0000 (14:39 +0000)
committerMark Wooding <mdw@distorted.org.uk>
Mon, 4 Mar 2024 14:39:58 +0000 (14:39 +0000)
Before `register-immutable-system' existed, there was still a notion of
`immutable systems', but you had to roll up your sleeves and do the job
by hand.

This is all quite unpleasant.

runlisp-base.conf

index 7f7207fc374ea9c9f608fb29c3a780ef68cf2cb7..dc1ecefaf73435f6d82c4d94be065d3eb1abdeee 100644 (file)
@@ -85,11 +85,24 @@ require-asdf =
 ;; Prevent ASDF from upgrading itself.  Otherwise it will do this
 ;; automatically if a script invokes `asdf:load-system', but that will have a
 ;; bad effect on startup time, and risks spamming the output streams with
-;; drivel.
+;; drivel.  Some ancient Lisps come with an ASDF which doesn't understand
+;; `register-immutable-system', so do the job by hand if necessary.
 inhibit-asdf-upgrade =
-       (funcall (intern "REGISTER-IMMUTABLE-SYSTEM"
-                        (find-package "ASDF"))
-                "asdf")
+       (let* ((#1300=#:root (find-package "ASDF"))
+              (#1301=#:ris (find-symbol "REGISTER-IMMUTABLE-SYSTEM" #1300#)))
+         (if (and #1301# (fboundp #1301#))
+             (funcall #1301# "asdf")
+             (let* ((#1302=#:fsys (find-package "ASDF/FIND-SYSTEM"))
+                    (#1303=#:iss (find-symbol "*IMMUTABLE-SYSTEMS*" #1302#))
+                    (#1304=#:dss (find-symbol "*DEFINED-SYSTEMS*" #1302#))
+                    (#1305=#:sys (find-symbol "SYSTEM" #1300#)))
+               (unless (symbol-value #1303#)
+                 (setf (symbol-value #1303#)
+                         (make-hash-table :test (function equal))))
+               (setf (gethash "asdf" (symbol-value #1303#)) t
+                     (gethash "asdf" (symbol-value #1304#))
+                       (cons (get-universal-time)
+                             (make-instance #1305# :name "asdf"))))))
 
 ;; Upgrade ASDF from the source registry.
 upgrade-asdf =