Changeset 63b2859
- Timestamp:
- 09/26/2005 10:36:40 PM (19 years ago)
- Branches:
- 0.2, 1.0, 2.3, 2.3.x, 2.4, ablfs, ablfs-more, legacy, new_features, trunk
- Children:
- c4cf6de
- Parents:
- 409488e
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
dump-commands.xsl
r409488e r63b2859 5 5 version="1.0"> 6 6 7 <!-- XSLT stylesheet to extract commands from [B,H]LFS books. -->7 <!-- XSLT stylesheet to create shell scripts from LFS books. --> 8 8 9 9 <xsl:template match="/"> … … 40 40 <!-- Creating dirs and files --> 41 41 <exsl:document href="{$dirname}/{$order}-{$filename}" method="text"> 42 <xsl:text>#!/bin/sh

</xsl:text> 42 43 <xsl:apply-templates select=".//screen"/> 43 44 </exsl:document> … … 48 49 <xsl:choose> 49 50 <xsl:when test="@role = 'nodump'"/> 50 <xsl:when test="@role = 'root'">51 <xsl:text>
</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>
</xsl:text>56 </xsl:when>57 51 <xsl:otherwise> 58 52 <xsl:apply-templates select="userinput"/> … … 63 57 64 58 <xsl:template match="userinput"> 65 <xsl:text>
</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>
</xsl:text>70 59 <xsl:apply-templates/> 71 <xsl:text>
</xsl:text> 72 <xsl:if test=".//replaceable"> 73 <xsl:text># End of editable block.</xsl:text> 74 </xsl:if> 75 <xsl:text>
</xsl:text> 60 <xsl:text> &&
</xsl:text> 76 61 </xsl:template> 77 62 -
jhalfs
r409488e r63b2859 2 2 3 3 version=" 4 jhalfs 0.2 4 jhalfs development 5 5 6 Written by Jeremy Huntwork. 6 7 Maintained by Manuel Canales Esparcia. … … 159 160 lfs-$LFSVRS/index.xml >>$JHALFSDIR/$LOG 2>&1 160 161 161 # Move the text files out from the chapter directories, and dump them162 # all into the 'commands' directory.163 cd commands164 find ./* -xtype f -exec mv '{}' . \;165 find ./* -maxdepth 0 -xtype d -exec rm -rf '{}' \;166 167 # Remove all the blank lines from the commands168 for i in $JHALFSDIR/commands/* ; do169 sed -i '/^$/d' $i170 done171 172 162 # Grab the patches and package names. 173 163 cd $JHALFSDIR … … 264 254 >$MKFILE.tmp 265 255 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 268 261 # the names of the targets in the Makefile 269 262 list="$list $i" … … 294 287 fi 295 288 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 303 299 304 300 # 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.