Index: BLFS/xsl/gen-install.xsl
===================================================================
--- BLFS/xsl/gen-install.xsl	(revision f596dde66c8b39eac2b023e79277301e449bebfa)
+++ BLFS/xsl/gen-install.xsl	(revision 619b313adbf8fa2beb23122bc5425e91df92c81c)
@@ -7,4 +7,5 @@
 
   <xsl:template match="screen" mode="installation">
+    <xsl:param name="want-stats" select="false"/>
 <!-- "nature" variables:
       - 'non-root': executable as user
@@ -36,7 +37,12 @@
 
     <xsl:variable
+         name="prec-screen"
+         select="preceding::screen[not(@role='nodump') and ./userinput][1]
+                        [ancestor::sect2 = current()/ancestor::sect2]"/>
+
+    <xsl:variable
          name="prec-string"
-         select="string(preceding-sibling::screen[not(@role='nodump') and
-                                                      ./userinput][1])"/>
+         select="string($prec-screen)"/>
+
 <!--
     <xsl:message>
@@ -61,14 +67,12 @@
         <xsl:when
              test="$prec-string='' or
-                   (preceding-sibling::screen[not(@role='nodump') and
-                                                      ./userinput] |
-                    preceding-sibling::para/command[contains(text(),'check') or
-                                                    contains(text(),'test')]
+                   (preceding::screen[not(@role='nodump') and
+                                                 ./userinput] |
+                    preceding::command[contains(text(),'check') or
+                                       contains(text(),'test')]
                    )[last()][self::command]">
           <xsl:text>none</xsl:text>
         </xsl:when>
-        <xsl:when
-           test="preceding-sibling::screen
-                    [not(@role='nodump') and ./userinput][1][not(@role)]">
+        <xsl:when test="$prec-screen[not(@role)]">
           <xsl:text>non-root</xsl:text>
         </xsl:when>
@@ -91,7 +95,11 @@
 
     <xsl:variable
+         name="follow-screen"
+         select="following::screen[not(@role='nodump') and ./userinput][1]
+                        [ancestor::sect2 = current()/ancestor::sect2]"/>
+
+    <xsl:variable
          name="follow-string"
-         select="string(following-sibling::screen[not(@role='nodump') and
-                                                      ./userinput][1])"/>
+         select="string($follow-screen)"/>
 
     <xsl:variable name="follow-nature">
@@ -99,14 +107,12 @@
         <xsl:when
              test="$follow-string='' or
-                   (following-sibling::screen[not(@role='nodump') and
-                                                      ./userinput] |
-                    following-sibling::para/command[contains(text(),'check') or
-                                                    contains(text(),'test')]
+                   (following::screen[not(@role='nodump') and
+                                                 ./userinput] |
+                    following::command[contains(text(),'check') or
+                                       contains(text(),'test')]
                    )[1][self::command]">
           <xsl:text>none</xsl:text>
         </xsl:when>
-        <xsl:when
-           test="following-sibling::screen
-                    [not(@role='nodump') and ./userinput][1][not(@role)]">
+        <xsl:when test="$follow-screen[not(@role)]">
           <xsl:text>non-root</xsl:text>
         </xsl:when>
@@ -138,6 +144,4 @@
         </xsl:if>
         <xsl:apply-templates/>
-        <xsl:text>
-</xsl:text>
       </xsl:when>
 
@@ -150,6 +154,4 @@
         </xsl:if>
         <xsl:apply-templates mode="root"/>
-        <xsl:text>
-</xsl:text>
         <xsl:if test="$follow-nature='none'">
           <xsl:call-template name="end-root"/>
@@ -159,6 +161,5 @@
       <xsl:when test="$my-nature='install'">
         <xsl:if test="$prec-nature='none' or $prec-nature='non-root'">
-          <xsl:if test="contains($list-stat-norm,
-                                 concat(' ',ancestor::sect1/@id,' '))">
+          <xsl:if test="$want-stats">
             <xsl:call-template name="output-destdir"/>
           </xsl:if>
@@ -167,6 +168,5 @@
         </xsl:if>
         <xsl:if test="$prec-nature='config'">
