r2796 - jhalfs/branches/experimental/BLFS/libs

manuel at linuxfromscratch.org manuel at linuxfromscratch.org
Sun Jun 18 05:41:39 PDT 2006


Author: manuel
Date: 2006-06-18 06:41:38 -0600 (Sun, 18 Jun 2006)
New Revision: 2796

Modified:
   jhalfs/branches/experimental/BLFS/libs/scripts.xsl
Log:
Trying to fix commands that need be run as root.
Need be verified.

Modified: jhalfs/branches/experimental/BLFS/libs/scripts.xsl
===================================================================
--- jhalfs/branches/experimental/BLFS/libs/scripts.xsl	2006-06-18 11:55:40 UTC (rev 2795)
+++ jhalfs/branches/experimental/BLFS/libs/scripts.xsl	2006-06-18 12:41:38 UTC (rev 2796)
@@ -337,16 +337,15 @@
 <!--======================== Commands code ==========================-->
 
   <xsl:template match="screen">
-    <xsl:if test="child::* = userinput">
-      <xsl:choose>
-        <xsl:when test="@role = 'nodump'"/>
-        <xsl:otherwise>
-          <xsl:if test="@role = 'root'">
-            <xsl:text>sudo </xsl:text>
-          </xsl:if>
-          <xsl:apply-templates select="userinput" mode="screen"/>
-        </xsl:otherwise>
-      </xsl:choose>
+    <xsl:if test="child::* = userinput and not(@role = 'nodump')">
+      <xsl:if test="@role = 'root'">
+        <xsl:text>sudo sh -c "</xsl:text>
+      </xsl:if>
+      <xsl:apply-templates select="userinput"/>
+      <xsl:if test="@role = 'root'">
+        <xsl:text>"</xsl:text>
+      </xsl:if>
+      <xsl:text>&#xA;</xsl:text>
     </xsl:if>
   </xsl:template>
 
@@ -361,9 +360,8 @@
     </xsl:if>
   </xsl:template>
 
-  <xsl:template match="userinput" mode="screen">
+  <xsl:template match="userinput">
     <xsl:apply-templates/>
-    <xsl:text>&#xA;</xsl:text>
   </xsl:template>
 
   <xsl:template match="replaceable">




More information about the alfs-log mailing list