[bootlin/training-materials updates] master: common/labs: workaround to avoid bashinput to break "8M" (1c03a602)

Luca Ceresoli luca.ceresoli at bootlin.com
Fri Nov 18 10:38:41 CET 2022


Repository : https://github.com/bootlin/training-materials
On branch  : master
Link       : https://github.com/bootlin/training-materials/commit/1c03a602391f80fbc17bf9a25b3a482d9435bdf0

>---------------------------------------------------------------

commit 1c03a602391f80fbc17bf9a25b3a482d9435bdf0
Author: Luca Ceresoli <luca.ceresoli at bootlin.com>
Date:   Wed Nov 16 10:49:17 2022 +0100

    common/labs: workaround to avoid bashinput to break "8M"
    
    Currently our 'bashinput' environment breaks a line such as "dd ... bs=8M"
    between '8' and 'M', which is very bad. The correct solution appears to be
    switching from 'alsoletters' to 'breakatwhitespace=true' which breaks
    _only_ at whitespace. But that would create a problem with long strings
    without a space, and we have at least one currently, in the BBB yocto labs:
    
    git am $HOME/yocto-labs/bootlin-lab-data/0001-Simplify-linux-ti-staging-recipe-for-the-Bootlin-lab.patch
    
    Signed-off-by: Luca Ceresoli <luca.ceresoli at bootlin.com>


>---------------------------------------------------------------

1c03a602391f80fbc17bf9a25b3a482d9435bdf0
 common/labs-header.tex | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/common/labs-header.tex b/common/labs-header.tex
index 983094fa..9761d1d1 100644
--- a/common/labs-header.tex
+++ b/common/labs-header.tex
@@ -24,10 +24,14 @@
 
 % Multi-line command environments ---------------------------------------------
 
+% The digits in 'alsoletter' are a workaround to avoid breaking things like
+% "bs=8M". Replacing 'alsoletter={...}' with 'breakatwhitespace=true' would
+% be the correct solution, but we have a very long line in at least one lab
+% (yocto BBB) that would overflow the page if we did.
 \lstnewenvironment{bashinput}{
   \lstset{
   prebreak=\textbackslash,
-  alsoletter={()[].=:-},
+  alsoletter={()[].=:-0123456789},
 }}{}
 
 \lstnewenvironment{terminaloutput}{\lstset{




More information about the training-materials-updates mailing list