-          <xsl:if test="contains($list-stat-norm,
-                                 concat(' ',ancestor::sect1/@id,' '))">
+          <xsl:if test="$want-stats">
             <xsl:call-template name="end-root"/>
             <xsl:call-template name="output-destdir"/>
@@ -176,6 +176,4 @@
         </xsl:if>
         <xsl:apply-templates mode="install"/>
-        <xsl:text>
-</xsl:text>
         <xsl:if test="$follow-nature='none'">
           <xsl:call-template name="end-install"/>
@@ -189,6 +187,6 @@
   <xsl:template name="begin-root">
     <xsl:if test="$sudo='y'">
-      <xsl:text>sudo -E sh &lt;&lt; ROOT_EOF
-</xsl:text>
+      <xsl:text>
+sudo -E sh &lt;&lt; ROOT_EOF</xsl:text>
     </xsl:if>
   </xsl:template>
@@ -196,11 +194,11 @@
   <xsl:template name="begin-install">
     <xsl:if test="$wrap-install = 'y'">
-      <xsl:text>if [ -r "$JH_PACK_INSTALL" ]; then
+      <xsl:text>
+if [ -r "$JH_PACK_INSTALL" ]; then
   source $JH_PACK_INSTALL
   export -f wrapInstall
   export -f packInstall
 fi
-wrapInstall '
-</xsl:text>
+wrapInstall '</xsl:text>
     </xsl:if>
   </xsl:template>
@@ -208,6 +206,6 @@
   <xsl:template name="end-root">
     <xsl:if test="$sudo='y'">
-      <xsl:text>ROOT_EOF
-</xsl:text>
+      <xsl:text>
+ROOT_EOF</xsl:text>
     </xsl:if>
   </xsl:template>
@@ -220,11 +218,13 @@
     </xsl:if>
     <xsl:if test="$wrap-install = 'y'">
-      <xsl:text>'&#xA;packInstall&#xA;</xsl:text>
-    </xsl:if>
-  </xsl:template>
-
-  <xsl:template match="text()" mode="install">
+      <xsl:text>'&#xA;packInstall</xsl:text>
+    </xsl:if>
+  </xsl:template>
+
+  <xsl:template match="userinput" mode="install">
+    <xsl:text>
+</xsl:text>
     <xsl:call-template name="output-install">
-      <xsl:with-param name="out-string" select="."/>
+      <xsl:with-param name="out-string" select="string()"/>
     </xsl:call-template>
   </xsl:template>
@@ -233,4 +233,19 @@
     <xsl:param name="out-string" select="''"/>
     <xsl:choose>
+      <xsl:when test="starts-with($out-string, 'make ') or
+                      contains($out-string,' make ') or
+                      contains($out-string,'&#xA;make')">
+        <xsl:call-template name="output-install">
+          <xsl:with-param
+               name="out-string"
+               select="substring-before($out-string,'make ')"/>
+        </xsl:call-template>
+        <xsl:text>make -j1 </xsl:text>
+        <xsl:call-template name="output-install">
+          <xsl:with-param
+               name="out-string"
+               select="substring-after($out-string,'make ')"/>
+        </xsl:call-template>
+      </xsl:when>
       <xsl:when test="contains($out-string,string($APOS))
                       and $wrap-install = 'y'">
Index: BLFS/xsl/gen_pkg_list.xsl
===================================================================
--- BLFS/xsl/gen_pkg_list.xsl	(revision f596dde66c8b39eac2b023e79277301e449bebfa)
+++ BLFS/xsl/gen_pkg_list.xsl	(revision 619b313adbf8fa2beb23122bc5425e91df92c81c)
@@ -45,5 +45,5 @@
           <xsl:text>&#xA;      </xsl:text>
           <name>LFS Chapter 8</name>
-          <xsl:apply-templates select='document($lfs-full)//chapter[@id="chapter-bootable"]/sect1/sect1info[./productname="linux"]'/>
+          <xsl:apply-templates select='document($lfs-full)//chapter[@id="chapter-bootable"]/sect1/sect1info[./productname="kernel"]'/>
           <xsl:text>&#xA;    </xsl:text>
         </sublist>
