Changeset 63b2859


Ignore:
Timestamp:
09/26/2005 10:36:40 PM (19 years ago)
Author:
Manuel Canales Esparcia <manuel@…>
Branches:
0.2, 1.0, 2.3, 2.3.x, 2.4, ablfs, ablfs-more, legacy, new_features, trunk
Children:
c4cf6de
Parents:
409488e
Message:

Starting the move of some features to the XSL code.
First try to manage chapter05.

Files:
2 edited

Legend:

Unmodified
Added
Removed
  • dump-commands.xsl

    r409488e r63b2859  
    55    version="1.0">
    66
    7 <!-- XSLT stylesheet to extract commands from [B,H]LFS books. -->
     7<!-- XSLT stylesheet to create shell scripts from LFS books. -->
    88
    99  <xsl:template match="/">
     
    4040      <!-- Creating dirs and files -->
    4141    <exsl:document href="{$dirname}/{$order}-{$filename}" method="text">
     42      <xsl:text>#!/bin/sh&#xA;&#xA;</xsl:text>
    4243      <xsl:apply-templates select=".//screen"/>
    4344    </exsl:document>
     
    4849      <xsl:choose>
    4950        <xsl:when test="@role = 'nodump'"/>
    50         <xsl:when test="@role = 'root'">
    51           <xsl:text>&#xA;</xsl:text>
    52           <xsl:text># Run this as root</xsl:text>
    53           <xsl:apply-templates select="userinput"/>
    54           <xsl:text># End root commands</xsl:text>
    55           <xsl:text>&#xA;</xsl:text>
    56         </xsl:when>
    5751        <xsl:otherwise>
    5852          <xsl:apply-templates select="userinput"/>
     
    6357
    6458  <xsl:template match="userinput">
    65     <xsl:text>&#xA;</xsl:text>
    66     <xsl:if test=".//replaceable">
    67       <xsl:text># This block must be edited to suit your needs.</xsl:text>
    68     </xsl:if>
    69     <xsl:text>&#xA;</xsl:text>
    7059    <xsl:apply-templates/>
    71     <xsl:text>&#xA;</xsl:text>
    72     <xsl:if test=".//replaceable">
    73       <xsl:text># End of editable block.</xsl:text>
    74     </xsl:if>
    75     <xsl:text>&#xA;</xsl:text>
     60    <xsl:text> &amp;&amp;&#xA;</xsl:text>
    7661  </xsl:template>
    7762
  • jhalfs

    r409488e r63b2859  
    22
    33version="
    4 jhalfs 0.2
     4jhalfs development
     5
    56Written by Jeremy Huntwork.
    67Maintained by Manuel Canales Esparcia.
     
    159160  lfs-$LFSVRS/index.xml >>$JHALFSDIR/$LOG 2>&1
    160161
    161   # Move the text files out from the chapter directories, and dump them
    162   # all into the 'commands' directory.
    163   cd commands
    164   find ./* -xtype f -exec mv '{}' . \;
    165   find ./* -maxdepth 0 -xtype d -exec rm -rf '{}' \;
    166 
    167   # Remove all the blank lines from the commands
    168   for i in $JHALFSDIR/commands/* ; do
    169     sed -i '/^$/d' $i
    170   done
    171 
    172162  # Grab the patches and package names.
    173163  cd $JHALFSDIR
     
    264254  >$MKFILE.tmp
    265255
    266   for i in * ; do
    267   # First append each name of the command files to a list (this will become
     256  for file in chapter0{4,5}/* ; do
     257  # Keep the script file name
     258  i=`basename $file`
     259
     260  # First append each name of the script files to a list (this will become
    268261  # the names of the targets in the Makefile
    269262  list="$list $i"
     
    294287  fi
    295288
    296   # Drop in the actual commands that were parsed from the book
    297   # These seds add an extra $ to each variable so make doesn't break,
    298   # add tabs to the beginning of each line, and add ' && \' to the end
    299   # of each line except for those that end in '\'.
    300   cat $i | sed -e 's:\$:&&:g' -e 's:^:\t:' -e 's:[^\\]$:& \&\& \\:' >> $MKFILE.tmp
    301   # This sed removes the ' && \' from the last command of each target
    302   sed -i '$s: \&\& \\::' $MKFILE.tmp
     289#   # Drop in the actual commands that were parsed from the book
     290#   # These seds add an extra $ to each variable so make doesn't break,
     291#   # add tabs to the beginning of each line, and add ' && \' to the end
     292#   # of each line except for those that end in '\'.
     293#   cat $i | sed -e 's:\$:&&:g' -e 's:^:\t:' -e 's:[^\\]$:& \&\& \\:' >> $MKFILE.tmp
     294#   # This sed removes the ' && \' from the last command of each target
     295#   sed -i '$s: \&\& \\::' $MKFILE.tmp
     296
     297  # Run the script
     298  echo -e "\tsu - lfs -c \"/bin/bash $file\"" >> $MKFILE.tmp
    303299
    304300  # Include a touch of the target name so make can check if it's already been made.
Note: See TracChangeset for help on using the changeset viewer.