[Vm-dev] MVM
Fabio Niephaus
lists at fniephaus.com
Tue Mar 20 15:28:26 UTC 2018
Hi Tobias,
On Tue, Mar 20, 2018 at 2:16 PM Tobias Pape <Das.Linux at gmx.de> wrote:
>
> Hi all, especially Eliot
>
> I accidentally committed an experiment but I think it's worthwile.
>
> Look at
> https://github.com/OpenSmalltalk/opensmalltalk-vm/blob/Cog/build.linux32x86/squeak.cog.spur/build.debug/mvm#L36
>
> I replaced
> make install-squeak install-plugins prefix=`(cd
> ../../../;pwd)`/products/$INSTALLDIR 2>&1 | tee LOG
> with
> exec \
> script -f -q -e -c \
> "make install-squeak install-plugins prefix=`(cd
> ../../../;pwd)`/products/$INSTALLDIR" \
> >(sed "s/\x1B\[\([0-9]\{1,2\}\(;[0-9]\{1,2\}\)\?\)\?[mGK]//g"
> > LOG)
>
> Which amounts to nearly the same result (compile outputs to terminal and
> to LOGfile)
> but the script do not see the redirection. The idea is to preserve Color
> output for terminal and travis (because it is actually really useful) but
> strip all Ansi stuff for the LOG file (hence the sed script).
>
> I had this for quite some weeks now and it works fine (no extra deps, its
> all (script, sed) there on unixes)
>
> What do you all think?
>
The purpose (preserving colors) is great, the readability of the script not
so much IMHO.
Could this magic script be extracted into some more meaningful helper
function like `runAndLogWhilePreservingColors`? A brief explanation of how
the magic works could also be helpful. I literally stopped trying to parse
the script in my head after seeing all the flags for `script`.
Best,
Fabio
>
> Best regards
> -Tobias
>
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.squeakfoundation.org/pipermail/vm-dev/attachments/20180320/39333da6/attachment.html>
More information about the Vm-dev
mailing list