@@ -87,6 +87,5 @@
     <xsl:choose>
 <!-- Never update linux headers -->
-      <xsl:when test="./productname='linux'
-                      and ancestor::chapter[@id='chapter-building-system']"/>
+      <xsl:when test="./productname='linux-headers'"/>
 <!-- Gcc version is taken from BLFS -->
       <xsl:when test="./productname='gcc'"/>
@@ -99,6 +98,5 @@
 <!-- Systemd version is taken from BLFS -->
       <xsl:when test="./productname='systemd'"/>
-<!-- Same for python and ninja -->
-      <xsl:when test="./productname='ninja'"/>
+<!-- Same for python3 -->
       <xsl:when test="./productname='Python'"/>
       <xsl:otherwise>
Index: BLFS/xsl/lfs_make_book.xsl
===================================================================
--- BLFS/xsl/lfs_make_book.xsl	(revision f596dde66c8b39eac2b023e79277301e449bebfa)
+++ BLFS/xsl/lfs_make_book.xsl	(revision 619b313adbf8fa2beb23122bc5425e91df92c81c)
@@ -16,7 +16,7 @@
                       $package='vim' or
                       $package='systemd' or
-                      $package='ninja' or
                       $package='Python' or
                       $package='shadow'"/>
+      <xsl:when test="$package='kernel'">true</xsl:when>
       <xsl:when test="$package='LFS-Release'">true</xsl:when>
       <xsl:otherwise>
@@ -36,8 +36,7 @@
                       $package='vim' or
                       $package='systemd' or
-                      $package='ninja' or
                       $package='Python' or
                       $package='shadow'"/>
-      <xsl:when test="$package='linux'">
+      <xsl:when test="$package='kernel'">
         <xsl:for-each select="document($lfsbook)">
           <xsl:apply-templates select="key('idlfs',$package)[ancestor::chapter/@id='chapter-bootable']" mode="lfs"/>
Index: BLFS/xsl/scripts.xsl
===================================================================
--- BLFS/xsl/scripts.xsl	(revision f596dde66c8b39eac2b023e79277301e449bebfa)
+++ BLFS/xsl/scripts.xsl	(revision 619b313adbf8fa2beb23122bc5425e91df92c81c)
@@ -72,4 +72,6 @@
 
 <!-- simple instructions for removing .la files. -->
+<!-- We'll use the rule that any text output begins with a linefeed if needed
+     so that we do not need to output one at the end-->
   <xsl:variable name="la-files-instr">
 
@@ -78,7 +80,5 @@
              ! -path \*ImageMagick\* \
                -delete
-done
-
-</xsl:variable>
+done</xsl:variable>
 
   <xsl:variable name="list-stat-norm"
@@ -103,4 +103,9 @@
 
   <xsl:template match="sect1">
+
+    <!-- Are stat requested for this page? -->
+    <xsl:variable name="want-stats"
+                  select="contains($list-stat-norm,
+                                   concat(' ',@id,' '))"/>
 
       <!-- The file names -->
@@ -139,6 +144,6 @@
 set -e
 unset MAKELEVEL
+</xsl:text>
 <!-- the above is needed for some packages -->
-</xsl:text>
       <xsl:choose>
         <!-- Package page -->
@@ -147,5 +152,6 @@
                if using package management (see envars.conf), so
                "export" it -->
-          <xsl:text>export JH_PKG_DIR=</xsl:text>
+          <xsl:text>
+export JH_PKG_DIR=</xsl:text>
           <xsl:value-of select="$filename"/>
           <xsl:text>
@@ -154,10 +160,10 @@
 mkdir -p $SRC_DIR
 mkdir -p $BUILD_DIR
-
 </xsl:text>
 
 <!-- If stats are requested, include some definitions and intitializations -->
