From 7e917a9ade6a1b2655210634a738265661143c62 Mon Sep 17 00:00:00 2001
From: Francois-Rene Rideau <tunes@google.com>
Date: Mon, 21 Jan 2013 21:50:44 -0500
Subject: [PATCH] 2.26.140: fix a pathname bug found by clisp, work around
 clisp issues.

---
 TODO                              |  5 ++-
 asdf.asd                          |  2 +-
 defsystem.lisp                    |  2 +-
 doc/asdf.texinfo                  |  9 +++++-
 header.lisp                       |  2 +-
 test/make-hello-world.lisp        |  2 +-
 test/test-system-pathnames.asd    |  9 ------
 test/test-system-pathnames.script | 53 ++++++++++++++-----------------
 upgrade.lisp                      |  2 +-
 utility.lisp                      |  2 +-
 version.lisp-expr                 |  2 +-
 11 files changed, 43 insertions(+), 47 deletions(-)
 delete mode 100644 test/test-system-pathnames.asd

diff --git a/TODO b/TODO
index b87b774d0..78fb19069 100644
--- a/TODO
+++ b/TODO
@@ -1,4 +1,7 @@
-* 2.6.134: fix u (abcl, ccl, clisp, cmucl)
+* Bug found by fe[nl]ix: infinite loop if the definitions in an asd file
+  are not in strict dependency order.
+* fix upgrade on (abcl, clisp, cmucl)
+** Extract minimal test case
 * Learn to use cl-grid-test, to make sure ASDF changes don't break stuff,
  and that breakage gets fixed quickly.
 * Test stassats's thing:
diff --git a/asdf.asd b/asdf.asd
index 23d408b32..8d765b403 100644
--- a/asdf.asd
+++ b/asdf.asd
@@ -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.139" ;; to be automatically updated by make bump-version
+  :version "2.26.140" ;; to be automatically updated by make bump-version
   :depends-on ()
   :components ((:module "build" :components ((:file "asdf"))))
   :in-order-to (#+asdf2.27 (compile-op (monolithic-load-concatenated-source-op asdf/defsystem))))
diff --git a/defsystem.lisp b/defsystem.lisp
index 0946be313..59e7fdce3 100644
--- a/defsystem.lisp
+++ b/defsystem.lisp
@@ -34,7 +34,7 @@
   (check-type pathname (or null string pathname))
   (absolutize-pathnames
    (list pathname (load-pathname) *default-pathname-defaults* (getcwd))
-   :resolve-symlinks *resolve-symlinks*))
+   :type :directory :resolve-symlinks *resolve-symlinks*))
 
 
 ;;; Component class
diff --git a/doc/asdf.texinfo b/doc/asdf.texinfo
index 3d1a902b8..ab1de162b 100644
--- a/doc/asdf.texinfo
+++ b/doc/asdf.texinfo
@@ -21,6 +21,12 @@
 @macro &body
 &body
 @end macro
+@macro &curly
+{
+@end macro
+@macro &ylruc
+}
+@end macro
 
 @c for install-info
 @dircategory Software development
@@ -266,7 +272,8 @@ or none at all:
                                (find-symbol (string :*asdf-revision*) :asdf)))))
     (etypecase ver
       (string ver)
-      (cons (format nil "~{~D~^.~}" ver))
+      (cons (with-output-to-string (s)
+              (loop for (n . m) on ver do (princ n s) (when m (princ "." s)))))
       (null "1.0"))))
 @end lisp
 
diff --git a/header.lisp b/header.lisp
index 4cf1cab26..61d773ddc 100644
--- a/header.lisp
+++ b/header.lisp
@@ -1,5 +1,5 @@
 ;; -*- mode: Common-Lisp; Base: 10 ; Syntax: ANSI-Common-Lisp ; coding: utf-8 -*-
-;;; This is ASDF 2.26.139: Another System Definition Facility.
+;;; This is ASDF 2.26.140: Another System Definition Facility.
 ;;;
 ;;; Feedback, bug reports, and patches are all welcome:
 ;;; please mail to <asdf-devel@common-lisp.net>.
diff --git a/test/make-hello-world.lisp b/test/make-hello-world.lisp
index c8be60581..82fe3932b 100644
--- a/test/make-hello-world.lisp
+++ b/test/make-hello-world.lisp
@@ -1,6 +1,6 @@
 ;;; -*- Lisp -*-
 #+lispworks (lispworks:load-all-patches)
-(load "script-support.lisp")
+(load (make-pathname :name "script-support" :defaults *load-pathname*))
 (load-asdf)
 #+ecl (require :cmp)
 
