r3638 - in jhalfs/branches/ablfs/BLFS: . xsl

pierre at linuxfromscratch.org pierre at linuxfromscratch.org
Wed Dec 12 13:05:18 PST 2012


Author: pierre
Date: 2012-12-12 14:05:08 -0700 (Wed, 12 Dec 2012)
New Revision: 3638

Modified:
   jhalfs/branches/ablfs/BLFS/gen-special.sh
   jhalfs/branches/ablfs/BLFS/xsl/dependencies.xsl
   jhalfs/branches/ablfs/BLFS/xsl/scripts.xsl
Log:
Adjust to modifications in X Window chapter

Modified: jhalfs/branches/ablfs/BLFS/gen-special.sh
===================================================================
--- jhalfs/branches/ablfs/BLFS/gen-special.sh	2012-07-26 10:23:46 UTC (rev 3637)
+++ jhalfs/branches/ablfs/BLFS/gen-special.sh	2012-12-12 21:05:08 UTC (rev 3638)
@@ -13,7 +13,7 @@
 EXCEPTIONS=$(grep 'ENTITY.*version[ ]*"[^0-9"&.].*[0-9]' $BLFS_XML |
              sed 's@^[^"]*"\([^"]*\)".*@\1@')
 # Version for X Window packages without a version in the book