-          <xsl:if test="contains($list-stat-norm,concat(' ',@id,' '))">
-            <xsl:text>INFOLOG=$(pwd)/info-${JH_PKG_DIR}
+          <xsl:if test="$want-stats">
+            <xsl:text>
+INFOLOG=$(pwd)/info-${JH_PKG_DIR}
 TESTLOG=$(pwd)/test-${JH_PKG_DIR}
 unset MAKEFLAGS
@@ -167,11 +173,14 @@
 PKG_DEST=${BUILD_DIR}/dest
 rm -rf $PKG_DEST
-
 </xsl:text>
           </xsl:if>
         <!-- Download code and build commands -->
-          <xsl:apply-templates select="sect2"/>
+          <xsl:apply-templates select="sect2">
+            <xsl:with-param name="want-stats" select="$want-stats"/>
+          </xsl:apply-templates>
         <!-- Clean-up -->
-          <xsl:text>cd $BUILD_DIR
+          <xsl:text>
+
+cd $BUILD_DIR
 [[ -n "$JH_KEEP_FILES" ]] || </xsl:text>
         <!-- In some case, some files in the build tree are owned
@@ -180,5 +189,6 @@
             <xsl:text>sudo </xsl:text>
           </xsl:if>
-          <xsl:text>rm -rf $JH_UNPACKDIR unpacked&#xA;&#xA;</xsl:text>
+          <xsl:text>rm -rf $JH_UNPACKDIR unpacked
+</xsl:text>
         </xsl:when>
       <!-- Non-package page -->
@@ -187,5 +197,7 @@
         </xsl:otherwise>
       </xsl:choose>
-      <xsl:text>exit</xsl:text>
+      <xsl:text>
+exit
+</xsl:text><!-- include a \n at the end of document-->
     </exsl:document>
   </xsl:template>
@@ -194,12 +206,12 @@
 
   <xsl:template match="sect2">
+    <xsl:param name="want-stats" select="false"/>
     <xsl:choose>
 
       <xsl:when test="@role = 'package'">
-        <xsl:text>cd $SRC_DIR
-</xsl:text>
+        <xsl:text>
+cd $SRC_DIR</xsl:text>
         <!-- Download information is in bridgehead tags -->
         <xsl:apply-templates select="bridgehead[@renderas='sect3']"/>
-        <xsl:text>&#xA;</xsl:text>
       </xsl:when><!-- @role="package" -->
 
@@ -216,14 +228,14 @@
         </xsl:if>
         <xsl:text>rm -rf
-
-</xsl:text>
-<!-- If stats are requested, insert the start size -->
-        <xsl:if test="contains($list-stat-norm,concat(' ',../@id,' '))">
-          <xsl:text>echo Start Size: $(sudo du -skx --exclude home /) >> $INFOLOG
-
+</xsl:text>
+        <!-- If stats are requested, insert the start size -->
+        <xsl:if test="$want-stats">
+          <xsl:text>
+echo Start Size: $(sudo du -skx --exclude home /) >> $INFOLOG
 </xsl:text>
         </xsl:if>
 
-        <xsl:text>case $PACKAGE in
+        <xsl:text>
+case $PACKAGE in
   *.tar.gz|*.tar.bz2|*.tar.xz|*.tgz|*.tar.lzma)
      tar -xvf $SRC_DIR/$PACKAGE &gt; unpacked
@@ -248,14 +260,17 @@
      mkdir $JH_UNPACKDIR
      cp $SRC_DIR/$PACKAGE $JH_UNPACKDIR
-     cp $(find . -mindepth 1 -maxdepth 1 -type l) $JH_UNPACKDIR
+     ADDITIONAL="$(find . -mindepth 1 -maxdepth 1 -type l)"
+     if [ -n "$ADDITIONAL" ]; then
+         cp $ADDITIONAL $JH_UNPACKDIR
+     fi
      ;;
 esac
 export JH_UNPACKDIR
-cd $JH_UNPACKDIR&#xA;
-</xsl:text>
-<!-- If stats are requested, insert the start time -->
-        <xsl:if test="contains($list-stat-norm,concat(' ',../@id,' '))">
-          <xsl:text>echo Start Time: ${SECONDS} >> $INFOLOG
-
+cd $JH_UNPACKDIR
+</xsl:text>
+        <!-- If stats are requested, insert the start time -->
+        <xsl:if test="$want-stats">
+          <xsl:text>
+echo Start Time: ${SECONDS} >> $INFOLOG
 </xsl:text>
         </xsl:if>
