r2938 - in jhalfs/trunk/BLFS: . libs

manuel at linuxfromscratch.org manuel at linuxfromscratch.org
Sun Aug 13 04:58:59 PDT 2006


Author: manuel
Date: 2006-08-13 05:58:59 -0600 (Sun, 13 Aug 2006)
New Revision: 2938

Modified:
   jhalfs/trunk/BLFS/blfs-parser.sh
   jhalfs/trunk/BLFS/libs/func_parser
   jhalfs/trunk/BLFS/libs/scripts.xsl
Log:
Added option to not use sudo.

Modified: jhalfs/trunk/BLFS/blfs-parser.sh
===================================================================
--- jhalfs/trunk/BLFS/blfs-parser.sh	2006-08-13 11:18:03 UTC (rev 2937)
+++ jhalfs/trunk/BLFS/blfs-parser.sh	2006-08-13 11:58:59 UTC (rev 2938)
@@ -10,10 +10,13 @@
 declare VERBOSITY=1
 
 # Grab and name the command line options
-    optTARGET=$1
-optDEPENDENCY=$2
+    optTARGET=$1  # Package target
+optDEPENDENCY=$2  # Dependencies level, 1/2/3
+         SUDO=$3  # Build as user (y) or as root (n)
 
+[[ -z $SUDO ]] && SUDO=y
 
+
 #---------------------
 # Constants
 source libs/constants.inc
@@ -113,4 +116,4 @@
 generate_dependency_tree
 generate_TARGET_xml
 generate_target_book
-create_build_scripts
+create_build_scripts "${SUDO}"

Modified: jhalfs/trunk/BLFS/libs/func_parser
===================================================================
--- jhalfs/trunk/BLFS/libs/func_parser	2006-08-13 11:18:03 UTC (rev 2937)
+++ jhalfs/trunk/BLFS/libs/func_parser	2006-08-13 11:58:59 UTC (rev 2938)
@@ -126,7 +126,7 @@
 #-------------------------#
 : <<inline_doc
     function:   Create shell scripts of the requested TARGET.
-    input vars: nothing
+    input vars: $1 use sudo n/y
     externals:  TARGET
     modifies:   nothing
     returns:    nothing
@@ -140,6 +140,7 @@
 
   echo -en "\n\tGenerating the build scripts ..."
   xsltproc --xinclude --nonet \
+           --stringparam sudo $SUDO \
            -o ./scripts/ ../libs/scripts.xsl \
            $TARGET-index.xml >> xsltproc.log 2>&1
   echo -e "done\n"

Modified: jhalfs/trunk/BLFS/libs/scripts.xsl
===================================================================
--- jhalfs/trunk/BLFS/libs/scripts.xsl	2006-08-13 11:18:03 UTC (rev 2937)
+++ jhalfs/trunk/BLFS/libs/scripts.xsl	2006-08-13 11:58:59 UTC (rev 2938)
@@ -9,6 +9,9 @@
 
 <!-- XSLT stylesheet to create shell scripts from "linear build" BLFS books. -->
 
+  <!-- Build as user (y) or as root (n)? -->
+  <xsl:param name="sudo" select="y"/>
+
   <xsl:template match="/">
     <xsl:apply-templates select="//sect1"/>
   </xsl:template>
@@ -344,11 +347,11 @@
 
   <xsl:template match="screen">
     <xsl:if test="child::* = userinput and not(@role = 'nodump')">
-      <xsl:if test="@role = 'root'">
+      <xsl:if test="@role = 'root' and $sudo = 'y'">
         <xsl:text>sudo sh -c "</xsl:text>
       </xsl:if>
       <xsl:apply-templates select="userinput"/>
-      <xsl:if test="@role = 'root'">
+      <xsl:if test="@role = 'root' and $sudo = 'y'">
         <xsl:text>"</xsl:text>
       </xsl:if>
       <xsl:text>&#xA;</xsl:text>




More information about the alfs-log mailing list