diff --git a/test/test-system-pathnames.asd b/test/test-system-pathnames.asd
deleted file mode 100644
index 8be217a38..000000000
--- a/test/test-system-pathnames.asd
+++ /dev/null
@@ -1,9 +0,0 @@
-;;; -*- Lisp -*-
-
-(defsystem :test-system-pathnames
-  :pathname "sources/level1"
-  :components
-  ((:file "file1")
-   (:file "file2" :pathname "level2/file2")
-   (:static-file "level2/static.file")
-   (:static-file "test-tmp.cl")))
diff --git a/test/test-system-pathnames.script b/test/test-system-pathnames.script
index 94722b759..2130cb6b6 100644
--- a/test/test-system-pathnames.script
+++ b/test/test-system-pathnames.script
@@ -1,36 +1,31 @@
 ;;; -*- Lisp -*-
 
+(trace parse-unix-namestring asdf::determine-system-directory)
 
+(defsystem :test-system-pathnames
+  :pathname "sources/level1"
+  :components
+  ((:file "file1")
+   (:file "file2" :pathname "level2/file2")
+   (:static-file "level2/static.file")
+   (:static-file "test-tmp.cl")))
 
-(progn
- (asdf:load-system 'test-system-pathnames)
- (assert (find-package :test-package)
-         () "package test-package not found")
- (assert (find-symbol (symbol-name '*file-tmp*) :test-package)
-         () "symbol `*file-tmp*` not found")
- (assert (symbol-value (find-symbol (symbol-name '*file-tmp*) :test-package))
-         () "symbol `*file-tmp*` has wrong value")
+(load-system 'test-system-pathnames)
 
- (assert (probe-file
-          (apply-output-translations
-           (merge-pathnames*
-            (make-pathname*
-             :name "file1"
-             :type (compile-file-type)
-             :directory '(:relative "sources" "level1"))
-            *test-directory*)))
-         () "compiled file not found")
+(assert (find-package :test-package)
+        () "package test-package not found")
+(assert (find-symbol (symbol-name '*file-tmp*) :test-package)
+        () "symbol `*file-tmp*` not found")
+(assert (symbol-value (find-symbol (symbol-name '*file-tmp*) :test-package))
+        () "symbol `*file-tmp*` has wrong value")
 
- (assert (find-symbol (symbol-name '*file-tmp2*) :test-package) nil
-         "symbol `*file-tmp2*` not found")
- (assert (symbol-value (find-symbol (symbol-name '*file-tmp2*) :test-package))
-         nil "symbol `*file-tmp2*` has wrong value")
+(assert (probe-file (test-fasl "sources/level1/file1"))
+        () "compiled file not found")
 
- (assert (probe-file
-          (apply-output-translations
-           (merge-pathnames*
-            (make-pathname*
-             :name "file2"
-             :type (compile-file-type)
-             :directory '(:relative "sources" "level1" "level2")))))
-         nil "compiled file not found"))
+(assert (find-symbol (symbol-name '*file-tmp2*) :test-package) nil
+        "symbol `*file-tmp2*` not found")
+(assert (symbol-value (find-symbol (symbol-name '*file-tmp2*) :test-package))
+        () "symbol `*file-tmp2*` has wrong value")
+
+(assert (probe-file (test-fasl "sources/level1/level2/file2"))
+        () "compiled file not found")
diff --git a/upgrade.lisp b/upgrade.lisp
index f651f3d8d..29c6059bf 100644
--- a/upgrade.lisp
+++ b/upgrade.lisp
@@ -35,7 +35,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.139")
+         (asdf-version "2.26.140")
          (existing-asdf (find-class (find-symbol* :component :asdf nil) nil))
          (existing-version *asdf-version*)
          (already-there (equal asdf-version existing-version))
diff --git a/utility.lisp b/utility.lisp
index 97d91c0d5..507113029 100644
--- a/utility.lisp
+++ b/utility.lisp
@@ -63,7 +63,7 @@
              ;; We usually try to do it only for the functions that need it,
              ;; which happens in asdf/upgrade - however, for ECL, we need this hammer,
              ;; (which causes issues in clisp)
-               ,@(when (or supersede #+(or ecl (and gcl (not gcl-pre2.7))) t) ; XXX
+               ,@(when (or #-clisp supersede #+(or ecl (and gcl (not gcl-pre2.7))) t) ; XXX
                    `((undefine-function ',name)))
                #-gcl ; gcl 2.7.0 notinline functions lose secondary return values :-(
                ,@(when (and #+ecl (symbolp name)) ; fails for setf functions on ecl
diff --git a/version.lisp-expr b/version.lisp-expr
index de354a3a4..77372eab4 100644
--- a/version.lisp-expr
+++ b/version.lisp-expr
@@ -1 +1 @@
-"2.26.139"
+"2.26.140"
-- 
GitLab