/usr/share/doc/cl-asdf/examples/test-sysdef-asdf.script is in cl-asdf 2:3.1.6-1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 | ;;; -*- Lisp -*-
(format! t "~%Using ASDF ~A~%" (asdf-version))
(assert (version< "3.0" (asdf-version))) ;; check that we have a recent enough ASDF
(DBG "Try load ASDF with an empty configuration")
(initialize-source-registry
'(:source-registry :ignore-inherited-configuration))
(load-system :asdf)
;; We haven't found it, and got the fallback
(assert-equal nil (system-source-file (find-system :asdf)))
;; Bogus sysdef finding function, for the sake of testing no-load-old-version.
(defun sysdef-bogus-test-search (system)
(declare (ignore system))
(subpathname *test-directory* "always-error.lisp"))
(clear-system "asdf")
(let ((*system-definition-search-functions* '(sysdef-bogus-test-search))
(state "Didn't catch warning"))
(DBG "Bogus attempt at loading an old ASDF: should issue a warning and ignore")
(handler-bind
((simple-warning
#'(lambda (c)
(when (search "ASDF will ignore this configured system rather than downgrade itself."
(simple-condition-format-control c))
(setf state "Caught warning")))))
(clear-system "asdf")
(upgrade-asdf))
(assert-equal state "Caught warning")
(DBG "2nd bogus attempt at loading same old ASDF: should ignore without a warning")
(handler-bind
((simple-warning
#'(lambda (c)
(error "Should not have issued warning, but did issue:~% ~A" c))))
(clear-system "asdf")
(upgrade-asdf)))
(DBG "Load ASDF with proper configuration: should find asdf.asd from the source above")
(initialize-source-registry
`(:source-registry
(:directory ,*asdf-directory*)
(:directory ,*uiop-directory*)
:ignore-inherited-configuration))
(clear-system "asdf")
(load-system :asdf)
;; This time we found it, but it was skipped because the version was the same
(assert-equal nil (system-source-file (find-system :asdf)))
;; But if we cheat on our version, that should work
(setf asdf::*asdf-version* "3.0")
(clear-system "asdf")
#-xcl ;; expected-failure: XCL has trouble with the ASDF upgrade
(load-system :asdf)
(assert-pathname-equal (subpathname *asdf-directory* "asdf.asd")
(system-source-file (find-system :asdf)))
(DBG "Checking that Makefile and asdf.asd are in synch")
(defun system-lisp-files (system)
(loop :for f :in (required-components system :keep-component 'cl-source-file)
:collect (enough-pathname (component-pathname f) *asdf-directory*)))
(defun makefile-lisp-files (target)
(mapcar
'parse-unix-namestring
(remove-if 'emptyp
(split-string ;; NB: assumes GNU make
(run-program `("make" "-C" ,(native-namestring *asdf-directory*)
"--quiet" "--no-print-directory" ,target)
:output :string :error-output t)
:separator #(#\space #\newline #\return #\tab)))))
(defmacro compare-files (system target)
`(assert-pathnames-equal (system-lisp-files ,system) (makefile-lisp-files ,target)))
(DBG "Testing that the Makefile and ASDF agree on the order of UIOP files")
(compare-files :uiop "driver-files")
(DBG "Testing that the Makefile and ASDF agree on the order of ASDF/DEFSYSTEM files")
(compare-files :asdf/defsystem "defsystem-files")
|