Commit 548d0c9a authored by Francois-Rene Rideau's avatar Francois-Rene Rideau

2.26.87: use read-from-string, not eval-input, for ensure-function, as in the good/bad old days.

Also, improve the bump-version script.
parent f3e6b7d1
......@@ -59,7 +59,10 @@ build/asdf.lisp: $(wildcard *.lisp)
cat $(driver_lisp) $(asdf_lisp) > $@
wc:
wc $(driver_lisp) $(asdf_lisp) | sort -n
@wc $(driver_lisp) | sort -n ; echo ; \
wc $(asdf_lisp) | sort -n ; \
echo ; \
wc $(driver_lisp) $(asdf_lisp) | tail -n 1
wc-driver:
wc $(driver_lisp)
......
......@@ -15,7 +15,7 @@
:licence "MIT"
:description "Another System Definition Facility"
:long-description "ASDF builds Common Lisp software organized into defined systems."
:version "2.26.86" ;; to be automatically updated by bin/bump-revision
:version "2.26.87" ;; to be automatically updated by bin/bump-revision
:depends-on ()
:components ((:module "build" :components ((:file "asdf"))))
:in-order-to (#+asdf2.27 (compile-op (monolithic-load-concatenated-source-op generate-asdf))))
......
......@@ -13,23 +13,34 @@
(asdf-debug)
(resume-image)
(defun afile (x)
(asdf:system-relative-pathname :asdf x))
(defparameter *version-file*
(afile "version.lisp-expr"))
(defparameter *old-version*
(safe-read-first-file-form *version-file*))
(defparameter *argv* (command-line-arguments))
(defparameter *old-version* nil)
(defparameter *new-version* nil)
(defun next-version (v)
(let ((pv (parse-version v)))
(incf (third pv))
(unparse-version pv)))
(defparameter *new-version* (or (first *argv*) (next-version *old-version*)))
(defun version-from-file ()
(safe-read-first-file-form *version-file*))
(defun versions-from-argv (argv)
(ecase (length argv)
((2) (values (second argv) (first argv)))
((1) (values (version-from-file) (first argv)))
((0) (let ((old (version-from-file)))
(values old (next-version old))))))
(multiple-value-setq (*old-version* *new-version*)
(versions-from-argv *command-line-arguments*))
(format t "Bumping ASDF version from ~A to ~A~%" *old-version* *new-version*)
......@@ -37,18 +48,19 @@
(defun maybe-replace-file (file transformer
&key (reader 'read-file-string)
(writer nil) (comparator 'equal)
(writer nil) (comparator 'equalp)
(external-format *utf-8-external-format*))
(let* ((old-contents (funcall reader file))
(new-contents (funcall transformer old-contents)))
(unless (funcall comparator old-contents new-contents)
(let ((written-contents
(if writer
(with-output (s ())
(funcall writer s new-contents))
new-contents)))
(check-type written-contents (or string (byte-vector)))
(clobber-file-with-vector file written-contents :external-format external-format)))))
(if (funcall comparator old-contents new-contents)
(format t "No changes for file ~A~%" file)
(let ((written-contents
(if writer
(with-output (s ())
(funcall writer s new-contents))
new-contents)))
(check-type written-contents (or string (byte-vector)))
(clobber-file-with-vector file written-contents :external-format external-format)))))
(defun version-transform (text)
(flet ((v1 (ver) (format nil "~S" ver))
......@@ -56,10 +68,10 @@
(f (fun text)
(cl-ppcre:regex-replace-all
(funcall fun *old-version*) text (funcall fun *new-version*))))
(f #'v1 (f #'v2 text))))
(f #'v2 (f #'v1 text))))
(defparameter *versioned-files*
'("version.lisp-expr" "asdf.asd" "build/asdf.lisp" "upgrade.lisp"))
'("version.lisp-expr" "asdf.asd" "header.lisp" "build/asdf.lisp" "upgrade.lisp"))
(defun transform-file (x)
(format t "Transforming file ~A~%" x)
......
;; -*- mode: Common-Lisp; Base: 10 ; Syntax: ANSI-Common-Lisp ; coding: utf-8 -*-
;;; This is ASDF 2.26.86: Another System Definition Facility.
;;; This is ASDF 2.26.87: Another System Definition Facility.
;;;
;;; Feedback, bug reports, and patches are all welcome:
;;; please mail to <asdf-devel@common-lisp.net>.
......
......@@ -13,7 +13,7 @@
#:register-image-resume-hook #:register-image-dump-hook
#:call-image-resume-hook #:call-image-dump-hook
#:initialize-asdf-utilities
#:resume #:do-resume #:dump-image
#:resume-image #:run-resumed-program #:dump-image
))
(in-package :asdf/image)
......@@ -205,15 +205,18 @@ if we are not called from a directly executable image dumped by XCVB."
(defun setup-command-line-arguments ()
(setf *command-line-arguments* (command-line-arguments)))
(defun* resume-program (&key (post-image-restart *post-image-restart*) (entry-point *entry-point*))
(call-image-resume-hook)
(with-safe-io-syntax ()
(let ((*read-eval* t))
(when post-image-restart (eval-input post-image-restart))))
(defun* resume-image (&key (post-image-restart *post-image-restart*)
(entry-point *entry-point*)
(image-resume-hook *image-resume-hook*))
(call-functions image-resume-hook)
(when post-image-restart
(with-safe-io-syntax ()
(let ((*read-eval* t))
(eval-input post-image-restart))))
(when entry-point
(apply entry-point *command-line-arguments*)))
(defun* resume ()
(defun* run-resumed-program ()
(with-coded-exit ()
(let ((ret (resume-program)))
(if (typep ret 'integer)
......
......@@ -16,9 +16,11 @@
#:planned-action-status #:plan-action-status #:action-already-done-p
#:circular-dependency #:circular-dependency-actions
#:node-for #:needed-in-image-p
#:action-index #:action-planned-p
#:plan-record-dependency #:visiting-action-p
#:normalize-forced-systems #:action-forced-p #:action-forced-not-p
#:visit-dependencies #:compute-action-stamp #:traverse-action
#:circular-dependency #:circular-dependency-actions
#:call-while-visiting-action #:while-visiting-action
#:traverse-sequentially #:traverse
#:perform-plan #:plan-operates-on-p))
......
......@@ -129,7 +129,8 @@ Otherwise, signal an error."
Useful for portably flushing I/O before user input or program exit."
;; CCL notably buffers its stream output by default.
(dolist (s (append streams
(list *stderr* *error-output* *standard-output* *trace-output* *debug-io*)))
(list *stderr* *error-output* *standard-output* *trace-output*
*debug-io* *terminal-io* *debug-io* *query-io*)))
(ignore-errors (finish-output s)))
(values))
......
......@@ -32,7 +32,7 @@
;; "2.345.6" would be a development version in the official upstream
;; "2.345.0.7" would be your seventh local modification of official release 2.345
;; "2.345.6.7" would be your seventh local modification of development version 2.345.6
(asdf-version "2.26.86")
(asdf-version "2.26.87")
(existing-asdf (find-class (find-symbol* :component :asdf nil) nil))
(existing-version *asdf-version*)
(already-there (equal asdf-version existing-version)))
......
......@@ -230,7 +230,7 @@ starting the separation from the end, e.g. when called with arguments
(cons (eval `(function ,fun)))
(string (eval `(function ,(with-standard-io-syntax
(let ((*package* (find-package package)))
(eval-string fun))))))))
(read-from-string fun))))))))
(defun* call-function (function-spec &rest arguments)
(apply (ensure-function function-spec) arguments))
......
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