@@ -265,12 +280,17 @@
              select=".//screen[not(@role = 'nodump') and ./userinput] |
                      .//para/command[contains(text(),'check') or
-                                     contains(text(),'test')]"/>
+                                     contains(text(),'test')]">
+          <xsl:with-param name="want-stats" select="$want-stats"/>
+        </xsl:apply-templates>
+        <xsl:text>
+</xsl:text>
         <xsl:if test="$sudo = 'y'">
           <xsl:text>sudo /sbin/</xsl:text>
         </xsl:if>
-        <xsl:text>ldconfig&#xA;&#xA;</xsl:text>
+        <xsl:text>ldconfig</xsl:text>
       </xsl:when><!-- @role="installation" -->
 
       <xsl:when test="@role = 'configuration'">
+        <xsl:text>&#xA;</xsl:text>
         <xsl:apply-templates mode="config"
              select=".//screen[not(@role = 'nodump') and ./userinput]"/>
@@ -368,22 +388,22 @@
     <xsl:text>
   fi
-fi
-</xsl:text>
+fi</xsl:text>
     <xsl:if test="string-length($md5) &gt; 10">
-      <xsl:text>echo "</xsl:text>
+      <xsl:text>
+echo "</xsl:text>
       <xsl:value-of select="$md5"/>
       <xsl:text>&#x20;&#x20;$</xsl:text>
       <xsl:value-of select="$varname"/>
-      <xsl:text>" | md5sum -c -
-</xsl:text>
+      <xsl:text>" | md5sum -c -</xsl:text>
     </xsl:if>
 <!-- link additional packages into $BUILD_DIR, because they are supposed to
      be there-->
     <xsl:if test="string($varname) != 'PACKAGE'">
-      <xsl:text>[[ "$SRC_DIR" != "$BUILD_DIR" ]] &amp;&amp; ln -sf $SRC_DIR/$</xsl:text>
+      <xsl:text>
+[[ "$SRC_DIR" != "$BUILD_DIR" ]] &amp;&amp; ln -sf $SRC_DIR/$</xsl:text>
       <xsl:value-of select="$varname"/>
-      <xsl:text> $BUILD_DIR
-</xsl:text>
+      <xsl:text> $BUILD_DIR</xsl:text>
     </xsl:if>
+    <xsl:text>&#xA;</xsl:text>
   </xsl:template>
 
@@ -546,5 +566,4 @@
         </xsl:if>
         <xsl:apply-templates mode="root"/>
-        <xsl:text>&#xA;</xsl:text>
         <xsl:if test="not(following-sibling::screen[1][@role='root'])">
           <xsl:call-template name="end-root"/>
@@ -554,5 +573,4 @@
       <xsl:otherwise>
         <xsl:apply-templates select="userinput"/>
-        <xsl:text>&#xA;</xsl:text>
       </xsl:otherwise>
     </xsl:choose>
@@ -562,7 +580,9 @@
     <xsl:param name="bootpkg" select="'bootscripts'"/>
     <xsl:param name="url" select="''"/>
-    <xsl:text>BOOTPKG_DIR=blfs-</xsl:text>
+    <xsl:text>
+BOOTPKG_DIR=blfs-</xsl:text>
     <xsl:copy-of select="$bootpkg"/>
     <xsl:text>
+
 BOOTSRC_DIR=${JH_SRC_ARCHIVE}${JH_SRC_SUBDIRS:+/${BOOTPKG_DIR}}
 BOOTBUILD_DIR=${JH_BUILD_ROOT}${JH_BUILD_SUBDIRS:+/${BOOTPKG_DIR}}
@@ -595,6 +615,5 @@
   BOOTUNPACKDIR=`head -n1 unpacked | sed 's@^./@@;s@/.*@@'`
 fi
-cd $BOOTUNPACKDIR
-</xsl:text>
+cd $BOOTUNPACKDIR</xsl:text>
   </xsl:template>
 
