Commit 7367a78e authored by Francois-Rene Rideau's avatar Francois-Rene Rideau

tools: use optima.ppcre for nicer interface to regex.

Move install-asdf command to a separate file, because
it depends on test-environment for its parameters.
parent efaaddf7
......@@ -4,7 +4,8 @@
(:version "inferior-shell" "2.0.0")
(:version "cl-ppcre" "2.0.4")
(:version "lisp-invocation" "1.0.2")
(:feature :sbcl "sb-introspect"))
(:feature :sbcl "sb-introspect")
"optima" "optima.ppcre")
:components
((:file "package")
(:file "main" :depends-on ("package"))
......@@ -18,4 +19,5 @@
(:file "test-scripts" :depends-on ("test-environment"))
(:file "test-upgrade" :depends-on ("test-environment" "git"))
(:file "test-all" :depends-on ("test-environment"))
(:file "installation" :depends-on ("test-environment"))
(:file "release" :depends-on ("version" "test-environment"))))
......@@ -25,27 +25,3 @@
(terpri)
(run `(pipe (wc header.lisp ,@(driver-files) ,@(asdf-defsystem-files)) (tail -n 1)))))
;;; BONUS: install asdf as module for your favorite Lisp implementation.
(deftestcmd install-asdf (lisp)
"install asdf as a module on specified Lisp"
(flet ((doit ()
(with-asdf-dir ()
(run-test-lisp
(format nil "installing ASDF to be provided as a module on ~(~A~)" lisp)
'((load "tools/install-asdf.lisp")(uiop:quit))
:lisp lisp))))
(case lisp
((:allegro :allegromodern :ccl :clisp :cmucl :lispworks :sbcl :scl :xcl)
(doit))
((:abcl :ecl :ecl_bytecodes :mkcl)
(format t "Upgrading the implementation-provided ASDF on ~(~A~) isn't supported (yet).
Happily, that implementation is known to keep ASDF reasonably up to date.~%" lisp))
((:cormancl :gcl :genera :mcl :mocl)
(format t "Installing ASDF so it is provided by ~(~A~) isn't supported.
If you care, go hack the implementation.~%" lisp))
(otherwise
(if (string-prefix-p "allegro" (string-downcase lisp))
(doit)
(error "Unknown implementation ~(~A~)" lisp))))))
(in-package :asdf-tools)
;;; BONUS: install asdf as module for your favorite Lisp implementation.
(deftestcmd install-asdf (lisp)
"install asdf as a module on specified Lisp"
(flet ((doit ()
(with-asdf-dir ()
(run-test-lisp
(format nil "installing ASDF to be provided as a module on ~(~A~)" lisp)
'((load "tools/install-asdf.lisp")(uiop:quit))
:lisp lisp))))
(case lisp
((:allegro :allegromodern :ccl :clisp :cmucl :lispworks :sbcl :scl :xcl)
(doit))
((:abcl :ecl :ecl_bytecodes :mkcl)
(format t "Upgrading the implementation-provided ASDF on ~(~A~) isn't supported (yet).
Happily, that implementation is known to keep ASDF reasonably up to date.~%" lisp))
((:cormancl :gcl :genera :mcl :mocl)
(format t "Installing ASDF so it is provided by ~(~A~) isn't supported.
If you care, go hack the implementation.~%" lisp))
(otherwise
(if (string-prefix-p "allegro" (string-downcase lisp))
(doit)
(error "Unknown implementation ~(~A~)" lisp))))))
(defpackage :asdf-tools
(:use :common-lisp :uiop :asdf
:fare-utils :inferior-shell :lisp-invocation :cl-ppcre)
:fare-utils :inferior-shell :lisp-invocation :cl-ppcre :optima :optima.ppcre)
(:export)) ;; TODO: export stuff
;; Just so we can use the name in our test scripts...
......
......@@ -14,12 +14,10 @@
(safe-read-file-form (pn "version.lisp-expr"))))
(defun debian-version-from-file (&optional commit)
(let ((line
(if commit
(git `(show (,commit":debian/changelog")) :output :line)
(read-file-line (pn "debian/changelog")))))
(cl-ppcre:register-groups-bind (ver) ("^cl-asdf [(]([0-9.:-]+)[)] " line)
ver)))
(match (if commit
(git `(show (,commit":debian/changelog")) :output :line)
(read-file-line (pn "debian/changelog")))
((ppcre "^[^(]*\\(([-0-9.:-]+)\\)" ver) ver)))
(defun parse-debian-version (&optional (debian-version (debian-version-from-file)))
(cl-ppcre:register-groups-bind (epoch ver rel)
......
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