Hi,

A high percentage of lfs/blfs book-commits' patches, could be a lot
more readable - and therefore less fragile/error-prone - if the xml
tags were kept on separate lines from the code.

This would be do-able while still avoiding pitfalls like the old
'vertical-formatting' in *roff/&c.


For example, most of the following diff is caused by formatting of the
original & new xml, as opposed to changes in the shell/&c commands;
and as such makes the change/patch much less readable and therefore
more fragile/error-prone for editors/&c.


vvvvvvvvvvvvvvvvvv Start of Example vvvvvvvvvvvvvvvvvvvvvvvvvv

From blfs-book-boun...@lists.linuxfromscratch.org Fri Apr 21 07:34:19 2017
To: blfs-b...@lists.linuxfromscratch.org
Date: Fri, 21 Apr 2017 06:34:33 -0000
Subject: [blfs-book] r18621 - trunk/BOOK/general/prog
From: via blfs-book <blfs-b...@lists.linuxfromscratch.org>

Author: pierre
Date: Thu Apr 20 23:34:33 2017
New Revision: 18621

Log:
LLVM-3: move a command needing root privs to a proper location

Modified:
   trunk/BOOK/general/prog/llvm3.xml

Modified: trunk/BOOK/general/prog/llvm3.xml
==============================================================================
--- trunk/BOOK/general/prog/llvm3.xml   Thu Apr 20 10:28:42 2017        (r18620)
+++ trunk/BOOK/general/prog/llvm3.xml   Thu Apr 20 23:34:33 2017        (r18621)
@@ -131,8 +131,7 @@
       commands:
     </para>
 
-<screen><userinput>echo "/opt/llvm3/lib" >> /etc/ld.so.conf &amp;&amp;
-mkdir -v build                           &amp;&amp;
+<screen><userinput>mkdir -v build                           &amp;&amp;
 cd       build                           &amp;&amp;
 
 CC=gcc CXX=g++                           \
@@ -156,11 +155,10 @@
       Now, as the <systemitem class="username">root</systemitem> user:
     </para>
 
-<screen role="root"><userinput>
-make install                              &amp;&amp;
-ldconfig                                  &amp;&amp;
-ln -sfv /opt/llvm3/bin/FileCheck /usr/bin
-</userinput></screen>
+<screen role="root"><userinput>echo "/opt/llvm3/lib" >> /etc/ld.so.conf 
&amp;&amp;
+make install                             &amp;&amp;
+ldconfig                                 &amp;&amp;
+ln -sfv /opt/llvm3/bin/FileCheck /usr/bin</userinput></screen>
 
     <para>
       Building the documentation for <emphasis>current</emphasis> LLVM is

^^^^^^^^^^^^^^^^^^^^^^^ End of Example ^^^^^^^^^^^^^^^^^^^^^^^^^^


If the original xml were formatted thus:
====
<screen><userinput>
echo "/opt/llvm3/lib" >> /etc/ld.so.conf &amp;&amp;
mkdir -v build                           &amp;&amp;
cd       build                           &amp;&amp;
[...]
<screen role="root"><userinput>
make install                             &amp;&amp;
ldconfig                                 &amp;&amp;
ln -sfv /opt/llvm3/bin/FileCheck /usr/bin
</userinput></screen>
====

; and the new-version xml formatted thus:
========
<screen><userinput>
mkdir -v build                           &amp;&amp;
cd       build                           &amp;&amp;
[...]
<screen role="root"><userinput>
echo "/opt/llvm3/lib" >> /etc/ld.so.conf &amp;&amp;
make install                             &amp;&amp;
ldconfig                                 &amp;&amp;
ln -sfv /opt/llvm3/bin/FileCheck /usr/bin
</userinput></screen>
========

; then the diff would basically just be:
==
 <screen><userinput>
-echo "/opt/llvm3/lib" >> /etc/ld.so.conf &amp;&amp;
 mkdir -v build                           &amp;&amp;
 cd       build                           &amp;&amp;
 [...]
 <screen role="root"><userinput>
+echo "/opt/llvm3/lib" >> /etc/ld.so.conf &amp;&amp;
 make install                             &amp;&amp;
 ldconfig                                 &amp;&amp;
 ln -sfv /opt/llvm3/bin/FileCheck /usr/bin
==

; which shows much more clearly what the change is and - as importantly -
is only.


The suggested practice could be made to be part of editorial 'requirements'.



akh





--
-- 
http://lists.linuxfromscratch.org/listinfo/blfs-dev
FAQ: http://www.linuxfromscratch.org/blfs/faq.html
Unsubscribe: See the above information page

Reply via email to