@@ -603,6 +622,6 @@
 <!-- if the preceding "screen" tag is role="root", and we are role="root"
      the end-root has not been called. So do it -->
-      <xsl:if test="preceding-sibling::screen[1][@role='root'] and
-                    @role='root'">
+      <xsl:if
+           test="preceding-sibling::screen[1][@role='root'] and @role='root'">
         <xsl:call-template name="end-root"/>
       </xsl:if>
@@ -614,6 +633,6 @@
 <!-- if the preceding "screen" tag is role="root", and we are role="root"
      the begin-root will not be called. So do it -->
-      <xsl:if test="preceding-sibling::screen[1][@role='root'] and
-                    @role='root'">
+      <xsl:if
+           test="preceding-sibling::screen[1][@role='root'] and @role='root'">
         <xsl:call-template name="begin-root"/>
       </xsl:if>
@@ -622,6 +641,6 @@
 <!-- if the preceding "screen" tag is role="root", and we are role="root"
      the end-root has not been called. So do it -->
-      <xsl:if test="preceding-sibling::screen[1][@role='root'] and
-                    @role='root'">
+      <xsl:if
+           test="preceding-sibling::screen[1][@role='root'] and @role='root'">
         <xsl:call-template name="end-root"/>
       </xsl:if>
@@ -633,6 +652,6 @@
 <!-- if the preceding "screen" tag is role="root", and we are role="root"
      the begin-root will not be called. So do it -->
-      <xsl:if test="preceding-sibling::screen[1][@role='root'] and
-                    @role='root'">
+      <xsl:if
+           test="preceding-sibling::screen[1][@role='root'] and @role='root'">
         <xsl:call-template name="begin-root"/>
       </xsl:if>
@@ -643,14 +662,14 @@
 <!-- if the next "screen" tag is role="root", and we are role="root"
      the end-root has not been called. So do it -->
-      <xsl:if test="following-sibling::screen[1][@role='root'] and
-                    @role='root'">
+      <xsl:if
+           test="following-sibling::screen[1][@role='root'] and @role='root'">
         <xsl:call-template name="end-root"/>
       </xsl:if>
-      <xsl:text>popd
-</xsl:text>
+      <xsl:text>
+popd</xsl:text>
 <!-- if the next "screen" tag is role="root", and we are role="root"
      the begin-root will not be called. So do it -->
-      <xsl:if test="following-sibling::screen[1][@role='root'] and
-                    @role='root'">
+      <xsl:if
+           test="following-sibling::screen[1][@role='root'] and @role='root'">
         <xsl:call-template name="begin-root"/>
       </xsl:if>
@@ -659,4 +678,5 @@
 
   <xsl:template match="command" mode="installation">
+    <xsl:param name="want-stats" select="false"/>
     <xsl:variable name="ns" select="normalize-space(string())"/>
     <xsl:variable name="first"
@@ -671,8 +691,8 @@
                                                 contains(text(),'test')]))"/>
     <xsl:choose>
-      <xsl:when test="contains($list-stat-norm,
-                               concat(' ',ancestor::sect1/@id,' '))">
+      <xsl:when test="$want-stats">
         <xsl:if test="$first">
           <xsl:text>
+
 echo Time after make: ${SECONDS} >> $INFOLOG
 echo Size after make: $(sudo du -skx --exclude home /) >> $INFOLOG
@@ -683,5 +703,6 @@
       </xsl:when>
       <xsl:otherwise>
-        <xsl:text>#</xsl:text>
+        <xsl:text>
+#</xsl:text>
       </xsl:otherwise>
     </xsl:choose>
@@ -699,16 +720,14 @@
       </xsl:otherwise>
     </xsl:choose>
-    <xsl:if test="contains($list-stat-norm,
-                           concat(' ',ancestor::sect1/@id,' '))">
+    <xsl:if test="$want-stats">
       <xsl:text> &gt;&gt; $TESTLOG 2&gt;&amp;1</xsl:text>
     </xsl:if>
