From 19cd244ce42bcaffee95f5f07fb7bc960238f490 Mon Sep 17 00:00:00 2001 From: Francois-Rene Rideau <tunes@google.com> Date: Wed, 17 Apr 2013 14:08:50 -0400 Subject: [PATCH] 2.33.5: treat T as an alias for *standard-output* in slurp-input-stream And thus in run-program and run-shell-command. Add a test for capturing output with run-shell-command -- yuck. --- asdf.asd | 2 +- backward-interface.lisp | 2 +- header.lisp | 2 +- test/test-run-program.script | 13 +++++++++++++ uiop/run-program.lisp | 4 ++++ upgrade.lisp | 2 +- version.lisp-expr | 2 +- 7 files changed, 22 insertions(+), 5 deletions(-) diff --git a/asdf.asd b/asdf.asd index e2b92fc9..2780bb2e 100644 --- a/asdf.asd +++ b/asdf.asd @@ -74,7 +74,7 @@ :licence "MIT" :description "Another System Definition Facility" :long-description "ASDF builds Common Lisp software organized into defined systems." - :version "2.33.4" ;; to be automatically updated by make bump-version + :version "2.33.5" ;; to be automatically updated by make bump-version :depends-on () #+asdf3 :encoding #+asdf3 :utf-8 ;; For most purposes, asdf itself specially counts as a builtin system. diff --git a/backward-interface.lisp b/backward-interface.lisp index cbec61d8..3736008a 100644 --- a/backward-interface.lisp +++ b/backward-interface.lisp @@ -131,7 +131,7 @@ output to *VERBOSE-OUT*. Returns the shell's exit code. PLEASE DO NOT USE. Deprecated function, for backward-compatibility only. -Please use ASDF-DRIVER:RUN-PROGRAM instead." +Please use UIOP:RUN-PROGRAM instead." (let ((command (apply 'format nil control-string args))) (asdf-message "; $ ~A~%" command) (run-program command :force-shell t :ignore-error-status t :output *verbose-out*)))) diff --git a/header.lisp b/header.lisp index d84fc911..5b524889 100644 --- a/header.lisp +++ b/header.lisp @@ -1,5 +1,5 @@ ;;; -*- mode: Common-Lisp; Base: 10 ; Syntax: ANSI-Common-Lisp -*- -;;; This is ASDF 2.33.4: Another System Definition Facility. +;;; This is ASDF 2.33.5: Another System Definition Facility. ;;; ;;; Feedback, bug reports, and patches are all welcome: ;;; please mail to <asdf-devel@common-lisp.net>. diff --git a/test/test-run-program.script b/test/test-run-program.script index 606f8580..31e1b728 100644 --- a/test/test-run-program.script +++ b/test/test-run-program.script @@ -1,3 +1,4 @@ +;; -*- Lisp -*- (declaim (optimize (debug 3) (safety 3))) (assert-equal '("ok 1") (run-program "echo ok 1" :output :lines)) @@ -13,6 +14,18 @@ (error "Failed to capture exit status indicating shell command failure.")) (unless (equal 0 (run-shell-command "./good-shell-command")) (error "Failed to capture exit status indicating shell command failure.")) +(let ((ok1 (format nil "; $ echo ok 1~%ok 1~%"))) + (assert-equal + (with-output-to-string (s) + (let ((*verbose-out* s)) + (run-shell-command "echo ~A 1" "ok"))) + ok1) + (assert-equal + (with-output-to-string (s) + (let ((*verbose-out* t) + (*standard-output* s)) + (run-shell-command "echo ok ~D" 1))) + ok1)) ;; NB1: run-shell-command is deprecated. Use run-program instead. ;; NB2: we do NOT support stderr capture to *verbose-out* anymore in run-shell-command. ;; If you want 2>&1 redirection, you know where to find it. diff --git a/uiop/run-program.lisp b/uiop/run-program.lisp index 7d6a10f2..614a3455 100644 --- a/uiop/run-program.lisp +++ b/uiop/run-program.lisp @@ -176,6 +176,10 @@ by /bin/sh in POSIX" (declare (ignorable x)) (slurp-stream-form stream :at at)) + (defmethod slurp-input-stream ((x (eql t)) stream &rest keys &key &allow-other-keys) + (declare (ignorable x)) + (apply 'slurp-input-stream *standard-output* stream keys)) + (defmethod slurp-input-stream (x stream &key linewise prefix (element-type 'character) buffer-size &allow-other-keys) diff --git a/upgrade.lisp b/upgrade.lisp index 328bc4c2..b13ecf15 100644 --- a/upgrade.lisp +++ b/upgrade.lisp @@ -52,7 +52,7 @@ You can compare this string with e.g.: (ASDF:VERSION-SATISFIES (ASDF:ASDF-VERSIO ;; "3.4.5.67" would be a development version in the official upstream of 3.4.5. ;; "3.4.5.0.8" would be your eighth local modification of official release 3.4.5 ;; "3.4.5.67.8" would be your eighth local modification of development version 3.4.5.67 - (asdf-version "2.33.4") + (asdf-version "2.33.5") (existing-version (asdf-version))) (setf *asdf-version* asdf-version) (when (and existing-version (not (equal asdf-version existing-version))) diff --git a/version.lisp-expr b/version.lisp-expr index 80bf63d4..1ef4005b 100644 --- a/version.lisp-expr +++ b/version.lisp-expr @@ -1 +1 @@ -"2.33.4" +"2.33.5" -- GitLab