r2275 - in jhalfs/trunk: . BLFS

manuel at linuxfromscratch.org manuel at linuxfromscratch.org
Mon Jan 23 11:40:08 PST 2006


Author: manuel
Date: 2006-01-23 12:40:07 -0700 (Mon, 23 Jan 2006)
New Revision: 2275

Added:
   jhalfs/trunk/BLFS/
   jhalfs/trunk/BLFS/dump-blfs-scripts.xsl
   jhalfs/trunk/BLFS/functions
   jhalfs/trunk/BLFS/jhablfs
   jhalfs/trunk/BLFS/jhablfs.conf
Removed:
   jhalfs/trunk/dump-blfs-scripts.xsl
   jhalfs/trunk/jhablfs
   jhalfs/trunk/jhablfs.conf
Log:
Moved BLFS files to the new BLFS dir.

Copied: jhalfs/trunk/BLFS/dump-blfs-scripts.xsl (from rev 2274, jhalfs/trunk/dump-blfs-scripts.xsl)
===================================================================
--- jhalfs/trunk/BLFS/dump-blfs-scripts.xsl	                        (rev 0)
+++ jhalfs/trunk/BLFS/dump-blfs-scripts.xsl	2006-01-23 19:40:07 UTC (rev 2275)
@@ -0,0 +1,190 @@
+<?xml version="1.0"?>
+
+<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+    xmlns:exsl="http://exslt.org/common"
+    extension-element-prefixes="exsl"
+    version="1.0">
+
+<!-- XSLT stylesheet to create shell scripts from BLFS books. -->
+
+  <!-- Run optional test suites? -->
+  <xsl:param name="testsuite" select="0"/>
+
+  <!-- FTP/HTTP server -->
+  <xsl:param name="server">
+    ftp://anduin.linuxfromscratch.org/BLFS/conglomeration
+  </xsl:param>
+
+  <xsl:template match="/">
+    <xsl:apply-templates select="//sect1"/>
+  </xsl:template>
+
+  <xsl:template match="sect1">
+    <xsl:if test="count(descendant::screen/userinput) > 0 and
+      count(descendant::screen/userinput) > count(descendant::screen[@role='nodump'])">
+        <!-- The dirs names -->
+      <xsl:variable name="pi-dir" select="../../processing-instruction('dbhtml')"/>
+      <xsl:variable name="pi-dir-value" select="substring-after($pi-dir,'dir=')"/>
+      <xsl:variable name="quote-dir" select="substring($pi-dir-value,1,1)"/>
+      <xsl:variable name="dirname" select="substring-before(substring($pi-dir-value,2),$quote-dir)"/>
+        <!-- The file names -->
+      <xsl:variable name="pi-file" select="processing-instruction('dbhtml')"/>
+      <xsl:variable name="pi-file-value" select="substring-after($pi-file,'filename=')"/>
+      <xsl:variable name="filename" select="substring-before(substring($pi-file-value,2),'.html')"/>
+        <!-- Package variables -->
+      <xsl:param name="package" select="sect1info/keywordset/keyword[@role='package']"/>
+      <xsl:param name="ftpdir" select="sect1info/keywordset/keyword[@role='ftpdir']"/>
+        <!-- Creating dirs and files -->
+      <exsl:document href="{$dirname}/{$filename}" method="text">
+        <xsl:text>#!/bin/sh&#xA;set -e&#xA;&#xA;</xsl:text>
+        <xsl:apply-templates select="sect2 | screen">
+          <xsl:with-param name="package" select="$package"/>
+          <xsl:with-param name="ftpdir" select="$ftpdir"/>
+        </xsl:apply-templates>
+        <xsl:if test="sect2[@role='package']">
+          <xsl:text>cd ~/sources/</xsl:text>
+          <xsl:value-of select="$ftpdir"/>
+          <xsl:text>&#xA;rm -rf $UNPACKDIR&#xA;&#xA;</xsl:text>
+        </xsl:if>
+        <xsl:text>exit</xsl:text>
+      </exsl:document>
+    </xsl:if>
+  </xsl:template>
+
+  <xsl:template match="sect2">
+    <xsl:param name="package" select="foo"/>
+    <xsl:param name="ftpdir" select="foo"/>
+    <xsl:choose>
+      <xsl:when test="@role = 'package'">
+        <xsl:apply-templates select="para"/>
+        <xsl:text>&#xA;</xsl:text>
+        <xsl:text>mkdir -p ~/sources/</xsl:text>
+        <xsl:value-of select="$ftpdir"/>
+        <xsl:text>&#xA;cd ~/sources/</xsl:text>
+        <xsl:value-of select="$ftpdir"/>
+        <xsl:text>&#xA;</xsl:text>
+        <xsl:apply-templates select="itemizedlist/listitem/para">
+          <xsl:with-param name="package" select="$package"/>
+          <xsl:with-param name="ftpdir" select="$ftpdir"/>
+        </xsl:apply-templates>
+        <xsl:text>&#xA;</xsl:text>
+      </xsl:when>
+      <xsl:when test="@role = 'installation'">
+        <xsl:text>tar -xvf </xsl:text>
+        <xsl:value-of select="$package"/>
+        <xsl:text>.* > /tmp/unpacked&#xA;</xsl:text>
+        <xsl:text>UNPACKDIR=`head -n1 /tmp/unpacked | sed 's@^./@@;s@/.*@@'`&#xA;</xsl:text>
+        <xsl:text>cd $UNPACKDIR&#xA;</xsl:text>
+        <xsl:apply-templates select=".//screen | .//para/command"/>
+        <xsl:text>&#xA;</xsl:text>
+      </xsl:when>
+      <xsl:when test="@role = 'configuration'">
+        <xsl:apply-templates select=".//screen"/>
+        <xsl:text>&#xA;</xsl:text>
+      </xsl:when>
+      <xsl:otherwise/>
+    </xsl:choose>
+  </xsl:template>
+
+  <xsl:template match="para">
+    <xsl:choose>
+     <xsl:when test="@role = 'required'">
+       <xsl:text># REQUIRED: </xsl:text>
+       <xsl:apply-templates select="xref"/>
+       <xsl:text>&#xA;</xsl:text>
+     </xsl:when>
+     <xsl:when test="@role = 'recommended'">
+       <xsl:text># RECOMMENDED: </xsl:text>
+       <xsl:apply-templates select="xref"/>
+       <xsl:text>&#xA;</xsl:text>
+     </xsl:when>
+     <xsl:when test="@role = 'optional'">
+       <xsl:text># OPTIONAL: </xsl:text>
+       <xsl:apply-templates select="xref"/>
+       <xsl:text>&#xA;</xsl:text>
+     </xsl:when>
+     <xsl:otherwise/>
+    </xsl:choose>
+  </xsl:template>
+
+  <xsl:template match="xref">
+    <xsl:value-of select="@linkend"/>
+    <xsl:text>&#x20;&#x20;</xsl:text>
+  </xsl:template>
+
+  <xsl:template match="itemizedlist/listitem/para">
+    <xsl:param name="package" select="foo"/>
+    <xsl:param name="ftpdir" select="foo"/>
+    <xsl:choose>
+      <xsl:when test="contains(string(),'HTTP')">
+        <xsl:text>wget </xsl:text>
+        <xsl:value-of select="ulink/@url"/>
+        <xsl:text> || \&#xA;</xsl:text>
+      </xsl:when>
+      <xsl:when test="contains(string(),'FTP')">
+        <xsl:text>wget </xsl:text>
+        <xsl:value-of select="ulink/@url"/>
+        <xsl:text> || \&#xA;</xsl:text>
+      </xsl:when>
+      <xsl:when test="contains(string(),'MD5')">
+        <xsl:text>wget </xsl:text>
+        <xsl:value-of select="$server"/>
+        <xsl:text>/</xsl:text>
+        <xsl:value-of select="$ftpdir"/>
+        <xsl:text>/</xsl:text>
+        <xsl:value-of select="$package"/>
+        <xsl:text>.bz2&#xA;</xsl:text>
+          <!-- Commented out due that we don't know where the package
+          will be dowloaded from.
+        <xsl:text>echo "</xsl:text>
+        <xsl:value-of select="substring-after(string(),'sum: ')"/>
+        <xsl:text>&#x20;&#x20;</xsl:text>
+        <xsl:value-of select="$package"/>
+        <xsl:text>" | md5sum -c -&#xA;</xsl:text>-->
+      </xsl:when>
+      <xsl:when test="contains(string(),'patch')">
+        <xsl:text>wget </xsl:text>
+        <xsl:value-of select="ulink/@url"/>
+        <xsl:text>&#xA;</xsl:text>
+      </xsl:when>
+      <xsl:otherwise/>
+    </xsl:choose>
+  </xsl:template>
+
+  <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>
+  </xsl:template>
+
+  <xsl:template match="para/command">
+    <xsl:if test="$testsuite != '0' and
+            (contains(string(),'test') or
+            contains(string(),'check'))">
+      <xsl:value-of select="substring-before(string(),'make')"/>
+      <xsl:text>make -k</xsl:text>
+      <xsl:value-of select="substring-after(string(),'make')"/>
+      <xsl:text> || true&#xA;</xsl:text>
+    </xsl:if>
+  </xsl:template>
+
+  <xsl:template match="userinput" mode="screen">
+    <xsl:apply-templates/>
+    <xsl:text>&#xA;</xsl:text>
+  </xsl:template>
+
+  <xsl:template match="replaceable">
+    <xsl:text>**EDITME</xsl:text>
+    <xsl:apply-templates/>
+    <xsl:text>EDITME**</xsl:text>
+  </xsl:template>
+
+</xsl:stylesheet>

