[bknr-devel] compilation with cmucl-19d

Kamen TOMOV kamen at cybuild.com
Thu Jul 12 18:08:39 UTC 2007


Hans,

CXML continued breaking the compilation so I isolated it completely
from bknr-datastore. In order to do so I had to remove two
dependancies - one in the bknr-utils package and one in bknr-indices.

The dependancy in bknr-indices appears to be bogus and it was easy to
remove. The dependancy in bknr-utils was not and in fact it might need
a bit more work. Generally, I created a new module "xml" where I put
the removed functionality. I don't know if this is the best idea
(perhaps it belongs to some other module).

I am sending you the diffs. I haven't tested it because I don't use
many of the modules. I have worked only in the bknr/src directory so
it might break stuff in your projects.

Generally, it would be best if there are no dependancies, but as
nothing is perfect let's make them less. Parhaps bknr-utils can be
shortened more, but currently I do not have an immediate need for
that.

Regards,

-- 
Kamen

Index: xml-impex/package.lisp
===================================================================
--- xml-impex/package.lisp      (revision 2168)
+++ xml-impex/package.lisp      (working copy)
@@ -13,6 +13,7 @@
        #+sbcl
        :sb-pcl
        :bknr.utils
+       :bknr.xml
        :bknr.indices)
 
   (:export #:xml-class
Index: bknr-impex.asd
===================================================================
--- bknr-impex.asd      (revision 2168)
+++ bknr-impex.asd      (working copy)
@@ -21,7 +21,7 @@
   :description "BKNR XML import/export"
   :long-description ""
 
-  :depends-on (:cl-interpol :cxml :bknr-utils :bknr-indices)
+  :depends-on (:cl-interpol :cxml :bknr-utils :bknr-xml :bknr-indices)
 
   :components ((:module "xml-impex"
                        :components
Index: packages.lisp
===================================================================
--- packages.lisp       (revision 2168)
+++ packages.lisp       (working copy)
@@ -26,7 +26,7 @@
           #:start-cron))
 
 (defpackage :bknr.rss
-  (:use :cl :cl-user :cl-ppcre :bknr.utils :puri :cxml-xmls :bknr.datastore :bknr.indices :cxml)
+  (:use :cl :cl-user :cl-ppcre :bknr.utils :bknr.xml :puri :cxml-xmls :bknr.datastore :bknr.indices :cxml)
   (:export #:xml-escape
           #:*img-src-scanner*
           #:*a-href-scanner*
@@ -189,6 +189,7 @@
        :bknr.indices
        :bknr.impex
        :bknr.utils
+       :bknr.xml
        :bknr.events
        :bknr.user)
   (:shadowing-import-from :cl-interpol #:quote-meta-chars)
Index: xml/package.lisp
===================================================================
--- xml/package.lisp    (revision 0)
+++ xml/package.lisp    (revision 0)
@@ -0,0 +1,15 @@
+(in-package :cl-user)
+
+(defpackage :bknr.xml
+  (:use :cl
+       :cl-ppcre
+        :cl-interpol
+       :cxml-xmls)
+  (:export
+   #:node-children-nodes
+   #:find-child
+   #:find-children
+   #:node-string-body
+   #:node-attribute
+   #:node-child-string-body
+   #:node-to-html))
\ No newline at end of file
Index: xml/xml.lisp
===================================================================
--- xml/xml.lisp        (revision 0)
+++ xml/xml.lisp        (revision 0)
@@ -0,0 +1,63 @@
+(in-package :bknr.xml)
+
+(defun node-children-nodes (xml)
+  (remove-if-not #'consp (node-children xml)))
+
+(defun find-child (xml node-name)
+  (let ((children (node-children-nodes xml)))
+    (find node-name children :test #'string-equal :key #'node-name)))
+
+(defun find-children (xml node-name)
+  (let ((children (node-children-nodes xml)))
+    (find-all node-name children :test #'string-equal :key #'node-name)))
+
+(defun node-string-body (xml)
+  (let ((children (remove-if #'consp (node-children xml))))
+    (if (every #'stringp children)
+       (apply #'concatenate 'string children)
+       (error "Some children are not strings"))))
+
+(defun node-attribute (xml attribute-name)
+  (cadr (assoc attribute-name (node-attrs xml) :test #'string-equal)))
+
+(defun node-child-string-body (xml node-name)
+  (let ((child (find-child xml node-name)))
+    (if (and child (consp child))
+       (node-string-body child)
+       nil)))
+
+(defun node-to-html (node &optional (stream *standard-output*))
+  (when (stringp node)
+    (write-string node)
+    (return-from node-to-html))
+  (write-char #\< stream)
+  (when (node-ns node)
+    (write-string (node-ns node) stream)
+    (write-char #\: stream))
+  (write-string (node-name node) stream)
+  (loop for (key value) in (node-attrs node)
+       do (write-char #\Space stream)
+       (write-string key stream)
+       (write-char #\= stream)
+       (write-char #\" stream)
+       (write-string value stream)
+       (write-char #\" stream))
+  (if (node-children node)
+      (progn 
+       (write-char #\> stream)
+       (write-char #\Newline stream)
+       (dolist (child (node-children node))
+         (node-to-html child stream))
+       (write-char #\< stream)
+       (write-char #\/ stream)
+       (when (node-ns node)
+         (write-string (node-ns node) stream)
+         (write-char #\: stream))
+       (write-string (node-name node) stream)
+       (write-char #\> stream)
+       (write-char #\Newline stream))
+      (progn (write-char #\Space stream)
+            (write-char #\/ stream)
+            (write-char #\> stream)
+            (write-char #\Newline stream))))
+
Index: bknr-utils.asd
===================================================================
--- bknr-utils.asd      (revision 2168)
+++ bknr-utils.asd      (working copy)
@@ -17,7 +17,6 @@
     :description "baikonour - launchpad for lisp satellites"
 
     :depends-on (:cl-interpol :cl-ppcre
-                             :cxml
                              :md5
                              #+(not allegro)
                              :acl-compat
@@ -37,7 +36,6 @@
                                               (:file "base64" :depends-on ("utils"))
                                               (:file "capability" :depends-on ("utils"))
                                               (:file "make-fdf-file" :depends-on ("utils"))
-                                              (:file "xml" :depends-on ("utils"))
                                               (:file "date-calc")
                                               (:file "acl-mp-compat" :depends-on ("package"))))))
 
Index: utils/package.lisp
===================================================================
--- utils/package.lisp  (revision 2168)
+++ utils/package.lisp  (working copy)
@@ -4,7 +4,6 @@
   (:use :cl
        :cl-ppcre
        :cl-interpol
-       :cxml-xmls
        :md5
         #+cmu :extensions
 ;      #+sbcl :sb-ext
@@ -122,15 +121,6 @@
           #:string-beginning-with-p
           #:string-delimited-by-p
 
-          ;; xml
-          #:node-children-nodes
-          #:find-child
-          #:find-children
-          #:node-string-body
-          #:node-attribute
-          #:node-child-string-body
-          #:node-to-html
-
           ;; crypt-md5
           #:crypt-md5
           #:verify-md5-password
Index: utils/xml.lisp
===================================================================
--- utils/xml.lisp      (revision 2168)
+++ utils/xml.lisp      (working copy)
@@ -1,63 +0,0 @@
-(in-package :bknr.utils)
-
-(defun node-children-nodes (xml)
-  (remove-if-not #'consp (node-children xml)))
-
-(defun find-child (xml node-name)
-  (let ((children (node-children-nodes xml)))
-    (find node-name children :test #'string-equal :key #'node-name)))
-
-(defun find-children (xml node-name)
-  (let ((children (node-children-nodes xml)))
-    (find-all node-name children :test #'string-equal :key #'node-name)))
-
-(defun node-string-body (xml)
-  (let ((children (remove-if #'consp (node-children xml))))
-    (if (every #'stringp children)
-       (apply #'concatenate 'string children)
-       (error "Some children are not strings"))))
-
-(defun node-attribute (xml attribute-name)
-  (cadr (assoc attribute-name (node-attrs xml) :test #'string-equal)))
-
-(defun node-child-string-body (xml node-name)
-  (let ((child (find-child xml node-name)))
-    (if (and child (consp child))
-       (node-string-body child)
-       nil)))
-
-(defun node-to-html (node &optional (stream *standard-output*))
-  (when (stringp node)
-    (write-string node)
-    (return-from node-to-html))
-  (write-char #\< stream)
-  (when (node-ns node)
-    (write-string (node-ns node) stream)
-    (write-char #\: stream))
-  (write-string (node-name node) stream)
-  (loop for (key value) in (node-attrs node)
-       do (write-char #\Space stream)
-       (write-string key stream)
-       (write-char #\= stream)
-       (write-char #\" stream)
-       (write-string value stream)
-       (write-char #\" stream))
-  (if (node-children node)
-      (progn 
-       (write-char #\> stream)
-       (write-char #\Newline stream)
-       (dolist (child (node-children node))
-         (node-to-html child stream))
-       (write-char #\< stream)
-       (write-char #\/ stream)
-       (when (node-ns node)
-         (write-string (node-ns node) stream)
-         (write-char #\: stream))
-       (write-string (node-name node) stream)
-       (write-char #\> stream)
-       (write-char #\Newline stream))
-      (progn (write-char #\Space stream)
-            (write-char #\/ stream)
-            (write-char #\> stream)
-            (write-char #\Newline stream))))
-
Index: bknr-xml.asd
===================================================================
--- bknr-xml.asd        (revision 0)
+++ bknr-xml.asd        (revision 0)
@@ -0,0 +1,21 @@
+;; -*-Lisp-*-
+
+(in-package :cl-user)
+
+(defpackage :bknr.xml.system
+  (:use :cl :asdf))
+
+(in-package :bknr.xml.system)
+
+(defsystem :bknr-xml
+    :name "baikonour"
+    :author "Hans Huebner <hans at huebner.org>"
+    :author "Manuel Odendahl <manuel at bl0rg.net>"
+    :version "0"
+    :maintainer "Manuel Odendahl <manuel at bl0rg.net>"
+    :licence "BSD"
+    :description "baikonour - launchpad for lisp satellites"
+    :depends-on (:cl-interpol :cxml)
+    :components ((:module "xml" :components ((:file "package")
+                                            (:file "xml")))))
+
Index: bknr.asd
===================================================================
--- bknr.asd    (revision 2168)
+++ bknr.asd    (working copy)
@@ -28,6 +28,7 @@
                 :cxml
                 :unit-test
                 :bknr-utils
+                :bknr-xml
                 :puri
                 ;:stem
                 ;:mime
Index: indices/package.lisp
===================================================================
--- indices/package.lisp        (revision 2168)
+++ indices/package.lisp        (working copy)
@@ -6,7 +6,6 @@
        #+cmu :ext
        #+sbcl :sb-ext
        :cl-user
-       :cxml
        :bknr.utils
        :bknr.skip-list
        #+allegro :aclmop



More information about the Bknr-devel mailing list