r1995: rework logical pathnames to better fit common-lisp-controller
authorKevin M. Rosenberg <kevin@rosenberg.net>
Mon, 13 May 2002 00:45:43 +0000 (00:45 +0000)
committerKevin M. Rosenberg <kevin@rosenberg.net>
Mon, 13 May 2002 00:45:43 +0000 (00:45 +0000)
clsql-mysql.system
clsql-postgresql-socket.system
clsql-postgresql.system
clsql.system
set-cl-library.cl [new file with mode: 0644]
set-logical.cl

index e3068e71ebe8140fade8d1f6bc43c6fd53b6cefc..5d80be164879d85a7be0a56c196d953ddde13e2f 100644 (file)
@@ -1,42 +1,42 @@
-;;;; -*- Mode: LISP; Syntax: ANSI-Common-Lisp; Base: 10 -*-
-;;;; *************************************************************************
-;;;; FILE IDENTIFICATION
-;;;;
-;;;; Name:          clsql-mysql.system
-;;;; Purpose:       Defsystem-3/4 definition file for CLSQL MySQL backend
-;;;; Programmer:    Kevin M. Rosenberg
-;;;; Date Started:  Feb 2002
-;;;;
-;;;; $Id: clsql-mysql.system,v 1.5 2002/04/01 05:27:54 kevin Exp $
-;;;;
-;;;; This file, part of CLSQL, is Copyright (c) 2002 by Kevin M. Rosenberg
-;;;;
-;;;; CLSQL users are granted the rights to distribute and use this software
-;;;; as governed by the terms of the Lisp Lesser GNU Public License
-;;;; (http://opensource.franz.com/preamble.html), also known as the LLGPL.
-;;;; *************************************************************************
-
-(declaim (optimize (debug 3) (speed 3) (safety 1) (compilation-speed 0)))
-
-(in-package :make)
-
-;;; System definition
-
-(defsystem :clsql-mysql
-    :source-pathname "CLSQL:interfaces;mysql;"
-    :source-extension "cl"
-    :binary-pathname "CLSQL:interfaces;mysql;bin;"
-    :components ((:file "mysql-package")
-                (:file "mysql-loader" :depends-on ("mysql-package"))
-                (:file "mysql-api" :depends-on ("mysql-loader"))
-                (:file "mysql-sql" :depends-on ("mysql-api"))
-                (:file "mysql-usql" :depends-on ("mysql-sql")))
-    :depends-on (:uffi :clsql :clsql-uffi)
-    :finally-do
-    (when (clsql-sys:database-type-library-loaded :mysql)
-      (clsql-sys:initialize-database-type :database-type :mysql)
-      (setq clsql:*default-database-type* :mysql)
-      (pushnew :mysql cl:*features*)))
-
-
-
+;;;; -*- Mode: LISP; Syntax: ANSI-Common-Lisp; Base: 10 -*-\r
+;;;; *************************************************************************\r
+;;;; FILE IDENTIFICATION\r
+;;;;\r
+;;;; Name:          clsql-mysql.system\r
+;;;; Purpose:       Defsystem-3/4 definition file for CLSQL MySQL backend\r
+;;;; Programmer:    Kevin M. Rosenberg\r
+;;;; Date Started:  Feb 2002\r
+;;;;\r
+;;;; $Id: clsql-mysql.system,v 1.6 2002/05/13 00:45:10 kevin Exp $\r
+;;;;\r
+;;;; This file, part of CLSQL, is Copyright (c) 2002 by Kevin M. Rosenberg\r
+;;;;\r
+;;;; CLSQL users are granted the rights to distribute and use this software\r
+;;;; as governed by the terms of the Lisp Lesser GNU Public License\r
+;;;; (http://opensource.franz.com/preamble.html), also known as the LLGPL.\r
+;;;; *************************************************************************\r
+\r
+(declaim (optimize (debug 3) (speed 3) (safety 1) (compilation-speed 0)))\r
+\r
+(in-package :make)\r
+\r
+;;; System definition\r
+\r
+(defsystem :clsql-mysql\r
+    :source-pathname "CL-LIBRARY:clsql;interfaces;mysql;"\r
+    :source-extension "cl"\r
+    :binary-pathname "CL-LIBRARY:clsql;interfaces;mysql;bin;"\r
+    :components ((:file "mysql-package")\r
+                (:file "mysql-loader" :depends-on ("mysql-package"))\r
+                (:file "mysql-api" :depends-on ("mysql-loader"))\r
+                (:file "mysql-sql" :depends-on ("mysql-api"))\r
+                (:file "mysql-usql" :depends-on ("mysql-sql")))\r
+    :depends-on (:uffi :clsql-base :clsql-uffi)\r
+    :finally-do\r
+    (when (clsql-sys:database-type-library-loaded :mysql)\r
+      (clsql-sys:initialize-database-type :database-type :mysql)\r
+      (setq clsql:*default-database-type* :mysql)\r
+      (pushnew :mysql cl:*features*)))\r
+\r
+\r
+\r
index 1c7d0163a5a533bef7a3f5bf5a7ecf149d5830f7..197b289023ecb9c26e708263fe414aab98095c33 100644 (file)
@@ -7,7 +7,7 @@
 ;;;; Programmer:    Kevin M. Rosenberg\r
 ;;;; Date Started:  Feb 2002\r
 ;;;;\r
-;;;; $Id: clsql-postgresql-socket.system,v 1.5 2002/05/12 23:31:51 kevin Exp $\r
+;;;; $Id: clsql-postgresql-socket.system,v 1.6 2002/05/13 00:45:10 kevin Exp $\r
 ;;;;\r
 ;;;; This file, part of CLSQL, is Copyright (c) 2002 by Kevin M. Rosenberg\r
 ;;;;\r
 ;;; System definition\r
 \r
 (defsystem :clsql-postgresql-socket\r
-    :source-pathname "CLSQL:interfaces;postgresql-socket;"\r
+    :source-pathname "CL-LIBRARY:clsql;interfaces;postgresql-socket;"\r
     :source-extension "cl"\r
-    :binary-pathname "CLSQL:interfaces;postgresql-socket;bin;"\r
+    :binary-pathname "CL-LIBRARY:clsql;interfaces;postgresql-socket;bin;"\r
     :components ((:file "postgresql-socket-package")\r
                 (:file "postgresql-socket-api"\r
                        :depends-on ("postgresql-socket-package"))\r
                 (:file "postgresql-socket-sql"\r
                        :depends-on ("postgresql-socket-api")))\r
-    :depends-on (:clsql :uffi)\r
+    :depends-on (:clsql-base :uffi)\r
     :finally-do\r
     (when (clsql-sys:database-type-library-loaded :postgresql-socket)\r
       (clsql-sys:initialize-database-type :database-type :postgresql-socket)))\r
index 9b1cabd1a6a0cb8b8fe6bfd1bbbfd526f90c4807..d84a1021e6a267cc9cc2809195d53001a3353580 100644 (file)
@@ -1,37 +1,37 @@
-;;;; -*- Mode: LISP; Syntax: ANSI-Common-Lisp; Base: 10 -*-
-;;;; *************************************************************************
-;;;; FILE IDENTIFICATION
-;;;;
-;;;; Name:          clsql-postgresql.system
-;;;; Purpose:       Defsystem-3/4 file for CLSQL PostgresSQL backend
-;;;; Programmer:    Kevin M. Rosenberg
-;;;; Date Started:  Feb 2002
-;;;;
-;;;; $Id: clsql-postgresql.system,v 1.5 2002/04/01 05:27:55 kevin Exp $
-;;;;
-;;;; This file, part of CLSQL, is Copyright (c) 2002 by Kevin M. Rosenberg
-;;;;
-;;;; CLSQL users are granted the rights to distribute and use this software
-;;;; as governed by the terms of the Lisp Lesser GNU Public License
-;;;; (http://opensource.franz.com/preamble.html), also known as the LLGPL.
-;;;; *************************************************************************
-
-(declaim (optimize (debug 3) (speed 3) (safety 1) (compilation-speed 0)))
-(in-package :make)
-
-(defsystem :clsql-postgresql
-    :source-pathname "CLSQL:interfaces;postgresql;"
-    :source-extension "cl"
-    :binary-pathname "CLSQL:interfaces;postgresql;bin;"
-    :source-extension "cl"
-    :components ((:file "postgresql-package")
-                (:file "postgresql-loader" :depends-on ("postgresql-package"))
-                (:file "postgresql-api" :depends-on ("postgresql-loader"))
-                (:file "postgresql-sql" :depends-on ("postgresql-api"))
-                (:file "postgresql-usql" :depends-on ("postgresql-sql")))
-    :depends-on (:uffi :clsql :clsql-uffi)
-    :finally-do
-    (when (clsql-sys:database-type-library-loaded :postgresql)
-      (clsql-sys:initialize-database-type :database-type :postgresql)
-      (pushnew :postgresql cl:*features*)))
-
+;;;; -*- Mode: LISP; Syntax: ANSI-Common-Lisp; Base: 10 -*-\r
+;;;; *************************************************************************\r
+;;;; FILE IDENTIFICATION\r
+;;;;\r
+;;;; Name:          clsql-postgresql.system\r
+;;;; Purpose:       Defsystem-3/4 file for CLSQL PostgresSQL backend\r
+;;;; Programmer:    Kevin M. Rosenberg\r
+;;;; Date Started:  Feb 2002\r
+;;;;\r
+;;;; $Id: clsql-postgresql.system,v 1.6 2002/05/13 00:45:10 kevin Exp $\r
+;;;;\r
+;;;; This file, part of CLSQL, is Copyright (c) 2002 by Kevin M. Rosenberg\r
+;;;;\r
+;;;; CLSQL users are granted the rights to distribute and use this software\r
+;;;; as governed by the terms of the Lisp Lesser GNU Public License\r
+;;;; (http://opensource.franz.com/preamble.html), also known as the LLGPL.\r
+;;;; *************************************************************************\r
+\r
+(declaim (optimize (debug 3) (speed 3) (safety 1) (compilation-speed 0)))\r
+(in-package :make)\r
+\r
+(defsystem :clsql-postgresql\r
+    :source-pathname "CL-LIBRARY:clsql;interfaces;postgresql;"\r
+    :source-extension "cl"\r
+    :binary-pathname "CL-LIBRARY:clsql;interfaces;postgresql;bin;"\r
+    :source-extension "cl"\r
+    :components ((:file "postgresql-package")\r
+                (:file "postgresql-loader" :depends-on ("postgresql-package"))\r
+                (:file "postgresql-api" :depends-on ("postgresql-loader"))\r
+                (:file "postgresql-sql" :depends-on ("postgresql-api"))\r
+                (:file "postgresql-usql" :depends-on ("postgresql-sql")))\r
+    :depends-on (:uffi :clsql-base :clsql-uffi)\r
+    :finally-do\r
+    (when (clsql-sys:database-type-library-loaded :postgresql)\r
+      (clsql-sys:initialize-database-type :database-type :postgresql)\r
+      (pushnew :postgresql cl:*features*)))\r
+\r
index 6d1a13d0d8f04cbcab09d33288d656fa6cf9e4d9..f8143c175eb2f150ea55e60b7d28cf654a92b2e1 100644 (file)
@@ -7,7 +7,7 @@
 ;;;; Programmer:    Kevin M. Rosenberg
 ;;;; Date Started:  Feb 2002
 ;;;;
-;;;; $Id: clsql.system,v 1.8 2002/05/11 22:23:52 kevin Exp $
+;;;; $Id: clsql.system,v 1.9 2002/05/13 00:45:10 kevin Exp $
 ;;;;
 ;;;; This file, part of CLSQL, is Copyright (c) 2002 by Kevin M. Rosenberg
 ;;;;
 (declaim (optimize (debug 3) (speed 3) (safety 1) (compilation-speed 0)))
 (in-package :cl-user)
 
-(load (make-pathname :name "set-logical" :type "cl"
-                    :defaults *load-truename*))
-(set-logical-host-for-pathname "CLSQL" *load-truename*)
+(handler-case
+    (logical-pathname-translations "CL-LIBRARY")
+  (error ()
+      (load (make-pathname :name "set-cl-library" :type "cl"
+                          :defaults *load-truename*))))
 
 ;;; System definitions
 
 (mk:defsystem :cmucl-compat
-    :source-pathname "CLSQL:cmucl-compat;"
+    :source-pathname "CL-LIBRARY:clsql;cmucl-compat;"
     :source-extension "cl"
-    :binary-pathname "CLSQL:cmucl-compat;bin;"
+    :binary-pathname "CL-LIBRARY:clsql;cmucl-compat;bin;"
     :components ((:file "cmucl-compat")
                 (:file "loop-extension")))
 
 (mk:defsystem :clsql
-    :source-pathname "CLSQL:sql;"
+    :source-pathname "CL-LIBRARY:clsql;sql;"
     :source-extension "cl"
-    :binary-pathname "CLSQL:sql;bin;"
-    :components ((:file "package")
-                (:file "classes" :depends-on ("package"))
-                (:file "conditions" :depends-on ("classes"))
-                (:file "db-interface" :depends-on ("conditions"))
-                (:file "pool" :depends-on ("db-interface"))
+    :binary-pathname "CL-LIBRARY:clsql;sql;bin;"
+    :components ((:file "pool")
                 (:file "sql" :depends-on ("pool"))
                 (:file "transactions" :depends-on ("sql"))
-                (:file "utils" :depends-on ("package"))
+                (:file "utils")
                 (:file "functional" :depends-on ("sql"))
                 (:file "usql" :depends-on ("sql")))
-    :depends-on (:cmucl-compat)
+    :depends-on (:clsql-base)
     :finally-do
     (pushnew :clsql cl:*features*)
     )
diff --git a/set-cl-library.cl b/set-cl-library.cl
new file mode 100644 (file)
index 0000000..51aa42e
--- /dev/null
@@ -0,0 +1,31 @@
+;;;; -*- Mode: LISP; Syntax: ANSI-Common-Lisp; Base: 10 -*-
+;;;; *************************************************************************
+;;;; FILE IDENTIFICATION
+;;;;
+;;;; Name:          set-cl-library.cl
+;;;; Purpose:       Sets CL-LIBRARY logical host name if it does not exist
+;;;; Programmer:    Kevin M. Rosenberg
+;;;; Date Started:  May 2002
+;;;;
+;;;; This file, part of CLSQL, is Copyright (c) 2002 by Kevin M. Rosenberg
+;;;;
+;;;; CLSQL users are granted the rights to distribute and use this software
+;;;; as governed by the terms of the Lisp Lesser GNU Public License
+;;;; (http://opensource.franz.com/preamble.html), also known as the LLGPL.
+;;;; *************************************************************************
+
+;; Set logical pathname CL-LIBRARY to be directory above *load-truename*
+;; This mirrors the expectation of Common Lisp Controller's pathnames
+
+(handler-case
+    (logical-pathname-translations "CL-LIBRARY")
+  (error ()
+    (let* ((dir (pathname-directory *load-truename*))
+          (parent-dir (subseq dir 0 (1- (length dir)))))
+      (load (make-pathname :name "set-logical" :type "cl"
+                          :defaults *load-truename*))
+      (set-logical-host-for-pathname 
+       "CL-LIBRARY" 
+       (make-pathname :host (pathname-host *load-truename*)
+                     :device (pathname-device *load-truename*)
+                     :directory parent-dir)))))
index cb4224d7b98c07196d94c400c8fc5e8e7d07e183..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 100644 (file)
@@ -1,63 +0,0 @@
-;;;; -*- Mode: LISP; Syntax: ANSI-Common-Lisp; Base: 10 -*-
-;;;; *************************************************************************
-;;;; FILE IDENTIFICATION
-;;;;
-;;;; Name:          set-logical.cl
-;;;; Purpose:       Sets a logical host for src/binaries based on a pathname.
-;;;; Programmer:    Kevin M. Rosenberg
-;;;; Date Started:  Feb 2002
-;;;;
-;;;; This file, part of CLSQL, is Copyright (c) 2002 by Kevin M. Rosenberg
-;;;;
-;;;; CLSQL users are granted the rights to distribute and use this software
-;;;; as governed by the terms of the Lisp Lesser GNU Public License
-;;;; (http://opensource.franz.com/preamble.html), also known as the LLGPL.
-;;;; *************************************************************************
-
-
-;;; Setup logical pathname translaton with separate binary directories
-;;; for each implementation
-
-;; push allegro case sensitivity on *features*
-#+allegro
-(eval-when (:compile-toplevel :load-toplevel :execute)
-  (if (or (eq excl:*current-case-mode* :case-sensitive-lower)
-         (eq excl:*current-case-mode* :case-sensitive-upper))
-      (pushnew :case-sensitive cl:*features*)
-    (pushnew :case-insensitive cl:*features*)))
-
-(defconstant +set-logical-compiler-name+
-    #+(and allegro ics case-sensitive) "acl-modern"
-    #+(and allegro (not ics) case-sensitive) "acl-modern8"
-    #+(and allegro ics (not case-sensitive)) "acl-ansi"
-    #+(and allegro (not ics) (not case-sensitive)) "acl-ansi8"
-    #+lispworks "lispworks"
-    #+clisp "clisp"
-    #+cmu "cmucl"
-    #+sbcl "sbcl"
-    #+corman "corman"
-    #+mcl "mcl"
-    #+openmcl "openmcl"
-    #-(or allegro lispworks clisp cmu sbcl corman mcl openmcl) "unknown")
-
-(defun set-logical-host-for-pathname (host base-pathname)
-  (setf (logical-pathname-translations host)
-    `(("ROOT;" ,(make-pathname
-               :host (pathname-host base-pathname)
-               :device (pathname-device base-pathname)
-               :directory (pathname-directory base-pathname)))
-      ("**;bin;*.*.*" ,(merge-pathnames
-                       (make-pathname 
-                        :name :wild
-                        :type :wild
-                        :directory 
-                        (append '(:relative :wild-inferiors
-                                  ".bin" #.+set-logical-compiler-name+)))
-                       base-pathname))
-      ("**;*.*.*" ,(merge-pathnames
-                   (make-pathname
-                    :name :wild
-                    :type :wild
-                    :directory '(:relative :wild-inferiors))
-                   base-pathname))))
-  )