Copied: jhalfs/trunk/BLFS/functions (from rev 2273, jhalfs/trunk/functions)
===================================================================
--- jhalfs/trunk/BLFS/functions	                        (rev 0)
+++ jhalfs/trunk/BLFS/functions	2006-01-23 19:40:07 UTC (rev 2275)
@@ -0,0 +1,59 @@
+BOLD= ""
+RED= ""
+GREEN= ""
+ORANGE= ""
+BLUE= ""
+WHITE= ""
+
+define echo_message
+  @echo $(BOLD)
+  @echo ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+  @echo $(BOLD)$(1) target $(BLUE)$@$(BOLD)
+  @echo ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~$(WHITE)
+endef
+
+define unpack
+  @if [ -f $(LFS)$(SRC)/$(1).bz2 ] ; then \
+    cd $(LFS)$(SRC) ; tar -xvjf $(1).bz2 > /tmp/unpacked ; \
+  else \
+    cd $(LFS)$(SRC) ; tar -xvzf $(1).gz > /tmp/unpacked ; \
+  fi ;
+endef
+
+define unpack2
+  @cd $(LFS)$(SRC) ; /tools/bin/tar -xvf $(1) > /tmp/unpacked
+endef
+
+define echo_finished
+  @echo $(BOLD)
+  @echo ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+  @echo $(BOLD) Finished the build of $(BLUE)LFS-$(1)$(BOLD)
+  @echo ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+  @echo -e \\t\\t$(RED)W A R N I N G$(BOLD)
+  @echo ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+  @echo
+  @echo To be able to boot your new LFS system you need to follow
+  @echo the next steps:$(WHITE)
+  @echo
+  @echo -e \\t- Enter to the chroot using the command found
+  @echo -e \\tin chapter06/revisedchroot.html
+  @echo
+  @echo -e \\t- Set a password for the root user
+  @echo
+  @echo -e \\t- Edit /etc/fstab, /etc/hosts, /etc/sysconfig/clock,
+  @echo -e \\t/etc/sysconfig/console, /etc/sysconfig/network,
+  @echo -e \\t/etc/sysconfig//network-devices/ifconfig.eth0/ipv4 and
+  @echo -e \\tany other configuration file required to suit your needs.
+  @echo
+  @echo -e \\t- Set-up Grub. See chapter08/grub.html
+  @echo
+  @echo -e \\t- Unmount the filesystems. See chapter09/reboot.html
+  @echo
+  @echo If you are an experienced LFS user, several of those steps can be
+  @echo skipped or done in a different way. But then, that is something
+  @echo that you already know and there is no need to discuss it here.
+  @echo $(BOLD)
+  @echo ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+  @echo -e \\t\\t$(GREEN)Have a nice day $(ORANGE):-\)$(BOLD)
+  @echo ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~$(WHITE)
+endef