-    <xsl:text> || true&#xA;</xsl:text>
-      <xsl:if test="contains($list-stat-norm,
-                             concat(' ',ancestor::sect1/@id,' ')) and $last">
+    <xsl:text> || true</xsl:text>
+    <xsl:if test="$want-stats">
         <xsl:text>
+
 echo Time after test: ${SECONDS} >> $INFOLOG
 echo Size after test: $(sudo du -skx --exclude home /) >> $INFOLOG
 echo Time before install: ${SECONDS} >> $INFOLOG
-
 </xsl:text>
         </xsl:if>
@@ -716,5 +735,13 @@
 
   <xsl:template match="userinput">
+    <xsl:text>
+</xsl:text>
     <xsl:apply-templates/>
+  </xsl:template>
+
+  <xsl:template match="userinput" mode="root">
+    <xsl:text>
+</xsl:text>
+    <xsl:apply-templates mode="root"/>
   </xsl:template>
 
@@ -734,15 +761,4 @@
     <xsl:param name="out-string" select="''"/>
     <xsl:choose>
-      <xsl:when test="contains($out-string,'make ')">
-        <xsl:call-template name="output-root">
-          <xsl:with-param name="out-string"
-                          select="substring-before($out-string,'make ')"/>
-        </xsl:call-template>
-        <xsl:text>make -j1 </xsl:text>
-        <xsl:call-template name="output-root">
-          <xsl:with-param name="out-string"
-                          select="substring-after($out-string,'make ')"/>
-        </xsl:call-template>
-      </xsl:when>
       <xsl:when test="contains($out-string,'$') and $sudo = 'y'">
         <xsl:call-template name="output-root">
@@ -852,4 +868,5 @@
        mode="destdir"/>
     <xsl:text>
+
 echo Time after install: ${SECONDS} >> $INFOLOG
 echo Size after install: $(sudo du -skx --exclude home /) >> $INFOLOG
@@ -874,5 +891,4 @@
       </xsl:otherwise>
     </xsl:choose>
-    <xsl:text>&#xA;</xsl:text>
   </xsl:template>
 
@@ -895,5 +911,6 @@
           </xsl:when>
           <xsl:otherwise>
-            <xsl:text>make DESTDIR=$PKG_DEST</xsl:text>
+            <xsl:text>
+make DESTDIR=$PKG_DEST</xsl:text>
               <xsl:call-template name="outputpkgdest">
                 <xsl:with-param
@@ -919,5 +936,6 @@
           </xsl:when>
           <xsl:otherwise>
-            <xsl:text>DESTDIR=$PKG_DEST ninja</xsl:text>
+            <xsl:text>
+DESTDIR=$PKG_DEST ninja</xsl:text>
               <xsl:call-template name="outputpkgdest">
                 <xsl:with-param
@@ -985,5 +1003,6 @@
           <xsl:text> &amp;&amp;</xsl:text>
         </xsl:if>
-        <xsl:text>&#xA;</xsl:text>
+        <xsl:text>
+</xsl:text>
         <xsl:call-template name="remove-ampersand">
           <xsl:with-param name="out-string"
@@ -1017,15 +1036,16 @@
     <xsl:param name="instructions" select="''"/>
     <xsl:choose>
-      <xsl:when test="contains($instructions,'&#xA;')">
-        <xsl:copy-of select="substring-before($instructions,'&#xA;')"/>
-        <xsl:text>&#xA;</xsl:text>
+      <xsl:when
+           test="substring($instructions,string-length($instructions))=' '">
         <xsl:call-template name="remove-end-space">
           <xsl:with-param
                name="instructions"
-               select="substring-after($instructions,'&#xA;')"/>
-        </xsl:call-template>
-      </xsl:when>
-      <xsl:otherwise>
-        <xsl:copy-of select="normalize-space($instructions)"/>
+               select="substring($instructions,
+                                 1,
+                                 string-length($instructions)-1)"/>
+        </xsl:call-template>
+      </xsl:when>
+      <xsl:otherwise>
+        <xsl:copy-of select="$instructions"/>
       </xsl:otherwise>
     </xsl:choose>
