[asdf-devel] Patch to asdf:run-shell-command

Robert Goldman rpgoldman at sift.info
Tue May 19 00:03:11 UTC 2009


Gary King wrote:
> Hi Robert,
> 
> This looks good to me. What do you think of
> 
>     #+allegro
>     (multiple-value-bind (stdout stderr exit-code)
>         (excl.osi:command-output
>      (format nil "~a -c ~a" #+mswindows "sh" #-mswindows "/bin/sh" command)
>      :input nil :whole t
>      #+mswindows :show-window #+mswindows :hide)
>       (format *verbose-out* "~{~&; ~a~%~}~%" stderr)
>       (format *verbose-out* "~{~&; ~a~%~}~%" stdout)
>       exit-code)
> 
> instead. This tries to address your (valid I think) concern about using
> a Bourne compatible shell, add the :show-window :hide argument under
> windows and rejiggers the printout to stick a comment #\; in front of
> each line.

Looks good to me.  One thing I wondered as I wrote my draft was whether
it was better to mark the stderr and stdout lines with some inserted
comment for the reader's benefit, since those lines now can come out in
a reshuffled order.

An alternative solution would be to push the two streams (stdout and
stderr) together, and print them out in the original order.  I'm not
real sure how to do this; I haven't dug deeply enough into excl.osi.

best,
r

> 
> 
> 
> On May 17, 2009, at 4:16 PM, Robert Goldman wrote:
> 
>> Bug:  Running ACL under SLIME, asdf:run-shell-command raises an error.
>> The problem is that the *verbose-out* that is passed to
>> run-shell-command has been bound by SLIME to a gray stream.  This is not
>> an acceptable argument to pass to :output for excl:run-shell-command.
>>
>> Here is a proposed patch.
>>
>> Best,
>> r
>>
>>
>> diff --git a/asdf.lisp b/asdf.lisp
>> index aa1066b..82c9de3 100644
>> --- a/asdf.lisp
>> +++ b/asdf.lisp
>> @@ -1323,7 +1323,12 @@ output to *VERBOSE-OUT*.  Returns the shell's
>> exit code."
>>       :input nil :output *verbose-out*))
>>
>>     #+allegro
>> -    (excl:run-shell-command command :input nil :output *verbose-out*)
>> +    (multiple-value-bind (stdout stderr exit-code)
>> +        (excl.osi:command-output command :input nil :whole t)
>> +      (format *verbose-out* "; ~A~%" stderr)
>> +      (format *verbose-out* "; ~A~%" stdout)
>> +      exit-code)
>> +    ;;(excl:run-shell-command command :input nil :output *verbose-out*)
>>
>>     #+lispworks
>>     (system:call-system-showing-output
>>
>>
>> _______________________________________________
>> asdf-devel mailing list
>> asdf-devel at common-lisp.net
>> http://common-lisp.net/cgi-bin/mailman/listinfo/asdf-devel
> 
> -- 
> Gary Warren King, metabang.com
> Cell: (413) 559 8738
> Fax: (206) 338-4052
> gwkkwg on Skype * garethsan on AIM * gwking on twitter
> 
> 
> 
> 
> 





More information about the asdf-devel mailing list