From cd8db03991325b1371cf847d36cda88a5abebaaf Mon Sep 17 00:00:00 2001
From: Francois-Rene Rideau <tunes@google.com>
Date: Fri, 8 Mar 2013 17:33:13 -0500
Subject: [PATCH] 2.32.4: more punting with CLISP upgrade.

Can't seem to be able to fmakunbound in the same fasl as a definition.
---
 asdf.asd                 |  2 +-
 header.lisp              |  2 +-
 test/run-tests.sh        |  2 +-
 test/script-support.lisp | 49 ++++++++++++++++++++++++++++------------
 upgrade.lisp             |  5 ++--
 version.lisp-expr        |  2 +-
 6 files changed, 42 insertions(+), 20 deletions(-)

diff --git a/asdf.asd b/asdf.asd
index 91574f02..4a1ff087 100644
--- a/asdf.asd
+++ b/asdf.asd
@@ -74,7 +74,7 @@
   :licence "MIT"
   :description "Another System Definition Facility"
   :long-description "ASDF builds Common Lisp software organized into defined systems."
-  :version "2.32.3" ;; to be automatically updated by make bump-version
+  :version "2.32.4" ;; to be automatically updated by make bump-version
   :depends-on ()
   #+asdf3 :encoding #+asdf3 :utf-8
   ;; For most purposes, asdf itself specially counts as a builtin system.
diff --git a/header.lisp b/header.lisp
index 6b0bc076..9de0ba25 100644
--- a/header.lisp
+++ b/header.lisp
@@ -1,5 +1,5 @@
 ;;; -*- mode: Common-Lisp; Base: 10 ; Syntax: ANSI-Common-Lisp -*-
-;;; This is ASDF 2.32.3: Another System Definition Facility.
+;;; This is ASDF 2.32.4: Another System Definition Facility.
 ;;;
 ;;; Feedback, bug reports, and patches are all welcome:
 ;;; please mail to <asdf-devel@common-lisp.net>.