Copied: jhalfs/trunk/BLFS/jhablfs (from rev 2273, jhalfs/trunk/jhablfs)
===================================================================
--- jhalfs/trunk/BLFS/jhablfs	                        (rev 0)
+++ jhalfs/trunk/BLFS/jhablfs	2006-01-23 19:40:07 UTC (rev 2275)
@@ -0,0 +1,341 @@
+#!/bin/sh
+
+#
+# Load the configuration file
+#
+source jhablfs.conf
+
+
+version="
+jhablfs development \$Date: 2005-12-04 13:24:26 +0100 (dom, 04 dic 2005) $
+
+Written by Jeremy Huntwork and Manuel Canales Esparcia.
+
+This program is published under the \
+Gnu General Public License, Version 2.
+"
+
+usage="\
+Usage: $0 [OPTION]
+
+Options:
+  -h, --help                    print this help, then exit
+
+  -V, --version                 print version number, then exit
+
+  -B, --BLFS-version VER        checkout VER version of the BLFS book.
+                                If not set, the development version
+                                is used.
+
+                                Supported versions at this time are:
+
+         dev* | trunk | SVN     aliases for Development BLFS
+
+  -W, --working-copy DIR        use the local working copy placed in DIR
+                                as the BLFS book
+
+  -D, --dependencies  TYPE      add dependencies of type TYPE to the build tree.
+                                If not set, both required a recommended are used.
+
+                                Possible values are:
+
+         required               only required dependecies are used
+         recommended            both required a recommended dependencies are used
+         optional               all dependencies are used
+
+  -S, --server SERVER           set the FTP/HTTP server used as fallback to
+                                download the packages. If not specified, the one
+                                set in jhablfs.conf is used.
+
+  -T, --testsuites              add support to run the optional testsuites
+
+"
+
+help="\
+Try '$0 --help' for more information."
+
+exit_missing_arg="\
+echo \"Option '\$1' requires an argument\" >&2
+echo \"\$help\" >&2
+exit 1"
+
+HEADER="# This file is automatically generated by jhablfs
+# EDIT THIS FILE MANUALLY TO SUIT YOUR NEEDS
+#
+# Generated on `date \"+%F %X %Z\"`"
+
+
+###################################
+###     FUNCTIONS   ###
+###################################
+
+
+#----------------------------#
+get_book() {
+#----------------------------#
+  # Check for Subversion instead of just letting the script hit 'svn' and fail.
+  test `type -p svn` || eval "echo \"This feature requires Subversion.\"
+  exit 1"
+  cd $JHABLFSDIR
+
+  if [ -z $WC ] ; then
+    echo -n "Downloading the BLFS Book, version $BLFSVRS... "
+
+    # Grab the BLFS book fresh if it's missing, otherwise, update it from the
+    # repo. If we've already extracted the commands, move on.
+    if [ -d blfs-$BLFSVRS ] ; then
+      cd blfs-$BLFSVRS
+      if LC_ALL=C svn up | grep -q At && test -d $JHABLFSDIR/commands ; then
+        echo -ne "done\n"
+        # Set the canonical book version
+        cd $JHABLFSDIR
+        VERSION=`grep "ENTITY version " $BOOK/general.ent | sed 's@<!ENTITY version "@@;s@">@@'`
+      else
+        echo -ne "done\n"
+        # Set the canonical book version
+        cd $JHABLFSDIR
+        VERSION=`grep "ENTITY version " $BOOK/general.ent | sed 's@<!ENTITY version "@@;s@">@@'`
+        extract_commands
+      fi
+    else
+      case $BLFSVRS in
+        development)
+           svn co $SVN/BLFS/trunk/BOOK blfs-$BLFSVRS >>$LOGDIR/$LOG 2>&1 ;;
+      esac
+      echo -ne "done\n"
+      # Set the canonical book version
+      cd $JHABLFSDIR
+      VERSION=`grep "ENTITY version " $BOOK/general.ent | sed 's@<!ENTITY version "@@;s@">@@'`
+      extract_commands
+    fi
+  else
+    echo -ne "Using $BOOK as book's sources ...\n"
+    # Set the canonical book version
+    cd $JHABLFSDIR
+    VERSION=`grep "ENTITY version " $BOOK/general.ent | sed 's@<!ENTITY version "@@;s@">@@'`
+    extract_commands
+  fi
+}
+
+#----------------------------#
+extract_commands() {
+#----------------------------#
+  # Check for libxslt instead of just letting the script hit 'xsltproc' and fail.
+  test `type -p xsltproc` || eval "echo \"This feature requires libxslt.\"
+  exit 1"
+  cd $JHABLFSDIR
+
+  # Start clean
+  if [ -d commands ] ; then rm -rf commands ; fi && mkdir commands
+  echo -n "Extracting commands... "
+
+  # Dump the commands in shell script form from the BLFS book.
+  xsltproc --nonet --xinclude --stringparam testsuite $TEST \
+     --stringparam server $SERVER -o ./commands/ $XSL $BOOK/index.xml >>$LOGDIR/$LOG 2>&1
+
+  # Make the scripts executable.
+  chmod -R +x $JHABLFSDIR/commands
+
+  # Done. Moving on...
+  echo -ne "done\n"
+}
+
+
+#----------------------------#
+build_Makefile() {
+#----------------------------#
+  echo -n "Creating Makefile... "
+  cd $JHABLFSDIR/commands
+
+  # Start with a clean Makefile file
+  >$MKFILE
+
+
+  # Add a header, some variables and include the function file
+  # to the top of the real Makefile.
+(
+    cat << EOF
+$HEADER
+
+include functions
+
+EOF
+) > $MKFILE
+
+  # Drop in a dummy target 'all:'.
+(
+    cat << EOF
+all:
+	@echo -e "\nThere is no default target predefined"
+	@echo -e "You must to tell what package(s) you want to install"
+	@echo -e "or edit the \"all\" Makefile target to create your own"
+	@echo -e "defualt target.\n"
+	@exit
+EOF
+) >> $MKFILE
+
+  # Bring over the build targets.
+  for file in */* ; do
+    # Keep the script file name
+    case $file in
+      gnome/config )
+        i=config-gnome
+        ;;
+      gnome/pre-install-config )
+        i=pre-intall-config-gnome
+        ;;
+      kde/config )
+        i=config-kde
+        ;;
+      kde/pre-install-config )
+        i=pre-intall-config-kde
+        ;;
+      * )
+        i=`basename $file`
+        ;;
+    esac
+
+    # Dump the package dependencies.
+    REQUIRED=`grep "REQUIRED" $file | sed 's/# REQUIRED://' | tr -d '\n'`
+    if [ "$DEPEND" != "0" ] ; then
+      RECOMMENDED=`grep "RECOMMENDED" $file | sed 's/# RECOMMENDED://' | tr -d '\n'`
+    fi
+    if [ "$DEPEND" = "2" ] ; then
+      OPTIONAL=`grep "OPTIONAL" $file | sed 's/# OPTIONAL://' | tr -d '\n'`
+    fi
+
+    # Drop in the name of the target on a new line plus its dependencies
+    # and call the echo_message function.
+(
+    cat << EOF
+
+$i:  $REQUIRED $RECOMMENDED $OPTIONAL
+	@\$(call echo_message, Building)
+EOF
+) >> $MKFILE
+
+    # Insert date and disk usage at the top of the log file, the script run
+    # and date and disk usage again at the bottom of the log file.
+(
+    cat << EOF
+	@echo -e "\n\`date\`\n\nKB: \`du -sk --exclude=logs/* /\`\n" >logs/$i && \\
+	$JHABLFSDIR/commands/$file >>logs/$i 2>&1 && \\
+	echo -e "\n\`date\`\n\nKB: \`du -sk --exclude=logs/* /\`\n" >>logs/$i
+EOF
+) >> $MKFILE
+
+    # Include a touch of the target name so make can check
+    # if it's already been made.
+(
+    cat << EOF
+	@touch \$@
+EOF
+) >> $MKFILE
+
+  done
+  echo -ne "done\n"
+}
+
+
+
+###################################
+###		MAIN		###
+###################################
+
+# Evaluate any command line switches
+
+while test $# -gt 0 ; do
+  case $1 in
+    --version | -V )
+      echo "$version"
+      exit 0
+      ;;
+
+    --help | -h )
+      echo "$usage"
+      exit 0
+      ;;
+
+    --BLFS-version | -B )
+      test $# = 1 && eval "$exit_missing_arg"
+      shift
+      case $1 in
+        dev* | SVN | trunk )
+          BLFSVRS=development
+          ;;
+        * )
+          echo "$1 is an unsupported version at this time."
+          exit 1
+          ;;
+      esac
+      ;;
+
+    --working-copy | -W )
+      test $# = 1 && eval "$exit_missing_arg"
+      shift
+      if [ -f $1/use-unzip.xml ] ; then
+      WC=1
+      BOOK=$1
+      else
+        echo -e "\nLook like $1 isn't a proper BLFS working copy."
+        echo -e "Verify your selection and the command line.\n"
+        exit 1
+      fi
+      ;;
+
+    --dependencies | -D )
+      test $# = 1 && eval "$exit_missing_arg"
+      shift
+      case $1 in
+        required )
+          DEPEND=0
+          ;;
+        recommended )
+          DEPEND=1
+          ;;
+        optional )
+          DEPEND=2
+          ;;
+        * )
+          echo "$1 is not a proper dependencies type."
+          exit 1
+          ;;
+      esac
+      ;;
+
+    --testsuites | -T )		TEST=1 ;;
+
+    --server | -S )
+      test $# = 1 && eval "$exit_missing_arg"
+      shift
+      case $1 in
+        *conglomeration )
+          SERVER=$1
+          ;;
+        * )
+          echo "$1 is not a proper HTTP/FTP path to the BLFS packages."
+          exit 1
+          ;;
+      esac
+      ;;
+
+    * )
+      echo "$usage"
+      exit 1
+      ;;
+  esac
+  shift
+done
+
+if [ -z $BOOK ] ; then
+  BOOK=blfs-$BLFSVRS
+fi
+
+[[ ! -d $JHABLFSDIR ]]        && mkdir -pv $JHABLFSDIR
+[[ "$PWD" != "$JHABLFSDIR" ]] && cp -v $FILES $JHABLFSDIR
+[[ ! -d $LOGDIR ]]            && mkdir -v $LOGDIR
+>$LOGDIR/$LOG
+
+get_book
+build_Makefile
+

Copied: jhalfs/trunk/BLFS/jhablfs.conf (from rev 2273, jhalfs/trunk/jhablfs.conf)
===================================================================
--- jhalfs/trunk/BLFS/jhablfs.conf	                        (rev 0)
+++ jhalfs/trunk/BLFS/jhablfs.conf	2006-01-23 19:40:07 UTC (rev 2275)
@@ -0,0 +1,36 @@
+#####
+#
+# Configuration file for the jhablfs build script
+#
+#####
+
+declare -r SVN="svn://svn.linuxfromscratch.org"
+declare -r LOG=000-jhablfs.log
+
+#--- Working directories
+JHABLFSDIR=~/jhablfs
+   LOGDIR=$JHABLFSDIR/logs
+   MKFILE=$JHABLFSDIR/Makefile
+
+#--- Book version
+BLFSVRS=development
+
+#--- FTP/HTTP mirror used as fallback (full path)
+SERVER=ftp://anduin.linuxfromscratch.org/BLFS/conglomeration
+
+#--- Dependencies 0(required)/1(recommended)/2(optional)
+DEPEND=1
+
+#--- Run test suites  0(no)/1(yes)
+TEST=0
+
+
+
+#==== INTERNAL VARIABLES ====
+# Don't edit it unless you know what you are doing
+
+#--- Default stylesheet
+XSL=dump-blfs-scripts.xsl
+
+#--- Files that will be copied to $JHABLFSDIR
+FILES="functions dump-blfs-scripts.xsl"

Deleted: jhalfs/trunk/dump-blfs-scripts.xsl
===================================================================
--- jhalfs/trunk/dump-blfs-scripts.xsl	2006-01-15 10:37:14 UTC (rev 2274)
+++ jhalfs/trunk/dump-blfs-scripts.xsl	2006-01-23 19:40:07 UTC (rev 2275)
@@ -1,190 +0,0 @@
-<?xml version="1.0"?>
-
-<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
-    xmlns:exsl="http://exslt.org/common"
-    extension-element-prefixes="exsl"
-    version="1.0">
-
-<!-- XSLT stylesheet to create shell scripts from BLFS books. -->
-
-  <!-- Run optional test suites? -->
-  <xsl:param name="testsuite" select="0"/>
-
-  <!-- FTP/HTTP server -->
-  <xsl:param name="server">
-    ftp://anduin.linuxfromscratch.org/BLFS/conglomeration
-  </xsl:param>
-
-  <xsl:template match="/">
-    <xsl:apply-templates select="//sect1"/>
-  </xsl:template>
-
-  <xsl:template match="sect1">
-    <xsl:if test="count(descendant::screen/userinput) > 0 and
-      count(descendant::screen/userinput) > count(descendant::screen[@role='nodump'])">
-        <!-- The dirs names -->
-      <xsl:variable name="pi-dir" select="../../processing-instruction('dbhtml')"/>
-      <xsl:variable name="pi-dir-value" select="substring-after($pi-dir,'dir=')"/>
-      <xsl:variable name="quote-dir" select="substring($pi-dir-value,1,1)"/>
-      <xsl:variable name="dirname" select="substring-before(substring($pi-dir-value,2),$quote-dir)"/>
-        <!-- The file names -->
-      <xsl:variable name="pi-file" select="processing-instruction('dbhtml')"/>
-      <xsl:variable name="pi-file-value" select="substring-after($pi-file,'filename=')"/>
-      <xsl:variable name="filename" select="substring-before(substring($pi-file-value,2),'.html')"/>
-        <!-- Package variables -->
-      <xsl:param name="package" select="sect1info/keywordset/keyword[@role='package']"/>
-      <xsl:param name="ftpdir" select="sect1info/keywordset/keyword[@role='ftpdir']"/>
-        <!-- Creating dirs and files -->
-      <exsl:document href="{$dirname}/{$filename}" method="text">
-        <xsl:text>#!/bin/sh&#xA;set -e&#xA;&#xA;</xsl:text>
-        <xsl:apply-templates select="sect2 | screen">
-          <xsl:with-param name="package" select="$package"/>
-          <xsl:with-param name="ftpdir" select="$ftpdir"/>
-        </xsl:apply-templates>
-        <xsl:if test="sect2[@role='package']">
-          <xsl:text>cd ~/sources/</xsl:text>
-          <xsl:value-of select="$ftpdir"/>
-          <xsl:text>&#xA;rm -rf $UNPACKDIR&#xA;&#xA;</xsl:text>
-        </xsl:if>
-        <xsl:text>exit</xsl:text>
-      </exsl:document>
-    </xsl:if>
-  </xsl:template>
-
-  <xsl:template match="sect2">
-    <xsl:param name="package" select="foo"/>
-    <xsl:param name="ftpdir" select="foo"/>
-    <xsl:choose>
-      <xsl:when test="@role = 'package'">
-        <xsl:apply-templates select="para"/>
-        <xsl:text>&#xA;</xsl:text>
-        <xsl:text>mkdir -p ~/sources/</xsl:text>
-        <xsl:value-of select="$ftpdir"/>
-        <xsl:text>&#xA;cd ~/sources/</xsl:text>
-        <xsl:value-of select="$ftpdir"/>
-        <xsl:text>&#xA;</xsl:text>
-        <xsl:apply-templates select="itemizedlist/listitem/para">
-          <xsl:with-param name="package" select="$package"/>
-          <xsl:with-param name="ftpdir" select="$ftpdir"/>
-        </xsl:apply-templates>
-        <xsl:text>&#xA;</xsl:text>
-      </xsl:when>
-      <xsl:when test="@role = 'installation'">
-        <xsl:text>tar -xvf </xsl:text>
-        <xsl:value-of select="$package"/>
-        <xsl:text>.* > /tmp/unpacked&#xA;</xsl:text>
-        <xsl:text>UNPACKDIR=`head -n1 /tmp/unpacked | sed 's@^./@@;s@/.*@@'`&#xA;</xsl:text>
-        <xsl:text>cd $UNPACKDIR&#xA;</xsl:text>
-        <xsl:apply-templates select=".//screen | .//para/command"/>
-        <xsl:text>&#xA;</xsl:text>
-      </xsl:when>
-      <xsl:when test="@role = 'configuration'">
-        <xsl:apply-templates select=".//screen"/>
-        <xsl:text>&#xA;</xsl:text>
-      </xsl:when>
-      <xsl:otherwise/>
-    </xsl:choose>
-  </xsl:template>
-
-  <xsl:template match="para">
-    <xsl:choose>
-     <xsl:when test="@role = 'required'">
-       <xsl:text># REQUIRED: </xsl:text>
-       <xsl:apply-templates select="xref"/>
-       <xsl:text>&#xA;</xsl:text>
-     </xsl:when>
-     <xsl:when test="@role = 'recommended'">
-       <xsl:text># RECOMMENDED: </xsl:text>
-       <xsl:apply-templates select="xref"/>
-       <xsl:text>&#xA;</xsl:text>
-     </xsl:when>
-     <xsl:when test="@role = 'optional'">
-       <xsl:text># OPTIONAL: </xsl:text>
-       <xsl:apply-templates select="xref"/>
-       <xsl:text>&#xA;</xsl:text>
-     </xsl:when>
-     <xsl:otherwise/>
-    </xsl:choose>
-  </xsl:template>
-
-  <xsl:template match="xref">
-    <xsl:value-of select="@linkend"/>
-    <xsl:text>&#x20;&#x20;</xsl:text>
-  </xsl:template>
-
-  <xsl:template match="itemizedlist/listitem/para">
-    <xsl:param name="package" select="foo"/>
-    <xsl:param name="ftpdir" select="foo"/>
-    <xsl:choose>
-      <xsl:when test="contains(string(),'HTTP')">
-        <xsl:text>wget </xsl:text>
-        <xsl:value-of select="ulink/@url"/>
-        <xsl:text> || \&#xA;</xsl:text>
-      </xsl:when>
-      <xsl:when test="contains(string(),'FTP')">
-        <xsl:text>wget </xsl:text>
-        <xsl:value-of select="ulink/@url"/>
-        <xsl:text> || \&#xA;</xsl:text>
-      </xsl:when>
-      <xsl:when test="contains(string(),'MD5')">
-        <xsl:text>wget </xsl:text>
-        <xsl:value-of select="$server"/>
-        <xsl:text>/</xsl:text>
-        <xsl:value-of select="$ftpdir"/>
-        <xsl:text>/</xsl:text>
-        <xsl:value-of select="$package"/>
-        <xsl:text>.bz2&#xA;</xsl:text>
-          <!-- Commented out due that we don't know where the package
-          will be dowloaded from.
-        <xsl:text>echo "</xsl:text>
-        <xsl:value-of select="substring-after(string(),'sum: ')"/>
-        <xsl:text>&#x20;&#x20;</xsl:text>
-        <xsl:value-of select="$package"/>
-        <xsl:text>" | md5sum -c -&#xA;</xsl:text>-->
-      </xsl:when>
-      <xsl:when test="contains(string(),'patch')">
-        <xsl:text>wget </xsl:text>
-        <xsl:value-of select="ulink/@url"/>
-        <xsl:text>&#xA;</xsl:text>
-      </xsl:when>
-      <xsl:otherwise/>
-    </xsl:choose>
-  </xsl:template>
-
-  <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>
-  </xsl:template>
-
-  <xsl:template match="para/command">
-    <xsl:if test="$testsuite != '0' and
-            (contains(string(),'test') or
-            contains(string(),'check'))">
-      <xsl:value-of select="substring-before(string(),'make')"/>
-      <xsl:text>make -k</xsl:text>
-      <xsl:value-of select="substring-after(string(),'make')"/>
-      <xsl:text> || true&#xA;</xsl:text>
-    </xsl:if>
-  </xsl:template>
-
-  <xsl:template match="userinput" mode="screen">
-    <xsl:apply-templates/>
-    <xsl:text>&#xA;</xsl:text>
-  </xsl:template>
-
-  <xsl:template match="replaceable">
-    <xsl:text>**EDITME</xsl:text>
-    <xsl:apply-templates/>
-    <xsl:text>EDITME**</xsl:text>
-  </xsl:template>
-
-</xsl:stylesheet>

Deleted: jhalfs/trunk/jhablfs
===================================================================
--- jhalfs/trunk/jhablfs	2006-01-15 10:37:14 UTC (rev 2274)
+++ jhalfs/trunk/jhablfs	2006-01-23 19:40:07 UTC (rev 2275)
@@ -1,341 +0,0 @@
-#!/bin/sh
-
-#
-# Load the configuration file
-#
-source jhablfs.conf
-
-
-version="
-jhablfs development \$Date: 2005-12-04 13:24:26 +0100 (dom, 04 dic 2005) $
-
-Written by Jeremy Huntwork and Manuel Canales Esparcia.
-
-This program is published under the \
-Gnu General Public License, Version 2.
-"
-
-usage="\
-Usage: $0 [OPTION]
-
-Options:
-  -h, --help                    print this help, then exit
-
-  -V, --version                 print version number, then exit
-
-  -B, --BLFS-version VER        checkout VER version of the BLFS book.
-                                If not set, the development version
-                                is used.
-
-                                Supported versions at this time are:
-
-         dev* | trunk | SVN     aliases for Development BLFS
-
-  -W, --working-copy DIR        use the local working copy placed in DIR
-                                as the BLFS book
-
-  -D, --dependencies  TYPE      add dependencies of type TYPE to the build tree.
-                                If not set, both required a recommended are used.
-
-                                Possible values are:
-
-         required               only required dependecies are used
-         recommended            both required a recommended dependencies are used
-         optional               all dependencies are used
-
-  -S, --server SERVER           set the FTP/HTTP server used as fallback to
-                                download the packages. If not specified, the one
-                                set in jhablfs.conf is used.
-
-  -T, --testsuites              add support to run the optional testsuites
-
-"
-
-help="\
-Try '$0 --help' for more information."
-
-exit_missing_arg="\
-echo \"Option '\$1' requires an argument\" >&2
-echo \"\$help\" >&2
-exit 1"
-
-HEADER="# This file is automatically generated by jhablfs
-# EDIT THIS FILE MANUALLY TO SUIT YOUR NEEDS
-#
-# Generated on `date \"+%F %X %Z\"`"
-
-
-###################################
-###     FUNCTIONS   ###
-###################################
-
-
-#----------------------------#
-get_book() {
-#----------------------------#
-  # Check for Subversion instead of just letting the script hit 'svn' and fail.
-  test `type -p svn` || eval "echo \"This feature requires Subversion.\"
-  exit 1"
-  cd $JHABLFSDIR
-
-  if [ -z $WC ] ; then
-    echo -n "Downloading the BLFS Book, version $BLFSVRS... "
-
-    # Grab the BLFS book fresh if it's missing, otherwise, update it from the
-    # repo. If we've already extracted the commands, move on.
-    if [ -d blfs-$BLFSVRS ] ; then
-      cd blfs-$BLFSVRS
-      if LC_ALL=C svn up | grep -q At && test -d $JHABLFSDIR/commands ; then
-        echo -ne "done\n"
-        # Set the canonical book version
-        cd $JHABLFSDIR
-        VERSION=`grep "ENTITY version " $BOOK/general.ent | sed 's@<!ENTITY version "@@;s@">@@'`
-      else
-        echo -ne "done\n"
-        # Set the canonical book version
-        cd $JHABLFSDIR
-        VERSION=`grep "ENTITY version " $BOOK/general.ent | sed 's@<!ENTITY version "@@;s@">@@'`
-        extract_commands
-      fi
-    else
-      case $BLFSVRS in
-        development)
-           svn co $SVN/BLFS/trunk/BOOK blfs-$BLFSVRS >>$LOGDIR/$LOG 2>&1 ;;
-      esac
-      echo -ne "done\n"
-      # Set the canonical book version
-      cd $JHABLFSDIR
-      VERSION=`grep "ENTITY version " $BOOK/general.ent | sed 's@<!ENTITY version "@@;s@">@@'`
-      extract_commands
-    fi
-  else
-    echo -ne "Using $BOOK as book's sources ...\n"
-    # Set the canonical book version
-    cd $JHABLFSDIR
-    VERSION=`grep "ENTITY version " $BOOK/general.ent | sed 's@<!ENTITY version "@@;s@">@@'`
-    extract_commands
-  fi
-}
-
-#----------------------------#
-extract_commands() {
-#----------------------------#
-  # Check for libxslt instead of just letting the script hit 'xsltproc' and fail.
-  test `type -p xsltproc` || eval "echo \"This feature requires libxslt.\"
-  exit 1"
-  cd $JHABLFSDIR
-
-  # Start clean
-  if [ -d commands ] ; then rm -rf commands ; fi && mkdir commands
-  echo -n "Extracting commands... "
-
-  # Dump the commands in shell script form from the BLFS book.
-  xsltproc --nonet --xinclude --stringparam testsuite $TEST \
-     --stringparam server $SERVER -o ./commands/ $XSL $BOOK/index.xml >>$LOGDIR/$LOG 2>&1
-
-  # Make the scripts executable.
-  chmod -R +x $JHABLFSDIR/commands
-
-  # Done. Moving on...
-  echo -ne "done\n"
-}
-
-
-#----------------------------#
-build_Makefile() {
-#----------------------------#
-  echo -n "Creating Makefile... "
-  cd $JHABLFSDIR/commands
-
-  # Start with a clean Makefile file
-  >$MKFILE
-
-
-  # Add a header, some variables and include the function file
-  # to the top of the real Makefile.
-(
-    cat << EOF
-$HEADER
-
-include functions
-
-EOF
-) > $MKFILE
-
-  # Drop in a dummy target 'all:'.
-(
-    cat << EOF
-all:
-	@echo -e "\nThere is no default target predefined"
-	@echo -e "You must to tell what package(s) you want to install"
-	@echo -e "or edit the \"all\" Makefile target to create your own"
-	@echo -e "defualt target.\n"
-	@exit
-EOF
-) >> $MKFILE
-
-  # Bring over the build targets.
-  for file in */* ; do
-    # Keep the script file name
-    case $file in
-      gnome/config )
-        i=config-gnome
-        ;;
-      gnome/pre-install-config )
-        i=pre-intall-config-gnome
-        ;;
-      kde/config )
-        i=config-kde
-        ;;
-      kde/pre-install-config )
-        i=pre-intall-config-kde
-        ;;
-      * )
-        i=`basename $file`
-        ;;
-    esac
-
-    # Dump the package dependencies.
-    REQUIRED=`grep "REQUIRED" $file | sed 's/# REQUIRED://' | tr -d '\n'`
-    if [ "$DEPEND" != "0" ] ; then
-      RECOMMENDED=`grep "RECOMMENDED" $file | sed 's/# RECOMMENDED://' | tr -d '\n'`
-    fi
-    if [ "$DEPEND" = "2" ] ; then
-      OPTIONAL=`grep "OPTIONAL" $file | sed 's/# OPTIONAL://' | tr -d '\n'`
-    fi
-
-    # Drop in the name of the target on a new line plus its dependencies
-    # and call the echo_message function.
-(
-    cat << EOF
-
-$i:  $REQUIRED $RECOMMENDED $OPTIONAL
-	@\$(call echo_message, Building)
-EOF
-) >> $MKFILE
-
-    # Insert date and disk usage at the top of the log file, the script run
-    # and date and disk usage again at the bottom of the log file.
-(
-    cat << EOF
-	@echo -e "\n\`date\`\n\nKB: \`du -sk --exclude=logs/* /\`\n" >logs/$i && \\
-	$JHABLFSDIR/commands/$file >>logs/$i 2>&1 && \\
-	echo -e "\n\`date\`\n\nKB: \`du -sk --exclude=logs/* /\`\n" >>logs/$i
-EOF
-) >> $MKFILE
-
-    # Include a touch of the target name so make can check
-    # if it's already been made.
-(
-    cat << EOF
-	@touch \$@
-EOF
-) >> $MKFILE
-
-  done
-  echo -ne "done\n"
-}
-
-
-
-###################################
-###		MAIN		###
-###################################
-
-# Evaluate any command line switches
-
-while test $# -gt 0 ; do
-  case $1 in
-    --version | -V )
-      echo "$version"
-      exit 0
-      ;;
-
-    --help | -h )
-      echo "$usage"
-      exit 0
-      ;;
-
-    --BLFS-version | -B )
-      test $# = 1 && eval "$exit_missing_arg"
-      shift
-      case $1 in
-        dev* | SVN | trunk )
-          BLFSVRS=development
-          ;;
-        * )
-          echo "$1 is an unsupported version at this time."
-          exit 1
-          ;;
-      esac
-      ;;
-
-    --working-copy | -W )
-      test $# = 1 && eval "$exit_missing_arg"
-      shift
-      if [ -f $1/use-unzip.xml ] ; then
-      WC=1
-      BOOK=$1
-      else
-        echo -e "\nLook like $1 isn't a proper BLFS working copy."
-        echo -e "Verify your selection and the command line.\n"
-        exit 1
-      fi
-      ;;
-
-    --dependencies | -D )
-      test $# = 1 && eval "$exit_missing_arg"
-      shift
-      case $1 in
-        required )
-          DEPEND=0
-          ;;
-        recommended )
-          DEPEND=1
-          ;;
-        optional )
-          DEPEND=2
-          ;;
-        * )
-          echo "$1 is not a proper dependencies type."
-          exit 1
-          ;;
-      esac
-      ;;
-
-    --testsuites | -T )		TEST=1 ;;
-
-    --server | -S )
-      test $# = 1 && eval "$exit_missing_arg"
-      shift
-      case $1 in
-        *conglomeration )
-          SERVER=$1
-          ;;
-        * )
-          echo "$1 is not a proper HTTP/FTP path to the BLFS packages."
-          exit 1
-          ;;
-      esac
-      ;;
-
-    * )
-      echo "$usage"
-      exit 1
-      ;;
-  esac
-  shift
-done
-
-if [ -z $BOOK ] ; then
-  BOOK=blfs-$BLFSVRS
-fi
-
-[[ ! -d $JHABLFSDIR ]]        && mkdir -pv $JHABLFSDIR
-[[ "$PWD" != "$JHABLFSDIR" ]] && cp -v $FILES $JHABLFSDIR
-[[ ! -d $LOGDIR ]]            && mkdir -v $LOGDIR
->$LOGDIR/$LOG
-
-get_book
-build_Makefile
-

