0.8.17.18:
authorChristophe Rhodes <csr21@cam.ac.uk>
Fri, 3 Dec 2004 12:49:45 +0000 (12:49 +0000)
committerChristophe Rhodes <csr21@cam.ac.uk>
Fri, 3 Dec 2004 12:49:45 +0000 (12:49 +0000)
Fix for a couple of Unicode-related bugs.
... KLUDGE around the non-existence of proper external-format
support in GET-DESCRIPTOR-FOR / RUN-PROGRAM;
... hideous hack in asdf-install to allow downloads of binary data
through character streams.

NEWS
contrib/asdf-install/installer.lisp
src/code/run-program.lisp
tests/run-program.test.sh
version.lisp-expr

diff --git a/NEWS b/NEWS
index bbe115d..bf75bd5 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -16,6 +16,11 @@ changes in sbcl-0.8.18 relative to sbcl-0.8.17:
   * bug fix: RANDOM can be compiled when the compiler derives the type
     of its numeric argument as a disjoint set of small integers.
     (reported by Paul Dietz)
+  * fixed some bugs related to Unicode integration:
+    ** RUN-PROGRAM can allow its child to take input from a Lisp
+       stream.  (reported by Stefan Scholl)
+    ** ASDF-INSTALL successfully downloads .tar.gz files in all
+       locales.  (reported by Ken Causey)
   * fixed some bugs revealed by Paul Dietz' test suite:
     ** INCF, DECF and REMF evaluate their place form as specified in
        CLtS 5.1.3.
index d17d7e1..3acb93a 100644 (file)
     (socket-connect
      s (car (host-ent-addresses (get-host-by-name (url-host (or *proxy* url)))))
      (url-port (or  *proxy* url)))
-    (let ((stream (socket-make-stream s :input t :output t :buffering :full)))
+    (let ((stream (socket-make-stream s :input t :output t :buffering :full :external-format :iso-8859-1)))
       ;; we are exceedingly unportable about proper line-endings here.
       ;; Anyone wishing to run this under non-SBCL should take especial care
       (format stream "GET ~A HTTP/1.0~%Host: ~A~%Cookie: CCLAN-SITE=~A~%~%"
        (format t "Downloading ~A bytes from ~A ..."
                (if length length "some unknown number of") url)
        (force-output)
-       (with-open-file (o file-name :direction :output)
+       (with-open-file (o file-name :direction :output :external-format :iso-8859-1)
          (if length
              (let ((buf (make-array length
                                     :element-type
-                                    (stream-element-type stream)  )))
+                                    (stream-element-type stream))))
                (read-sequence buf stream)
                (write-sequence buf o)) 
              (sb-executable:copy-stream stream o))))
index 408b050..f2dfe10 100644 (file)
                            (read-line object nil nil)
                          (unless line
                            (return))
-                         (sb-unix:unix-write fd line 0 (length line))
+                         (sb-unix:unix-write
+                           fd
+                           ;; FIXME: this really should be
+                           ;; (STRING-TO-OCTETS :EXTERNAL-FORMAT ...).
+                           ;; RUN-PROGRAM should take an
+                           ;; external-format argument, which should
+                           ;; be passed down to here.  Something
+                           ;; similar should happen on :OUTPUT, too.
+                           (map '(vector (unsigned-byte 8)) #'char-code line)
+                           0 (length line))
                          (if no-cr
                              (return)
                              (sb-unix:unix-write fd newline 0 1)))))
index 84a93c5..00399d1 100644 (file)
@@ -57,6 +57,13 @@ ${SBCL:-sbcl} <<EOF
   ;; That's not just because POSIX-ENVIRON is having a bad hair
   ;; day and returning NIL, is it?
   (assert (plusp (length (sb-ext:posix-environ))))
+  ;; make sure that a stream input argument is basically reasonable.
+  (let ((string (let ((i (make-string-input-stream "abcdef")))
+                  (with-output-to-string (stream)
+                    (sb-ext:run-program "/bin/cat" ()
+                                        :input i :output stream)))))
+    (assert (= (length string) 6))
+    (assert (string= string "abcdef")))
   ;; success convention for this Lisp program run as part of a larger script
   (sb-ext:quit :unix-status 52)))
 EOF
index 5312281..de95c52 100644 (file)
@@ -17,4 +17,4 @@
 ;;; checkins which aren't released. (And occasionally for internal
 ;;; versions, especially for internal versions off the main CVS
 ;;; branch, it gets hairier, e.g. "0.pre7.14.flaky4.13".)
-"0.8.17.17"
+"0.8.17.18"