diff --git a/test/run-tests.sh b/test/run-tests.sh
index 3a64513c..557bb5eb 100755
--- a/test/run-tests.sh
+++ b/test/run-tests.sh
@@ -264,8 +264,8 @@ upgrade_methods () {
 'load-asdf-lisp'load-asdf-system
 'load-asdf-lisp'compile-load-asdf
 'load-asdf-lisp'load-asdf-fasl
-'load-asdf-lisp-and-test-uiop'load-asdf-fasl
 ()'load-asdf-fasl
+'load-asdf-lisp-and-test-uiop'load-asdf-fasl
 EOF
 }
 extract_tagged_asdf () {
diff --git a/test/script-support.lisp b/test/script-support.lisp
index 88e1a0e2..6231f207 100644
--- a/test/script-support.lisp
+++ b/test/script-support.lisp
@@ -356,12 +356,14 @@ is bound, write a message and exit on an error.  If
 (defmacro with-asdf-conditions ((&optional verbose) &body body)
   `(call-with-asdf-conditions #'(lambda () ,@body) ,verbose))
 
+#+clisp (trace compile-file)
+
 (defun compile-asdf (&optional tag verbose)
   (let* ((alisp (asdf-lisp tag))
          (afasl (asdf-fasl tag))
          (tmp (make-pathname :name "asdf-tmp" :defaults afasl)))
     (ensure-directories-exist afasl)
-    (multiple-value-bind (result warnings-p errors-p)
+    (multiple-value-bind (result warnings-p failure-p)
         (compile-file alisp :output-file tmp #-gcl :verbose #-gcl verbose :print verbose)
       (flet ((bad (key)
                (when result (ignore-errors (delete-file result)))
@@ -371,13 +373,20 @@ is bound, write a message and exit on an error.  If
                (rename-file tmp afasl)
                key))
         (cond
-          (errors-p (bad :errors))
+          ((null result)
+           (bad :no-output))
+          (failure-p
+           (or
+            #+clisp (good :expected-full-warnings)
+            (bad :unexpected-full-warnings)))
           (warnings-p
            (or
+            ;; CLISP has full warnings for method redefinition in eval-when.
+            ;; CMUCL: ?
             ;; ECL 11.1.1 has spurious warnings, same with XCL 0.0.0.291.
             ;; SCL has no warning but still raises the warningp flag since 2.20.15 (?)
-            #+(or cmu ecl scl xcl) (good :expected-warnings)
-          (bad :unexpected-warnings)))
+            #+(or clisp cmu ecl scl xcl) (good :expected-style-warnings)
+            (bad :unexpected-style-warnings)))
           (t (good :success)))))))
 
 (defun maybe-compile-asdf (&optional tag)
@@ -401,22 +410,29 @@ is bound, write a message and exit on an error.  If
        (leave-test "Testsuite failed: unable to find ASDF source" 3))
       (:previously-compiled
        (leave-test "Reusing previously-compiled ASDF" 0))
-      (:errors
-       (leave-test "Testsuite failed: ASDF compiled with ERRORS" 2))
-      (:unexpected-warnings
+      (:no-output
+       (leave-test "Testsuite failed: ASDF compilation failed without output" 1))
+      (:unexpected-full-warnings
+       (leave-test "Testsuite failed: ASDF compiled with unexpected full warnings" 1))
+      (:expected-full-warnings
+       (leave-test "ASDF compiled with full warnings, ignored for your implementation" 0))
+      (:unexpected-style-warnings
        (leave-test "Testsuite failed: ASDF compiled with unexpected warnings" 1))
-      (:expected-warnings
-       (leave-test "ASDF compiled with warnings, ignored for your implementation" 0))
+      (:expected-style-warnings
+       (leave-test "ASDF compiled with style-warnings, ignored for your implementation" 0))
       (:success
        (leave-test "ASDF compiled cleanly" 0)))))
 
 (defun compile-load-asdf (&optional tag)
   ;; emulate the way asdf upgrades itself: load source, compile, load fasl.
   (load-asdf-lisp tag)
-  (ecase (compile-asdf tag)
-    ((:errors :unexpected-warnings) (leave-test "failed to compile ASDF" 1))
-    ((:expected-warnings :success)
-     (load-asdf-fasl tag))))
+  (let ((results (compile-asdf tag)))
+    (ecase results
+      ((:no-output :unexpected-full-warnings :unexpected-style-warnings)
+       (warn "ASDF compiled with ~S" results)
+       (leave-test "failed to compile ASDF" 1))
+      ((:expected-full-warnings :expected-style-warnings :success)
+       (load-asdf-fasl tag)))))
 
 ;;; Now, functions to compile and load ASDF.
 
@@ -508,7 +524,8 @@ is bound, write a message and exit on an error.  If
   (register-directory *uiop-directory*)
   (register-directory *test-directory*)
   (DBG :lalatu (asymval :*central-registry*))
-  (acall :oos (asym :load-op) :uiop)
+  (quietly
+   (acall :oos (asym :load-op) :uiop))
   (acall :oos (asym :load-op) :test-module-depend))
 
 (defun load-asdf (&optional tag)
@@ -560,6 +577,10 @@ is bound, write a message and exit on an error.  If
          (funcall old-method tag))))
     (when (find-package :asdf)
       (configure-asdf))
+    (when (and (null old-method) (eq 'load-asdf-fasl new-method) (not (probe-file (asdf-fasl))))
+      (if (ignore-errors (funcall 'require "asdf") t)
+          (leave-test "Your failed to compile ASDF before your run (test-upgrade ()'load-asdf-fasl ...)"  1)
+          (leave-test "Your Lisp doesn't provide ASDF. Skipping (test-upgrade ()'load-asdf-fasl ...)"  0)))
     (format t "Now loading new asdf via method ~A~%" new-method)
     (funcall new-method)
     (format t "Testing it~%")
diff --git a/upgrade.lisp b/upgrade.lisp
index 25a688d2..c9ce110c 100644
--- a/upgrade.lisp
+++ b/upgrade.lisp
@@ -52,7 +52,7 @@ You can compare this string with e.g.: (ASDF:VERSION-SATISFIES (ASDF:ASDF-VERSIO
          ;; "3.4.5.67" would be a development version in the official upstream of 3.4.5.
          ;; "3.4.5.0.8" would be your eighth local modification of official release 3.4.5
          ;; "3.4.5.67.8" would be your eighth local modification of development version 3.4.5.67
-         (asdf-version "2.32.3")
+         (asdf-version "2.32.4")
          (existing-version (asdf-version)))
     (setf *asdf-version* asdf-version)
     (when (and existing-version (not (equal asdf-version existing-version)))
@@ -89,7 +89,8 @@ You can compare this string with e.g.: (ASDF:VERSION-SATISFIES (ASDF:ASDF-VERSIO
     (loop :for name :in (append redefined-functions)
           :for sym = (find-symbol* name :asdf nil) :do
             (when sym
-              (fmakunbound sym)))
+              ;; On CLISP we seem to be unable to fmakunbound and define a function in the same fasl. Sigh.
+              #-clisp (fmakunbound sym)))
     (loop :with asdf = (find-package :asdf)
           :for name :in uninterned-symbols
           :for sym = (find-symbol* name :asdf nil)
diff --git a/version.lisp-expr b/version.lisp-expr
index 04b886b6..ed683db1 100644
--- a/version.lisp-expr
+++ b/version.lisp-expr
@@ -1 +1 @@
-"2.32.3"
+"2.32.4"
-- 
GitLab