Deleted: jhalfs/trunk/jhablfs.conf
===================================================================
--- jhalfs/trunk/jhablfs.conf	2006-01-15 10:37:14 UTC (rev 2274)
+++ jhalfs/trunk/jhablfs.conf	2006-01-23 19:40:07 UTC (rev 2275)
@@ -1,36 +0,0 @@
-#####
-#
-# Configuration file for the jhablfs build script
-#
-#####
-
-declare -r SVN="svn://svn.linuxfromscratch.org"
-declare -r LOG=000-jhablfs.log
-
-#--- Working directories
-JHABLFSDIR=~/jhablfs
-   LOGDIR=$JHABLFSDIR/logs
-   MKFILE=$JHABLFSDIR/Makefile
-
-#--- Book version
-BLFSVRS=development
-
-#--- FTP/HTTP mirror used as fallback (full path)
-SERVER=ftp://anduin.linuxfromscratch.org/BLFS/conglomeration
-
-#--- Dependencies 0(required)/1(recommended)/2(optional)
-DEPEND=1
-
-#--- Run test suites  0(no)/1(yes)
-TEST=0
-
-
-
-#==== INTERNAL VARIABLES ====
-# Don't edit it unless you know what you are doing
-
-#--- Default stylesheet
-XSL=dump-blfs-scripts.xsl
-
-#--- Files that will be copied to $JHABLFSDIR
-FILES="functions dump-blfs-scripts.xsl"




More information about the alfs-log mailing list