[PATCH] Fix compilation errors with sbcl 1.0.31.0.debian

Rupert Swarbrick <rswarbrick-gM/[email protected]> Sun, 25 Apr 2010 19:23:25 +0100
Newsgroups gmane.lisp.clsql.general
Message-ID <[email protected]>
For some reason, clsql uffi and mysql modules weren't compiling anymore
on my system. It seems that something had changed (maybe sbcl's asdf?
not sure) which meant that operation-done-p was called before certain
packages had been created and then calls like

  (intern "MYSQL-GET-CLIENT-INFO" nil)

caused errors. I've attached a (truly trivial) fix.


Rupert

_______________________________________________
CLSQL mailing list
[email protected]
http://lists.b9.com/cgi-bin/mailman/listinfo/clsql
0001-Fix-bug-where-operation-done-p-was-called-before-loa.patch (text/x-diff, 1.3 KB)
From 332eba37d5ac8e774a0319a9f53949e4a93cbeb0 Mon Sep 17 00:00:00 2001
From: Rupert Swarbrick <[email protected]>
Date: Sun, 25 Apr 2010 17:50:20 +0100
Subject: [PATCH] Fix bug where operation-done-p was called before loading the definition
 of packages, causing errors when calling (intern "foo" nil).

---
 clsql-mysql.asd |    3 ++-
 clsql-uffi.asd  |    3 ++-
 2 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/clsql-mysql.asd b/clsql-mysql.asd
index 6f4acfb..12b8479 100644
--- a/clsql-mysql.asd
+++ b/clsql-mysql.asd
@@ -48,7 +48,8 @@
   t)
 
 (defmethod operation-done-p ((o load-op) (c clsql-mysql-source-file))
-  (and (symbol-function (intern (symbol-name '#:mysql-get-client-info)
+  (and (find-package '#:mysql)
+       (symbol-function (intern (symbol-name '#:mysql-get-client-info)
 				(find-package '#:mysql)))
        t))
 
diff --git a/clsql-uffi.asd b/clsql-uffi.asd
index 53c6152..5629d45 100644
--- a/clsql-uffi.asd
+++ b/clsql-uffi.asd
@@ -48,7 +48,8 @@
   nil) ;;; library will be loaded by a loader file
 
 (defmethod operation-done-p ((o load-op) (c clsql-uffi-source-file))
-  (and (symbol-function (intern (symbol-name '#:atol64)
+  (and (find-package '#:clsql-uffi)
+       (symbol-function (intern (symbol-name '#:atol64)
 				(find-package '#:clsql-uffi)))
        t))
 
-- 
1.7.0.5
signature.asc (application/pgp-signature, 315 B)
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (GNU/Linux)

iJwEAQECAAYFAkvUiJ0ACgkQRtd/pJbYVoZCnAQAgjRNmT+ZZ0BOe/LdTRisT1MU
Py34KJ1rjw+fh4s5XjubskxKX0XXoMkzDZjNZAIOpI6Nt35hlAPSxYuVMOJB6wT2
C6KbpNX9HRgNpWxs3bS06t9T/Ijgpu0QsEGt/wNGJYvj25rkZjzr7IW/jTzG3Arv
3L7hmcjw1iAsRwDyIZY=
=IcQ3
-----END PGP SIGNATURE-----