-XVERSION=$(grep 'ENTITY xorg7-release' $BLFS_XML |
+XVERSION=$(grep 'ENTITY xorg-version' $BLFS_XML |
            sed 's@^[^"]*"\([^"]*\)".*@\1@')
 # The case of udev
 # Set PATH to be sure to find udevadm

Modified: jhalfs/branches/ablfs/BLFS/xsl/dependencies.xsl
===================================================================
--- jhalfs/branches/ablfs/BLFS/xsl/dependencies.xsl	2012-07-26 10:23:46 UTC (rev 3637)
+++ jhalfs/branches/ablfs/BLFS/xsl/dependencies.xsl	2012-12-12 21:05:08 UTC (rev 3638)
@@ -42,8 +42,8 @@
   <xsl:template match="dependency">
     <xsl:variable name="depname">
       <xsl:choose>
-        <xsl:when test="@name='x-window-system'">xterm2</xsl:when>
-        <xsl:when test="@name='xorg7'">xterm2</xsl:when>
+        <xsl:when test="@name='x-window-system'">xinit</xsl:when>
+        <xsl:when test="@name='xorg7'">xinit</xsl:when>
         <xsl:when test="@name='server-mail'">
           <xsl:value-of select="$MTA"/>
         </xsl:when>

Modified: jhalfs/branches/ablfs/BLFS/xsl/scripts.xsl
===================================================================
--- jhalfs/branches/ablfs/BLFS/xsl/scripts.xsl	2012-07-26 10:23:46 UTC (rev 3637)
+++ jhalfs/branches/ablfs/BLFS/xsl/scripts.xsl	2012-12-12 21:05:08 UTC (rev 3638)
@@ -1,4 +1,4 @@
-<?xml version="1.0"?>
+<?xml version="1.0"?>
 
 <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
     xmlns:exsl="http://exslt.org/common"
@@ -88,7 +88,7 @@
             </xsl:if>
             <xsl:if test="@id='xorg7-server'">
               <xsl:text>cd $SRC_DIR/MesaLib
-UNPACKDIR=`head -n1 unpacked | sed 's@^./@@;s@/.*@@'`
+UNPACKDIR=`grep '[^./]\+' unpacked | head -n1 | sed 's@^./@@;s@/.*@@'`
 rm -rf $UNPACKDIR unpacked&#xA;&#xA;</xsl:text>
             </xsl:if> -->
           </xsl:when>
@@ -125,11 +125,11 @@
         <xsl:text>
 if [ "${PACKAGE%.zip}" = "${PACKAGE}" ]; then
  if [[ -e unpacked ]] ; then
-  UNPACKDIR=`head -n1 unpacked | sed 's@^./@@;s@/.*@@'`
+  UNPACKDIR=`grep '[^./]\+' unpacked | head -n1 | sed 's@^./@@;s@/.*@@'`
   [[ -n $UNPACKDIR ]] && [[ -d $UNPACKDIR ]] && rm -rf $UNPACKDIR
  fi
  tar -xvf $PACKAGE > unpacked
- UNPACKDIR=`head -n1 unpacked | sed 's@^./@@;s@/.*@@'`
+ UNPACKDIR=`grep '[^./]\+' unpacked | head -n1 | sed 's@^./@@;s@/.*@@'`
 else
  UNPACKDIR=${PACKAGE%.zip}
  [[ -n $UNPACKDIR ]] && [[ -d $UNPACKDIR ]] && rm -rf $UNPACKDIR
@@ -150,56 +150,24 @@
 
   <xsl:template match="sect2" mode="xorg7">
     <xsl:choose>
-      <xsl:when test="@role = 'package'">
+ <!--     <xsl:when test="@role = 'package'">
         <xsl:apply-templates select="itemizedlist/listitem/para" mode="xorg7"/>
-      </xsl:when>
+      </xsl:when>-->
       <xsl:when test="not(@role)">
-<!-- Useless        <xsl:text>SRC_ARCHIVE=$SRC_ARCHIVE
-FTP_SERVER=$FTP_SERVER&#xA;</xsl:text> -->
-        <xsl:apply-templates select=".//screen" mode="sect-ver"/>
-        <xsl:text>mkdir -p ${section}&#xA;cd ${section}&#xA;</xsl:text>
-        <xsl:apply-templates select="../sect2[@role='package']/itemizedlist/listitem/para" mode="xorg7-patch"/>
-        <xsl:text>for line in $(grep -v '^#' ../${sect_ver}.wget) ; do
-  if [[ ! -f ${line} ]] ; then
-    if [[ -f $SRC_ARCHIVE/Xorg/${section}/${line} ]] ; then
-      cp $SRC_ARCHIVE/Xorg/${section}/${line} ${line}
-    elif [[ -f $SRC_ARCHIVE/Xorg/${line} ]] ; then
-      cp $SRC_ARCHIVE/Xorg/${line} ${line}
-    elif [[ -f $SRC_ARCHIVE/${section}/${line} ]] ; then
-      cp $SRC_ARCHIVE/${section}/${line} ${line}
-    elif [[ -f $SRC_ARCHIVE/${line} ]] ; then
-      cp $SRC_ARCHIVE/${line} ${line}
-    else
-      wget -T 30 -t 5 ${FTP_X_SERVER}pub/individual/${section}/${line} || \
-      wget -T 30 -t 5 http://xorg.freedesktop.org/releases/individual/${section}/${line}
-    fi
-  fi
-done
-md5sum -c ../${sect_ver}.md5
-cp ../${sect_ver}.wget ../${sect_ver}.wget.orig
-cp ../${sect_ver}.md5 ../${sect_ver}.md5.orig&#xA;</xsl:text>
+<!-- This is the packages download instructions> -->
+        <xsl:apply-templates select=".//screen" mode="xorg7"/>
       </xsl:when>
       <xsl:when test="@role = 'installation'">
-        <xsl:text>for package in $(grep -v '^#' ../${sect_ver}.wget) ; do
-  packagedir=$(echo $package | sed 's/.tar.bz2//')
-  tar -xf ${package}
-  cd ${packagedir}&#xA;</xsl:text>
-        <xsl:apply-templates select=".//screen | .//para/command"/>
-        <xsl:text>  cd ..
-  rm -rf ${packagedir}
-  sed -i "/${package}/d" ../${sect_ver}.wget
-  sed -i "/${package}/d" ../${sect_ver}.md5
-done
-mv ../${sect_ver}.wget.orig ../${sect_ver}.wget
-mv ../${sect_ver}.md5.orig ../${sect_ver}.md5&#xA;</xsl:text>
+        <xsl:apply-templates select=".//screen" mode="xorg7"/>
         <xsl:if test="$sudo = 'y'">
           <xsl:text>sudo /sbin/</xsl:text>
         </xsl:if>
         <xsl:text>ldconfig&#xA;&#xA;</xsl:text>
       </xsl:when>
       <xsl:when test="@role = 'configuration'">
+        <xsl:text>if [[ $XORG_PREFIX != /usr ]] ; then&#xA;</xsl:text>
         <xsl:apply-templates select=".//screen"/>
-        <xsl:text>&#xA;</xsl:text>
+        <xsl:text>fi&#xA;</xsl:text>
       </xsl:when>
     </xsl:choose>
   </xsl:template>
@@ -272,7 +240,7 @@
              select="following-sibling::itemizedlist[1]/listitem/para"
              mode="package"/>
       </xsl:when>
-      <xsl:when test="string()='Additional Downloads'">
+      <xsl:when test="contains(string(),'Additional')">
         <xsl:apply-templates
              select="following-sibling::itemizedlist[1]/listitem/para"
              mode="additional"/>
@@ -451,6 +419,13 @@
     </xsl:if>
   </xsl:template>
 
+  <xsl:template match="screen" mode="xorg7">
+    <xsl:if test="child::* = userinput and not(@role = 'nodump')">
+      <xsl:apply-templates select="userinput" mode="xorg7"/>
+      <xsl:text>&#xA;</xsl:text>
+    </xsl:if>
+  </xsl:template>
+
   <xsl:template match="screen" mode="config">
     <xsl:if test="preceding-sibling::para[1]/xref[@linkend='bootscripts']">
       <xsl:text>[[ ! -d $SRC_DIR/blfs-bootscripts ]] && mkdir $SRC_DIR/blfs-bootscripts
@@ -504,6 +479,69 @@
     <xsl:apply-templates/>
   </xsl:template>
 
+  <xsl:template match="userinput" mode="xorg7">
+    <xsl:apply-templates mode="xorg7"/>
+  </xsl:template>
+
+  <xsl:template match="text()" mode="xorg7">
+    <xsl:call-template name="output-text">
+      <xsl:with-param name="out-string" select="string()"/>
+    </xsl:call-template>
+  </xsl:template>
+
+  <xsl:template name="output-text">
+    <xsl:param name="out-string" select="''"/>
+    <xsl:choose>
+      <xsl:when test="contains($out-string,'bash -e')">
+        <xsl:call-template name="output-text">
+          <xsl:with-param name="out-string"
+                          select="substring-before($out-string,'bash -e')"/>
+        </xsl:call-template>
+        <xsl:text># bash -e</xsl:text>
+        <xsl:call-template name="output-text">
+          <xsl:with-param name="out-string"
+                          select="substring-after($out-string,'bash -e')"/>
+        </xsl:call-template>
+      </xsl:when>
+      <xsl:when test="contains($out-string,'exit')">
+        <xsl:call-template name="output-text">
+          <xsl:with-param name="out-string"
+                          select="substring-before($out-string,'exit')"/>
+        </xsl:call-template>
+        <xsl:text># exit</xsl:text>
+        <xsl:call-template name="output-text">
+          <xsl:with-param name="out-string"
+                          select="substring-after($out-string,'exit')"/>
+        </xsl:call-template>
+      </xsl:when>
+      <xsl:when test="contains($out-string,'mkdir')">
+        <xsl:call-template name="output-text">
+          <xsl:with-param name="out-string"
+                          select="substring-before($out-string,'mkdir')"/>
+        </xsl:call-template>
+        <xsl:text>mkdir -p</xsl:text>
+        <xsl:call-template name="output-text">
+          <xsl:with-param name="out-string"
+                          select="substring-after($out-string,'mkdir')"/>
+        </xsl:call-template>
+      </xsl:when>
+       <xsl:when test="contains($out-string,'rm -r ')">
+        <xsl:call-template name="output-text">
+          <xsl:with-param name="out-string"
+                          select="substring-before($out-string,'rm -r ')"/>
+        </xsl:call-template>
+        <xsl:text>rm -rf </xsl:text>
+        <xsl:call-template name="output-text">
+          <xsl:with-param name="out-string"
+                          select="substring-after($out-string,'rm -r ')"/>
+        </xsl:call-template>
+      </xsl:when>
+     <xsl:otherwise>
+        <xsl:value-of select="$out-string"/>
+      </xsl:otherwise>
+    </xsl:choose>
+  </xsl:template>
+
   <xsl:template match="text()" mode="root">
     <xsl:call-template name="output-root">
       <xsl:with-param name="out-string" select="string()"/>




More information about the alfs-log mailing list