r2721 - in jhalfs/branches/experimental/BLFS: . libs

manuel at linuxfromscratch.org manuel at linuxfromscratch.org
Sat May 27 03:33:14 PDT 2006


Author: manuel
Date: 2006-05-27 04:33:12 -0600 (Sat, 27 May 2006)
New Revision: 2721

Added:
   jhalfs/branches/experimental/BLFS/libs/
   jhalfs/branches/experimental/BLFS/libs/constants.inc
   jhalfs/branches/experimental/BLFS/libs/dependencies.xsl
   jhalfs/branches/experimental/BLFS/libs/func_dependencies
   jhalfs/branches/experimental/BLFS/libs/func_makefile
   jhalfs/branches/experimental/BLFS/libs/func_packages
   jhalfs/branches/experimental/BLFS/libs/func_parser
Removed:
   jhalfs/branches/experimental/BLFS/constants.inc
   jhalfs/branches/experimental/BLFS/dependencies.xsl
   jhalfs/branches/experimental/BLFS/func_dependencies
   jhalfs/branches/experimental/BLFS/func_makefile
   jhalfs/branches/experimental/BLFS/func_packages
   jhalfs/branches/experimental/BLFS/func_parser
Modified:
   jhalfs/branches/experimental/BLFS/blfs-parser.sh
   jhalfs/branches/experimental/BLFS/packages.sh
Log:
Moved function, XSL, and pre-made dependencies files to libs directory.

Modified: jhalfs/branches/experimental/BLFS/blfs-parser.sh
===================================================================
--- jhalfs/branches/experimental/BLFS/blfs-parser.sh	2006-05-27 10:08:22 UTC (rev 2720)
+++ jhalfs/branches/experimental/BLFS/blfs-parser.sh	2006-05-27 10:33:12 UTC (rev 2721)
@@ -16,7 +16,7 @@
 
 #---------------------
 # Constants
-source constants.inc
+source libs/constants.inc
 [[ $? > 0 ]] && echo -e "\n\tERROR: constants.inc did not load..\n" && exit
 
 #---------------------
@@ -26,12 +26,12 @@
 
 #---------------------
 # Dependencies module
-source func_dependencies
+source libs/func_dependencies
 [[ $? > 0 ]] && echo -e "\n\tERROR: func_dependencies did not load..\n" && exit
 
 #---------------------
 # parser module
-source func_parser
+source libs/func_parser
 [[ $? > 0 ]] && echo -e "\n\tERROR: func_parser did not load..\n" && exit
 
 

Deleted: jhalfs/branches/experimental/BLFS/constants.inc
===================================================================
--- jhalfs/branches/experimental/BLFS/constants.inc	2006-05-27 10:08:22 UTC (rev 2720)
+++ jhalfs/branches/experimental/BLFS/constants.inc	2006-05-27 10:33:12 UTC (rev 2721)
@@ -1,35 +0,0 @@
-#####
-#
-# common constants
-#
-# $Id:
-#####
-
-
-# VT100 colors
-declare -r  BLACK=$'\e[1;30m'
-declare -r  DK_GRAY=$'\e[0;30m'
-
-declare -r  RED=$'\e[31m'
-declare -r  GREEN=$'\e[32m'
-declare -r  YELLOW=$'\e[33m'
-declare -r  BLUE=$'\e[34m'
-declare -r  MAGENTA=$'\e[35m'
-declare -r  CYAN=$'\e[36m'
-declare -r  WHITE=$'\e[37m'
-
-declare -r  OFF=$'\e[0m'
-declare -r  BOLD=$'\e[1m'
-declare -r  REVERSE=$'\e[7m'
-declare -r  HIDDEN=$'\e[8m'
-
-declare -r  tab_=$'\t'
-declare -r  nl_=$'\n'
-
-declare -r   DD_BORDER="${BOLD}==============================================================================${OFF}"
-declare -r   SD_BORDER="${BOLD}------------------------------------------------------------------------------${OFF}"
-declare -r STAR_BORDER="${BOLD}******************************************************************************${OFF}"
-
-# bold yellow > <  pair
-declare -r R_arrow=$'\e[1;33m>\e[0m'
-declare -r L_arrow=$'\e[1;33m<\e[0m'

Deleted: jhalfs/branches/experimental/BLFS/dependencies.xsl
===================================================================
--- jhalfs/branches/experimental/BLFS/dependencies.xsl	2006-05-27 10:08:22 UTC (rev 2720)
+++ jhalfs/branches/experimental/BLFS/dependencies.xsl	2006-05-27 10:33:12 UTC (rev 2721)
@@ -1,47 +0,0 @@
-<?xml version="1.0"?>
-
-<!-- $Id$ -->
-
-<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
-    version="1.0">
-
-  <xsl:output method="text"/>
-
-  <xsl:param name="dependencies" select="2"/>
-
-  <xsl:template match="/">
-    <xsl:apply-templates select="//para[@role='optional']"/>
-    <xsl:apply-templates select="//para[@role='recommended']"/>
-    <xsl:apply-templates select="//para[@role='required']"/>
-  </xsl:template>
-
-  <xsl:template match="//text()"/>
-
-  <xsl:template match="para[@role='required']">
-    <xsl:apply-templates select="xref">
-      <xsl:sort select="position()" order="descending"/>
-    </xsl:apply-templates>
-  </xsl:template>
-
-  <xsl:template match="para[@role='recommended']">
-    <xsl:if test="$dependencies != '1'">
-      <xsl:apply-templates select="xref">
-        <xsl:sort select="position()" order="descending"/>
-      </xsl:apply-templates>
-    </xsl:if>
-  </xsl:template>
-
-  <xsl:template match="para[@role='optional']">
-    <xsl:if test="$dependencies = '3'">
-      <xsl:apply-templates select="xref">
-        <xsl:sort select="position()" order="descending"/>
-      </xsl:apply-templates>
-    </xsl:if>
-  </xsl:template>
-
-  <xsl:template match="xref">
-    <xsl:value-of select="@linkend"/>
-    <xsl:text>&#xA;</xsl:text>
-  </xsl:template>
-
-</xsl:stylesheet>

Deleted: jhalfs/branches/experimental/BLFS/func_dependencies
===================================================================
--- jhalfs/branches/experimental/BLFS/func_dependencies	2006-05-27 10:08:22 UTC (rev 2720)
+++ jhalfs/branches/experimental/BLFS/func_dependencies	2006-05-27 10:33:12 UTC (rev 2721)
@@ -1,343 +0,0 @@
-#!/bin/bash
-#
-# $Id$
-#
-set -e
-
-declare -i cntr=0
-declare -a spaceSTR="                                                                   "
-
-#----------------------------#
-generate_dependency_tree() { #
-#----------------------------#
-: <<inline_doc
-    function:   Create a dependency tree for the TARGET
-    input vars: none
-    externals:  vars: TARGET
-                      PKGXML
-		      DEP_LEVEL
-                func: do_dependencies
-    modifies:   vars: PKGXML
-                      BLFS_XML
-    returns:    nothing
-    output:     files: $TARGET.dep
-                       $TARGET-index.xml.tmp
-                       depure.txt
-    on error:   nothing
-    on success: nothing
-inline_doc
-
-  local ENTRY_START
-  local ENTRY_END
-
-  #---------------------
-  # Create the working directory and cd into it
-  if [[ -d $TARGET ]] ; then
-    echo -e "\tERROR: Looks like $TARGET has been already processed."
-    echo -e "\tPlease delete or rename the $TARGET directory.\n"
-    exit 1
-  else
-    mkdir $TARGET && cd $TARGET
-  fi
-
-  #---------------------
-  # XML file of the target package
-  PKGXML=`grep "^$TARGET[[:space:]]" ../packages | cut -f2`
-
-  #---------------------
-  # The BLFS sources directory.
-  BLFS_XML=`echo $PKGXML | sed -e 's,/.*,,'`
-
-  if [[ ! -d ../$BLFS_XML ]] ; then
-    echo -e "\tThe BLFS book sources directory is missing.\n"
-    echo -e "\tExecution aborted.\n"
-    cd .. && rmdir $TARGET
-    exit 1
-  fi
-
-  #---------------------
-  # XInclude stuff
-  ENTRY_START="<xi:include xmlns:xi=\"http://www.w3.org/2003/XInclude\" href=\"../"
-  ENTRY_END="\"/>"
-
-  echo -en "\tGenerating $TARGET dependencies tree ..."
-
-  #---------------------
-  # Create target package dependencies list
-  case $TARGET in
-    # Meta-packages at target level
-    # KDE and Gnome-{core,full} could be made via packages.sh, but not sure yet how.
-    alsa ) # When target "alsa", use all alsa-* packages
-      mkdir dependencies
-      echo -e "alsa-oss\nalsa-firmware\nalsa-tools\nalsa-utils\n \
-               alsa-plugins\nalsa-lib" > dependencies/$TARGET.dep
-      ;;
-    xorg7 ) # At atarget level, add also x-config and x-setup
-      mkdir dependencies
-      echo -e "x-config\nx-setup\nrman\nxterm2\nxorg7-driver\nxorg7-server\nluit\n \
-               xorg7-font\nxorg7-data\nxorg7-app\nxbitmaps\nmesalib\nlibdrm\n \
-               xorg7-lib\nxorg7-util\nxorg7-proto" > dependencies/$TARGET.dep
-      ;;
-    * ) # Default
-      xsltproc --stringparam dependencies $DEP_LEVEL \
-               -o dependencies/$TARGET.dep \
-               ../dependencies.xsl ../$PKGXML
-      ;;
-  esac
-
-  #---------------------
-  # Start with a clean $TARGET-index.xml.tmp file
-  > $TARGET-index.xml.tmp
-
-  #---------------------
-  # Write the XInclude
-  echo -e "    $ENTRY_START$PKGXML$ENTRY_END" >> $TARGET-index.xml.tmp
-
-  #------------------P---
-  # Start with a clean depure.txt file
-  > depure.txt
-
-  #---------------------
-  # If have dependencies, write its XInclude and find sub-dependencies
-  if [[ -f dependencies/$TARGET.dep ]]; then
-    echo -e "Start loop for PKG $TARGET\n" >> depure.txt
-    mkdir xincludes && do_dependencies $TARGET
-  fi
-
-  echo "done"
-}
-
-
-
-#-----------------------#
-do_dependencies()  {    #  Loop to find sub-dependencies  :::WARNING::: THIS IS A RECURVISE FUNCTION
-#-----------------------#
-: <<inline_doc
-    function:   Loop through all the packages and create a sub-dependency tree
-    input vars: $1, package name
-    externals:  vars:  $DEP_LEVEL
-                       $TARGET
-                       $PRINT_SERVER
-                       $KBR5
-                       $GHOSTSCRIPT
-                       $MAILSERVER
-                file:  depure.txt
-                       $TARGET-index.xml.tmp
-                       $PKG.dep
-                       $PKG.inc
-    modifies:   files
-    returns:    nothing
-    output:     file:  $PKG-xinc.tmp
-                       depure.txt
-                       $TARGET-index.xml.tmp
-    on error:   exit
-    on success:
-inline_doc
-
-  set -e
-  local PKG=$1
-  local saveIFS=$IFS
-  local DEP_LV=$DEP_LEVEL
-  local line line2 DEP
-  echo -e "\tPKG is $PKG" >> depure.txt
-  echo -e "\tDEP_LEVEL for $PKG is $DEP_LV\n" >> depure.txt
-
-  #------------------
-  #  If a premade xinclude file exists, use it. If not, create one
-  if [[ -f xincludes/$PKG.xinc ]] ; then
-    echo -e "\tReusing xinclude file for PKG $PKG" >> depure.txt
-    IFS=$'\x0A'
-    for line in `cat xincludes/$PKG.xinc` ; do
-      IFS=$saveIFS
-      # Remove the Xinclude entry if found. We want the most newer one.
-      # Using double quotes to let bash expand variables.
-      # Remove also the empty line created. Can not be done in one step
-      # due that d requires the pattner between /, but we have a lot of /
-      # inside the pattner.
-      sed -e "s,^[[:space:]]*$line,," -e '/./!d' -i $TARGET-index.xml.tmp
-      # Write the XInclude
-      echo -e "$line" >> $TARGET-index.xml.tmp
-    done
-    return
-  fi
-
-  #------------------
-  # Start with a clean $PKG.xinc.tmp file
-  > xincludes/$PKG.xinc.tmp
-  for DEP in `cat dependencies/$PKG.dep`; do
-    # Special packages (a lot of hacks)
-    case $DEP in
-
-      db ) # The proper version of DB is installed in LFS
-        continue ;;
-      hal-requirements ) # ID value don't have their own XML package file
-        continue ;;
-      perl-* | tk-perl )  DEP=perl-modules ;;
-
-        # Orphan links (proper link must be created when generating the book)
-      arts )              DEP=aRts ;; # That should be fixed in the BLFS book
-        # Set values for alternative packages
-        # X is a meta-package, thus handled in another way.
-      LPRng | cups )      DEP=$PRINT_SERVER ;;
-      mitkrb | heimdal )  DEP=$KBR5 ;;
-      gs | espgs )        DEP=$GHOSTSCRIPT ;;
-      server-mail )       DEP=$MAIL_SERVER ;;
-    esac
-
-    #------------------
-    echo -e "\tDEP for $PKG is $DEP" >> depure.txt
-    # Prevent circular dependencies when level 3
-    case $DEP in
-      python )
-        # cracklib-->python-->tk-->X-->linux-pam-->cracklib
-        [[ "$PKG" = "cracklib" ]] && continue
-        ;;
-      jadetex | perl-* | lynx | Links | w3m )
-        # Optional dependencies are runtime only
-        [[ "$PKG" = "docbook-utils" ]] && continue
-        ;;
-      libxslt )
-        # libxml2-->libxslt-->libxml2
-        [[ "$PKG" = "libxml2" ]] && continue
-        ;;
-      openldap | postgresql | $KBR5 )
-        # cyrus-sasl-->several-->cyrus-sasl
-        [[ "$PKG" = "cyrus-sasl" ]] && continue
-        ;;
-      doxygen )
-        # alsa-lib-->doxygen-->graphviz-->jdk-->alsa-lib
-        # Commented out due that it bomb "jdk 3" Why??
-        #[[ "$PKG" = "alsa-lib" ]] && continue
-        # libexif-->doxygen-->graphviz-->php-->libexif
-        [[ "$PKG" = "libexif" ]] && continue
-        ;;
-      qt )
-        # unixodbc-->qt-->unixodbc
-        [[ "$PKG" = "unixodbc" ]] && continue
-        ;;
-      espgs )
-        # sendmail-->espgs-->cups-->php-->sendmail
-        [[ "$PKG" = "$MAIL_SERVER" ]] && continue
-        ;;
-      graphviz )
-        # libexif-->graphviz-->php-->libexif
-        [[ "$PKG" = "libexif" ]] && continue
-        ;;
-      aRts )
-        # esound-->aRts-->esound
-        [[ "$PKG" = "esound" ]] && continue
-        ;;
-      gimp )
-        # imagemagick-->gimp-->imagemagick
-        [[ "$PKG" = "imagemagick" ]] && continue
-        ;;
-    esac
-
-    #------------------
-    echo -e "\tDEP_LEVEL for $DEP is $DEP_LV" >> depure.txt
-    # XML file of dependency package
-    DEP_XML=`grep "^$DEP[[:space:]]" ../packages | cut -f2`
-    echo -e "\t\tDEP_XML is $DEP_XML\n" >> depure.txt
-    case $DEP in
-      x-window-system ) ;; # No page for that (proper link must be created when generating the book)
-      xorg7 ) ;; # This page will be dump in the xorg7.xinc file
-      * )
-        # Remove the Xinclude entry if found
-        sed -e "s,^[[:space:]]*$ENTRY_START$DEP_XML$ENTRY_END,," \
-            -e '/./!d' -i xincludes/$PKG.xinc.tmp
-        # Write the XInclude
-        echo -e "    $ENTRY_START$DEP_XML$ENTRY_END" >> xincludes/$PKG.xinc.tmp
-        ;;
-    esac
-
-    #------------------
-    # If not already created, create its dependencies list
-    if [[ ! -f dependencies/$DEP.dep ]] ; then
-      case $DEP in
-        alsa-lib ) ;; # Only one optional dependency and is recursive.
-                      # When placed inside the circular dependencies handler
-                      # some packages may bomb. But I don't know yet why
-        # Meta-packages at dependency level (ugly *.dep files, but work for now)
-        alsa ) # When dependency "alsa", use all alsa-* packages
-          echo -e "alsa-oss\nalsa-firmware\nalsa-tools\nalsa-utils\n \
-                   alsa-plugins\nalsa-lib" > dependencies/$DEP.dep
-          ;;
-        x-window-system ) # X11 alternatives
-          echo -e "x-config\nx-setup\n$X11" > dependencies/$DEP.dep
-          ;;
-        xorg7 )
-          echo -e "rman\nxterm2\nxorg7-driver\nxorg7-server\nluit\nxorg7-font\n \
-                   xorg7-data\nxorg7-app\nxbitmaps\nmesalib\nlibdrm\n \
-                   xorg7-lib\nxorg7-util\nxorg7-proto" > dependencies/$DEP.dep
-          ;;
-        * ) xsltproc --stringparam dependencies $DEP_LV \
-               -o dependencies/$DEP.dep ../dependencies.xsl ../$DEP_XML
-          ;;
-      esac
-    fi
-
-    #------------------
-    # If needed, process its dependencies
-    if [[ -f dependencies/$DEP.dep ]] ; then
-      # If a premade xinclude file esist, include it
-      if [[ -f xincludes/$DEP.xinc ]] ; then
-        echo -e "\tReusing xinclude file for PKG $DEP (to solve $PKG)\n" >> depure.txt
-        IFS=$'\x0A'
-        for line2 in `cat xincludes/$DEP.xinc` ; do
-          IFS=$saveIFS
-          # Remove the Xinclude entry if found
-          sed -e "s,^[[:space:]]*$line2,," -e '/./!d' -i xincludes/$PKG.xinc.tmp
-          # Write the XInclude
-          echo -e "$line2" >> xincludes/$PKG.xinc.tmp
-        done
-      #------------------
-      # Create the xinclude file
-      else
-        echo -e "\nStart new loop for PKG $DEP (to solve $PKG)\n" >> depure.txt
-	#
-	# >>>>>> THIS IS A RECURSIVE FUNCTION CALL.. BEWARE OF GREMLINS. <<<<<<
-	#
-	# If the recursion depth is not too great this is an acceptable methodology for a script language
-	# However, uncontrolled recursion will cause a seg-fault due to stack issues with local variables.
-	#
-        set +e
-         [[ "${VERBOSITY}" > 0 ]] && echo -ne "\nrecursive call: $((++cntr)) ${spaceSTR:0:$cntr} ${RED}$DEP${OFF}"
-            do_dependencies $DEP
-         [[ "${VERBOSITY}" > 0 ]] && echo -ne  "\nrecursive ret:  $cntr ${spaceSTR:0:$((cntr--))} ${GREEN}$DEP${OFF}\tUsing the new xinclude file for PKG $DEP (to solve $PKG)"
-        set -e
-
-        # Include it when done
-        echo -e "\tUsing the new xinclude file for PKG $DEP (to solve $PKG)\n" >> depure.txt
-        IFS=$'\x0A'
-        for line2 in `cat xincludes/$DEP.xinc` ; do
-          IFS=$saveIFS
-          # Remove the Xinclude entry if found
-          sed -e "s,^[[:space:]]*$line2,," -e '/./!d' -i xincludes/$PKG.xinc.tmp
-          # Write the XInclude
-          echo -e "$line2" >> xincludes/$PKG.xinc.tmp
-        done
-      fi
-    fi
-  done
-
-  #------------------
-  if [[ "$PKG" = "xorg7" ]] ; then
-    # Add their XInclude
-    PKG_XML=`grep "^$PKG[[:space:]]" ../packages | cut -f2`
-    echo -e "    $ENTRY_START$PKG_XML$ENTRY_END" >> xincludes/$PKG.xinc.tmp
-  fi
-
-  #------------------
-  mv xincludes/$PKG.xinc.tmp xincludes/$PKG.xinc
-  echo -e "Using the new xinclude file for PKG $PKG" >> depure.txt
-  IFS=$'\x0A'
-  for line in `cat xincludes/$PKG.xinc` ; do
-    IFS=$saveIFS
-    # Remove the Xinclude entry if found.
-    sed -e "s,^[[:space:]]*$line,," -e '/./!d' -i $TARGET-index.xml.tmp
-    # Write the XInclude
-    echo -e "$line" >> $TARGET-index.xml.tmp
-  done
-
-  echo -e "\nEnd loop for PKG $PKG\n" >> depure.txt
-}

Deleted: jhalfs/branches/experimental/BLFS/func_makefile
===================================================================
--- jhalfs/branches/experimental/BLFS/func_makefile	2006-05-27 10:08:22 UTC (rev 2720)
+++ jhalfs/branches/experimental/BLFS/func_makefile	2006-05-27 10:33:12 UTC (rev 2721)
@@ -1,6 +0,0 @@
-#####
-#
-#
-#
-# $Id$
-#####

Deleted: jhalfs/branches/experimental/BLFS/func_packages
===================================================================
--- jhalfs/branches/experimental/BLFS/func_packages	2006-05-27 10:08:22 UTC (rev 2720)
+++ jhalfs/branches/experimental/BLFS/func_packages	2006-05-27 10:33:12 UTC (rev 2721)
@@ -1,129 +0,0 @@
-#!/bin/bash
-#
-# $Id$
-#
-set -e
-
-#-----------------------#
-generate_packages()  {  # Master packages file
-#-----------------------#
-  local pkg_id file
-
-  > packages.tmp
-
-  # Extract Id and path for sect1 files
-  for file in `find $BLFS_XML -name "*.xml"` ; do
-    pkg_id=`grep "sect1 id" $file | sed -e 's/<sect1 id="//;s/".*//'`
-    [[ ! -z "$pkg_id" ]] && echo -e "$pkg_id\t$file" >> packages.tmp
-  done
-
-  # IDs clean-up (unuseful pages or commented-out packages, could be more)
-  sed -i '/template/d;/ntroduction/d;/preface/d' packages.tmp
-  sed -i '/courier.xml/d' packages.tmp
-  sed -i '/nautilus-media.xml/d;/gal.xml/d;/gpdf.xml/d;/gv.xml/d' packages.tmp
-
-  # Add header with meta-packages pseudo Id
-{
-  cat << EOF
-
-=== GNOME META-PACKAGES ===
-# GNOME base packages
-gnome-core	$BLFS_XML
-# All GNOME packages
-gnome-full	$BLFS_XML
-
-=== KDE META-PACKAGES ===
-# KDE base packages
-kde-core	$BLFS_XML
-# All KDE packages
-kde-full	$BLFS_XML
-# All KDE packages plus Koffice
-kde-koffice	$BLFS_XML
-
-=== INDIVIDUAL PACKAGES ===
-
-EOF
-} > packages
-
-  # Dump packages list
-  sort packages.tmp >> packages
-
-  # Clean up
-  rm packages.tmp
-}
-
-# Pre-made *.dep files for meta-packages
-
-#--------------------------#
-generate_gnome_core()  {   # GNOME core
-#--------------------------#
-  local line base_xml package
-
-  > gnome-core.dep.tmp
-
-  for line in `grep "xi:include" $BLFS_XML/gnome/core/core.xml` ; do
-    base_xml=`echo $line | sed 's/^.*href="//;s/".*//'`
-    package=`grep "gnome/core/$base_xml" packages | cut -f1`
-    [[ -n "$package" ]] && echo $package >> gnome-core.dep.tmp
-  done
-
-  tac gnome-core.dep.tmp > gnome-core.dep
-  rm gnome-core.dep.tmp
-}
-
-#--------------------------#
-generate_gnome_full()  {   # GNOME full
-#--------------------------#
-  local line base_xml package
-
-  echo "gnome-core" > gnome-full.dep.tmp
-
-  for line in `grep "xi:include" $BLFS_XML/gnome/add/add.xml` ; do
-    base_xml=`echo $line | sed 's/^.*href="//;s/".*//'`
-    package=`grep "gnome/add/$base_xml" packages | cut -f1`
-    [[ -n "$package" ]] && echo $package >> gnome-full.dep.tmp
-  done
-
-  tac gnome-full.dep.tmp > gnome-full.dep
-  rm gnome-full.dep.tmp
-}
-
-#--------------------------#
-generate_kde_core()  {     # KDE core
-#--------------------------#
-  local line base_xml package
-
-  > kde-core.dep.tmp
-
-  for line in `grep "xi:include" $BLFS_XML/kde/core/core.xml` ; do
-    base_xml=`echo $line | sed 's/^.*href="//;s/".*//'`
-    package=`grep "kde/core/$base_xml" packages | cut -f1`
-    [[ -n "$package" ]] && echo $package >> kde-core.dep.tmp
-  done
-
-  tac kde-core.dep.tmp > kde-core.dep
-  rm kde-core.dep.tmp
-}
-
-#--------------------------#
-generate_kde_full()  {     # KDE full
-#--------------------------#
-  local line base_xml package
-
-  echo "kde-core" > kde-full.dep.tmp
-
-  for line in `grep "xi:include" $BLFS_XML/kde/add/add.xml` ; do
-    base_xml=`echo $line | sed 's/^.*href="//;s/".*//'`
-    package=`grep "kde/add/$base_xml" packages | cut -f1`
-    [[ -n "$package" ]] && echo $package >> kde-full.dep.tmp
-  done
-
-  for line in `grep "xi:include" $BLFS_XML/kde/devel/devel.xml` ; do
-    base_xml=`echo $line | sed 's/^.*href="//;s/".*//'`
-    package=`grep "kde/devel/$base_xml" packages | cut -f1`
-    [[ -n "$package" ]] && echo $package >> kde-full.dep.tmp
-  done
-
-  tac kde-full.dep.tmp > kde-full.dep
-  rm kde-full.dep.tmp
-}

Deleted: jhalfs/branches/experimental/BLFS/func_parser
===================================================================
--- jhalfs/branches/experimental/BLFS/func_parser	2006-05-27 10:08:22 UTC (rev 2720)
+++ jhalfs/branches/experimental/BLFS/func_parser	2006-05-27 10:33:12 UTC (rev 2721)
@@ -1,136 +0,0 @@
-#!/bin/bash
-#####
-#
-# Parse the XML documents to create a 'package' book
-#
-# $Id$
-#####
-
-
-#----------------------------#
-generate_TARGET_xml()  {     #
-#----------------------------#
-: <<inline_doc
-    function:   Generate the XML document for the TARGET package
-    input vars: nothing
-    externals:  vars: TARGET
-    modifies:   nothing
-    returns:    nothing
-    output:     file: $TARGET-index.xml
-    on error:   nothing
-    on success: nothing
-inline_doc
-
-  local
-  echo -en "\tGenerating $TARGET-index.xml ..."
-
-  #---------------------
-  # Header to $TARGET-index.xml
-{
-cat << EOF
-<?xml version="1.0" encoding="ISO-8859-1"?>
-<!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook XML V4.4//EN"
-  "http://www.oasis-open.org/docbook/xml/4.4/docbookx.dtd" >
-
-<book>
-
-  <xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="../$BLFS_XML/book/bookinfo.xml"/>
-
-  <preface>
-    <?dbhtml filename="preface.html" dir="preface"?>
-
-    <title>Preface</title>
-
-    <xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="../$BLFS_XML/introduction/important/locale-issues.xml"/>
-    <xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="../$BLFS_XML/introduction/important/bootscripts.xml"/>
-
-  </preface>
-
-  <chapter>
-    <?dbhtml filename="chapter.html" dir="installing"?>
-
-    <title>Installing $TARGET in Dependencies Build Order</title>
-
-EOF
-} > $TARGET-index.xml
-
-  #---------------------
-  # Dump $TARGET-index.xml.tmp in reverse order.
-  tac $TARGET-index.xml.tmp >> $TARGET-index.xml
-  rm $TARGET-index.xml.tmp
-
-  #---------------------
-  # Footer of $TARGET-index.xml
-{
-cat << EOF
-
-  </chapter>
-
-  <xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="../$BLFS_XML/appendices/creat-comm.xml"/>
-  <xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="../$BLFS_XML/appendices/ac-free-lic.xml"/>
-
-  <index/>
-
-</book>
-
-EOF
-} >> $TARGET-index.xml
-
-  echo "done"
-}
-
-
-#-------------------------#
-generate_target_book() {  #
-#-------------------------#
-: <<inline_doc
-    function:   Create an HTML document of the requested TARGET.
-    input vars: nothing
-    externals:  vars: TARGET
-                      BLFS_XML
-    modifies:   nothing
-    returns:    nothing
-    output:     file: NUMEROUS FILES
-    on error:   nothing
-    on success: nothing
-inline_doc
-
-  local filename # output filename
-
-  echo -en  "\tGenerating the HTML book ..."
-  xsltproc --xinclude --nonet --stringparam base.dir HTML/ \
-           --stringparam chunk.quietly 1 \
-           ../$BLFS_XML/stylesheets/blfs-chunked.xsl \
-           $TARGET-index.xml > xsltproc.log 2>&1
-
-  mkdir HTML/{stylesheets,images}
-  cp ../$BLFS_XML/stylesheets/*.css HTML/stylesheets
-  cp ../$BLFS_XML/images/*.png HTML/images
-  cd HTML
-  sed -i -e "s at ../stylesheets at stylesheets@g" *.html
-  sed -i -e "s at ../images at images@g" *.html
-  for filename in `find . -name "*.html"` ; do
-    tidy -config ../../$BLFS_XML/tidy.conf $filename || true
-    sh ../../$BLFS_XML/obfuscate.sh $filename
-    sed -i -e "s at text/html at application/xhtml+xml at g" $filename
-  done
-  echo "done"
-}
-
-
-#-------------------------#
-create_build_scripts() {  #
-#-------------------------#
-: <<inline_doc
-    function:
-    input vars: nothing
-    externals:  none
-    modifies:   nothing
-    returns:    nothing
-    output:     none
-    on error:   nothing
-    on success: nothing
-inline_doc
-
-  echo -en  "\tGenerating the build scripts ... not implemented yet, sorry\n"
-}

Copied: jhalfs/branches/experimental/BLFS/libs/constants.inc (from rev 2718, jhalfs/branches/experimental/BLFS/constants.inc)
===================================================================
--- jhalfs/branches/experimental/BLFS/libs/constants.inc	                        (rev 0)
+++ jhalfs/branches/experimental/BLFS/libs/constants.inc	2006-05-27 10:33:12 UTC (rev 2721)
@@ -0,0 +1,35 @@
+#####
+#
+# common constants
+#
+# $Id:
+#####
+
+
+# VT100 colors
+declare -r  BLACK=$'\e[1;30m'
+declare -r  DK_GRAY=$'\e[0;30m'
+
+declare -r  RED=$'\e[31m'
+declare -r  GREEN=$'\e[32m'
+declare -r  YELLOW=$'\e[33m'
+declare -r  BLUE=$'\e[34m'
+declare -r  MAGENTA=$'\e[35m'
+declare -r  CYAN=$'\e[36m'
+declare -r  WHITE=$'\e[37m'
+
+declare -r  OFF=$'\e[0m'
+declare -r  BOLD=$'\e[1m'
+declare -r  REVERSE=$'\e[7m'
+declare -r  HIDDEN=$'\e[8m'
+
+declare -r  tab_=$'\t'
+declare -r  nl_=$'\n'
+
+declare -r   DD_BORDER="${BOLD}==============================================================================${OFF}"
+declare -r   SD_BORDER="${BOLD}------------------------------------------------------------------------------${OFF}"
+declare -r STAR_BORDER="${BOLD}******************************************************************************${OFF}"
+
+# bold yellow > <  pair
+declare -r R_arrow=$'\e[1;33m>\e[0m'
+declare -r L_arrow=$'\e[1;33m<\e[0m'

Copied: jhalfs/branches/experimental/BLFS/libs/dependencies.xsl (from rev 2718, jhalfs/branches/experimental/BLFS/dependencies.xsl)
===================================================================
--- jhalfs/branches/experimental/BLFS/libs/dependencies.xsl	                        (rev 0)
+++ jhalfs/branches/experimental/BLFS/libs/dependencies.xsl	2006-05-27 10:33:12 UTC (rev 2721)
@@ -0,0 +1,47 @@
+<?xml version="1.0"?>
+
+<!-- $Id$ -->
+
+<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+    version="1.0">
+
+  <xsl:output method="text"/>
+
+  <xsl:param name="dependencies" select="2"/>
+
+  <xsl:template match="/">
+    <xsl:apply-templates select="//para[@role='optional']"/>
+    <xsl:apply-templates select="//para[@role='recommended']"/>
+    <xsl:apply-templates select="//para[@role='required']"/>
+  </xsl:template>
+
+  <xsl:template match="//text()"/>
+
+  <xsl:template match="para[@role='required']">
+    <xsl:apply-templates select="xref">
+      <xsl:sort select="position()" order="descending"/>
+    </xsl:apply-templates>
+  </xsl:template>
+
+  <xsl:template match="para[@role='recommended']">
+    <xsl:if test="$dependencies != '1'">
+      <xsl:apply-templates select="xref">
+        <xsl:sort select="position()" order="descending"/>
+      </xsl:apply-templates>
+    </xsl:if>
+  </xsl:template>
+
+  <xsl:template match="para[@role='optional']">
+    <xsl:if test="$dependencies = '3'">
+      <xsl:apply-templates select="xref">
+        <xsl:sort select="position()" order="descending"/>
+      </xsl:apply-templates>
+    </xsl:if>
+  </xsl:template>
+
+  <xsl:template match="xref">
+    <xsl:value-of select="@linkend"/>
+    <xsl:text>&#xA;</xsl:text>
+  </xsl:template>
+
+</xsl:stylesheet>

Copied: jhalfs/branches/experimental/BLFS/libs/func_dependencies (from rev 2718, jhalfs/branches/experimental/BLFS/func_dependencies)
===================================================================
--- jhalfs/branches/experimental/BLFS/libs/func_dependencies	                        (rev 0)
+++ jhalfs/branches/experimental/BLFS/libs/func_dependencies	2006-05-27 10:33:12 UTC (rev 2721)
@@ -0,0 +1,343 @@
+#!/bin/bash
+#
+# $Id$
+#
+set -e
+
+declare -i cntr=0
+declare -a spaceSTR="                                                                   "
+
+#----------------------------#
+generate_dependency_tree() { #
+#----------------------------#
+: <<inline_doc
+    function:   Create a dependency tree for the TARGET
+    input vars: none
+    externals:  vars: TARGET
+                      PKGXML
+		      DEP_LEVEL
+                func: do_dependencies
+    modifies:   vars: PKGXML
+                      BLFS_XML
+    returns:    nothing
+    output:     files: $TARGET.dep
+                       $TARGET-index.xml.tmp
+                       depure.txt
+    on error:   nothing
+    on success: nothing
+inline_doc
+
+  local ENTRY_START
+  local ENTRY_END
+
+  #---------------------
+  # Create the working directory and cd into it
+  if [[ -d $TARGET ]] ; then
+    echo -e "\tERROR: Looks like $TARGET has been already processed."
+    echo -e "\tPlease delete or rename the $TARGET directory.\n"
+    exit 1
+  else
+    mkdir $TARGET && cd $TARGET
+  fi
+
+  #---------------------
+  # XML file of the target package
+  PKGXML=`grep "^$TARGET[[:space:]]" ../packages | cut -f2`
+
+  #---------------------
+  # The BLFS sources directory.
+  BLFS_XML=`echo $PKGXML | sed -e 's,/.*,,'`
+
+  if [[ ! -d ../$BLFS_XML ]] ; then
+    echo -e "\tThe BLFS book sources directory is missing.\n"
+    echo -e "\tExecution aborted.\n"
+    cd .. && rmdir $TARGET
+    exit 1
+  fi
+
+  #---------------------
+  # XInclude stuff
+  ENTRY_START="<xi:include xmlns:xi=\"http://www.w3.org/2003/XInclude\" href=\"../"
+  ENTRY_END="\"/>"
+
+  echo -en "\tGenerating $TARGET dependencies tree ..."
+
+  #---------------------
+  # Create target package dependencies list
+  case $TARGET in
+    # Meta-packages at target level
+    # KDE and Gnome-{core,full} could be made via packages.sh, but not sure yet how.
+    alsa ) # When target "alsa", use all alsa-* packages
+      mkdir dependencies
+      echo -e "alsa-oss\nalsa-firmware\nalsa-tools\nalsa-utils\n \
+               alsa-plugins\nalsa-lib" > dependencies/$TARGET.dep
+      ;;
+    xorg7 ) # At atarget level, add also x-config and x-setup
+      mkdir dependencies
+      echo -e "x-config\nx-setup\nrman\nxterm2\nxorg7-driver\nxorg7-server\nluit\n \
+               xorg7-font\nxorg7-data\nxorg7-app\nxbitmaps\nmesalib\nlibdrm\n \
+               xorg7-lib\nxorg7-util\nxorg7-proto" > dependencies/$TARGET.dep
+      ;;
+    * ) # Default
+      xsltproc --stringparam dependencies $DEP_LEVEL \
+               -o dependencies/$TARGET.dep \
+               ../libs/dependencies.xsl ../$PKGXML
+      ;;
+  esac
+
+  #---------------------
+  # Start with a clean $TARGET-index.xml.tmp file
+  > $TARGET-index.xml.tmp
+
+  #---------------------
+  # Write the XInclude
+  echo -e "    $ENTRY_START$PKGXML$ENTRY_END" >> $TARGET-index.xml.tmp
+
+  #------------------P---
+  # Start with a clean depure.txt file
+  > depure.txt
+
+  #---------------------
+  # If have dependencies, write its XInclude and find sub-dependencies
+  if [[ -f dependencies/$TARGET.dep ]]; then
+    echo -e "Start loop for PKG $TARGET\n" >> depure.txt
+    mkdir xincludes && do_dependencies $TARGET
+  fi
+
+  echo "done"
+}
+
+
+
+#-----------------------#
+do_dependencies()  {    #  Loop to find sub-dependencies  :::WARNING::: THIS IS A RECURVISE FUNCTION
+#-----------------------#
+: <<inline_doc
+    function:   Loop through all the packages and create a sub-dependency tree
+    input vars: $1, package name
+    externals:  vars:  $DEP_LEVEL
+                       $TARGET
+                       $PRINT_SERVER
+                       $KBR5
+                       $GHOSTSCRIPT
+                       $MAILSERVER
+                file:  depure.txt
+                       $TARGET-index.xml.tmp
+                       $PKG.dep
+                       $PKG.inc
+    modifies:   files
+    returns:    nothing
+    output:     file:  $PKG-xinc.tmp
+                       depure.txt
+                       $TARGET-index.xml.tmp
+    on error:   exit
+    on success:
+inline_doc
+
+  set -e
+  local PKG=$1
+  local saveIFS=$IFS
+  local DEP_LV=$DEP_LEVEL
+  local line line2 DEP
+  echo -e "\tPKG is $PKG" >> depure.txt
+  echo -e "\tDEP_LEVEL for $PKG is $DEP_LV\n" >> depure.txt
+
+  #------------------
+  #  If a premade xinclude file exists, use it. If not, create one
+  if [[ -f xincludes/$PKG.xinc ]] ; then
+    echo -e "\tReusing xinclude file for PKG $PKG" >> depure.txt
+    IFS=$'\x0A'
+    for line in `cat xincludes/$PKG.xinc` ; do
+      IFS=$saveIFS
+      # Remove the Xinclude entry if found. We want the most newer one.
+      # Using double quotes to let bash expand variables.
+      # Remove also the empty line created. Can not be done in one step
+      # due that d requires the pattner between /, but we have a lot of /
+      # inside the pattner.
+      sed -e "s,^[[:space:]]*$line,," -e '/./!d' -i $TARGET-index.xml.tmp
+      # Write the XInclude
+      echo -e "$line" >> $TARGET-index.xml.tmp
+    done
+    return
+  fi
+
+  #------------------
+  # Start with a clean $PKG.xinc.tmp file
+  > xincludes/$PKG.xinc.tmp
+  for DEP in `cat dependencies/$PKG.dep`; do
+    # Special packages (a lot of hacks)
+    case $DEP in
+
+      db ) # The proper version of DB is installed in LFS
+        continue ;;
+      hal-requirements ) # ID value don't have their own XML package file
+        continue ;;
+      perl-* | tk-perl )  DEP=perl-modules ;;
+
+        # Orphan links (proper link must be created when generating the book)
+      arts )              DEP=aRts ;; # That should be fixed in the BLFS book
+        # Set values for alternative packages
+        # X is a meta-package, thus handled in another way.
+      LPRng | cups )      DEP=$PRINT_SERVER ;;
+      mitkrb | heimdal )  DEP=$KBR5 ;;
+      gs | espgs )        DEP=$GHOSTSCRIPT ;;
+      server-mail )       DEP=$MAIL_SERVER ;;
+    esac
+
+    #------------------
+    echo -e "\tDEP for $PKG is $DEP" >> depure.txt
+    # Prevent circular dependencies when level 3
+    case $DEP in
+      python )
+        # cracklib-->python-->tk-->X-->linux-pam-->cracklib
+        [[ "$PKG" = "cracklib" ]] && continue
+        ;;
+      jadetex | perl-* | lynx | Links | w3m )
+        # Optional dependencies are runtime only
+        [[ "$PKG" = "docbook-utils" ]] && continue
+        ;;
+      libxslt )
+        # libxml2-->libxslt-->libxml2
+        [[ "$PKG" = "libxml2" ]] && continue
+        ;;
+      openldap | postgresql | $KBR5 )
+        # cyrus-sasl-->several-->cyrus-sasl
+        [[ "$PKG" = "cyrus-sasl" ]] && continue
+        ;;
+      doxygen )
+        # alsa-lib-->doxygen-->graphviz-->jdk-->alsa-lib
+        # Commented out due that it bomb "jdk 3" Why??
+        #[[ "$PKG" = "alsa-lib" ]] && continue
+        # libexif-->doxygen-->graphviz-->php-->libexif
+        [[ "$PKG" = "libexif" ]] && continue
+        ;;
+      qt )
+        # unixodbc-->qt-->unixodbc
+        [[ "$PKG" = "unixodbc" ]] && continue
+        ;;
+      espgs )
+        # sendmail-->espgs-->cups-->php-->sendmail
+        [[ "$PKG" = "$MAIL_SERVER" ]] && continue
+        ;;
+      graphviz )
+        # libexif-->graphviz-->php-->libexif
+        [[ "$PKG" = "libexif" ]] && continue
+        ;;
+      aRts )
+        # esound-->aRts-->esound
+        [[ "$PKG" = "esound" ]] && continue
+        ;;
+      gimp )
+        # imagemagick-->gimp-->imagemagick
+        [[ "$PKG" = "imagemagick" ]] && continue
+        ;;
+    esac
+
+    #------------------
+    echo -e "\tDEP_LEVEL for $DEP is $DEP_LV" >> depure.txt
+    # XML file of dependency package
+    DEP_XML=`grep "^$DEP[[:space:]]" ../packages | cut -f2`
+    echo -e "\t\tDEP_XML is $DEP_XML\n" >> depure.txt
+    case $DEP in
+      x-window-system ) ;; # No page for that (proper link must be created when generating the book)
+      xorg7 ) ;; # This page will be dump in the xorg7.xinc file
+      * )
+        # Remove the Xinclude entry if found
+        sed -e "s,^[[:space:]]*$ENTRY_START$DEP_XML$ENTRY_END,," \
+            -e '/./!d' -i xincludes/$PKG.xinc.tmp
+        # Write the XInclude
+        echo -e "    $ENTRY_START$DEP_XML$ENTRY_END" >> xincludes/$PKG.xinc.tmp
+        ;;
+    esac
+
+    #------------------
+    # If not already created, create its dependencies list
+    if [[ ! -f dependencies/$DEP.dep ]] ; then
+      case $DEP in
+        alsa-lib ) ;; # Only one optional dependency and is recursive.
+                      # When placed inside the circular dependencies handler
+                      # some packages may bomb. But I don't know yet why
+        # Meta-packages at dependency level (ugly *.dep files, but work for now)
+        alsa ) # When dependency "alsa", use all alsa-* packages
+          echo -e "alsa-oss\nalsa-firmware\nalsa-tools\nalsa-utils\n \
+                   alsa-plugins\nalsa-lib" > dependencies/$DEP.dep
+          ;;
+        x-window-system ) # X11 alternatives
+          echo -e "x-config\nx-setup\n$X11" > dependencies/$DEP.dep
+          ;;
+        xorg7 )
+          echo -e "rman\nxterm2\nxorg7-driver\nxorg7-server\nluit\nxorg7-font\n \
+                   xorg7-data\nxorg7-app\nxbitmaps\nmesalib\nlibdrm\n \
+                   xorg7-lib\nxorg7-util\nxorg7-proto" > dependencies/$DEP.dep
+          ;;
+        * ) xsltproc --stringparam dependencies $DEP_LV \
+               -o dependencies/$DEP.dep ../libs/dependencies.xsl ../$DEP_XML
+          ;;
+      esac
+    fi
+
+    #------------------
+    # If needed, process its dependencies
+    if [[ -f dependencies/$DEP.dep ]] ; then
+      # If a premade xinclude file esist, include it
+      if [[ -f xincludes/$DEP.xinc ]] ; then
+        echo -e "\tReusing xinclude file for PKG $DEP (to solve $PKG)\n" >> depure.txt
+        IFS=$'\x0A'
+        for line2 in `cat xincludes/$DEP.xinc` ; do
+          IFS=$saveIFS
+          # Remove the Xinclude entry if found
+          sed -e "s,^[[:space:]]*$line2,," -e '/./!d' -i xincludes/$PKG.xinc.tmp
+          # Write the XInclude
+          echo -e "$line2" >> xincludes/$PKG.xinc.tmp
+        done
+      #------------------
+      # Create the xinclude file
+      else
+        echo -e "\nStart new loop for PKG $DEP (to solve $PKG)\n" >> depure.txt
+	#
+	# >>>>>> THIS IS A RECURSIVE FUNCTION CALL.. BEWARE OF GREMLINS. <<<<<<
+	#
+	# If the recursion depth is not too great this is an acceptable methodology for a script language
+	# However, uncontrolled recursion will cause a seg-fault due to stack issues with local variables.
+	#
+        set +e
+         [[ "${VERBOSITY}" > 0 ]] && echo -ne "\nrecursive call: $((++cntr)) ${spaceSTR:0:$cntr} ${RED}$DEP${OFF}"
+            do_dependencies $DEP
+         [[ "${VERBOSITY}" > 0 ]] && echo -ne  "\nrecursive ret:  $cntr ${spaceSTR:0:$((cntr--))} ${GREEN}$DEP${OFF}\tUsing the new xinclude file for PKG $DEP (to solve $PKG)"
+        set -e
+
+        # Include it when done
+        echo -e "\tUsing the new xinclude file for PKG $DEP (to solve $PKG)\n" >> depure.txt
+        IFS=$'\x0A'
+        for line2 in `cat xincludes/$DEP.xinc` ; do
+          IFS=$saveIFS
+          # Remove the Xinclude entry if found
+          sed -e "s,^[[:space:]]*$line2,," -e '/./!d' -i xincludes/$PKG.xinc.tmp
+          # Write the XInclude
+          echo -e "$line2" >> xincludes/$PKG.xinc.tmp
+        done
+      fi
+    fi
+  done
+
+  #------------------
+  if [[ "$PKG" = "xorg7" ]] ; then
+    # Add their XInclude
+    PKG_XML=`grep "^$PKG[[:space:]]" ../packages | cut -f2`
+    echo -e "    $ENTRY_START$PKG_XML$ENTRY_END" >> xincludes/$PKG.xinc.tmp
+  fi
+
+  #------------------
+  mv xincludes/$PKG.xinc.tmp xincludes/$PKG.xinc
+  echo -e "Using the new xinclude file for PKG $PKG" >> depure.txt
+  IFS=$'\x0A'
+  for line in `cat xincludes/$PKG.xinc` ; do
+    IFS=$saveIFS
+    # Remove the Xinclude entry if found.
+    sed -e "s,^[[:space:]]*$line,," -e '/./!d' -i $TARGET-index.xml.tmp
+    # Write the XInclude
+    echo -e "$line" >> $TARGET-index.xml.tmp
+  done
+
+  echo -e "\nEnd loop for PKG $PKG\n" >> depure.txt
+}

Copied: jhalfs/branches/experimental/BLFS/libs/func_makefile (from rev 2718, jhalfs/branches/experimental/BLFS/func_makefile)
===================================================================
--- jhalfs/branches/experimental/BLFS/libs/func_makefile	                        (rev 0)
+++ jhalfs/branches/experimental/BLFS/libs/func_makefile	2006-05-27 10:33:12 UTC (rev 2721)
@@ -0,0 +1,6 @@
+#####
+#
+#
+#
+# $Id$
+#####

Copied: jhalfs/branches/experimental/BLFS/libs/func_packages (from rev 2720, jhalfs/branches/experimental/BLFS/func_packages)
===================================================================
--- jhalfs/branches/experimental/BLFS/libs/func_packages	                        (rev 0)
+++ jhalfs/branches/experimental/BLFS/libs/func_packages	2006-05-27 10:33:12 UTC (rev 2721)
@@ -0,0 +1,129 @@
+#!/bin/bash
+#
+# $Id$
+#
+set -e
+
+#-----------------------#
+generate_packages()  {  # Master packages file
+#-----------------------#
+  local pkg_id file
+
+  > packages.tmp
+
+  # Extract Id and path for sect1 files
+  for file in `find $BLFS_XML -name "*.xml"` ; do
+    pkg_id=`grep "sect1 id" $file | sed -e 's/<sect1 id="//;s/".*//'`
+    [[ ! -z "$pkg_id" ]] && echo -e "$pkg_id\t$file" >> packages.tmp
+  done
+
+  # IDs clean-up (unuseful pages or commented-out packages, could be more)
+  sed -i '/template/d;/ntroduction/d;/preface/d' packages.tmp
+  sed -i '/courier.xml/d' packages.tmp
+  sed -i '/nautilus-media.xml/d;/gal.xml/d;/gpdf.xml/d;/gv.xml/d' packages.tmp
+
+  # Add header with meta-packages pseudo Id
+{
+  cat << EOF
+
+=== GNOME META-PACKAGES ===
+# GNOME base packages
+gnome-core	$BLFS_XML
+# All GNOME packages
+gnome-full	$BLFS_XML
+
+=== KDE META-PACKAGES ===
+# KDE base packages
+kde-core	$BLFS_XML
+# All KDE packages
+kde-full	$BLFS_XML
+# All KDE packages plus Koffice
+kde-koffice	$BLFS_XML
+
+=== INDIVIDUAL PACKAGES ===
+
+EOF
+} > packages
+
+  # Dump packages list
+  sort packages.tmp >> packages
+
+  # Clean up
+  rm packages.tmp
+}
+
+# Pre-made *.dep files for meta-packages
+
+#--------------------------#
+generate_gnome_core()  {   # GNOME core
+#--------------------------#
+  local line base_xml package
+
+  > gnome-core.dep.tmp
+
+  for line in `grep "xi:include" $BLFS_XML/gnome/core/core.xml` ; do
+    base_xml=`echo $line | sed 's/^.*href="//;s/".*//'`
+    package=`grep "gnome/core/$base_xml" packages | cut -f1`
+    [[ -n "$package" ]] && echo $package >> gnome-core.dep.tmp
+  done
+
+  tac gnome-core.dep.tmp > libs/gnome-core.dep
+  rm gnome-core.dep.tmp
+}
+
+#--------------------------#
+generate_gnome_full()  {   # GNOME full
+#--------------------------#
+  local line base_xml package
+
+  echo "gnome-core" > gnome-full.dep.tmp
+
+  for line in `grep "xi:include" $BLFS_XML/gnome/add/add.xml` ; do
+    base_xml=`echo $line | sed 's/^.*href="//;s/".*//'`
+    package=`grep "gnome/add/$base_xml" packages | cut -f1`
+    [[ -n "$package" ]] && echo $package >> gnome-full.dep.tmp
+  done
+
+  tac gnome-full.dep.tmp > libs/gnome-full.dep
+  rm gnome-full.dep.tmp
+}
+
+#--------------------------#
+generate_kde_core()  {     # KDE core
+#--------------------------#
+  local line base_xml package
+
+  > kde-core.dep.tmp
+
+  for line in `grep "xi:include" $BLFS_XML/kde/core/core.xml` ; do
+    base_xml=`echo $line | sed 's/^.*href="//;s/".*//'`
+    package=`grep "kde/core/$base_xml" packages | cut -f1`
+    [[ -n "$package" ]] && echo $package >> kde-core.dep.tmp
+  done
+
+  tac kde-core.dep.tmp > libs/kde-core.dep
+  rm kde-core.dep.tmp
+}
+
+#--------------------------#
+generate_kde_full()  {     # KDE full
+#--------------------------#
+  local line base_xml package
+
+  echo "kde-core" > kde-full.dep.tmp
+
+  for line in `grep "xi:include" $BLFS_XML/kde/add/add.xml` ; do
+    base_xml=`echo $line | sed 's/^.*href="//;s/".*//'`
+    package=`grep "kde/add/$base_xml" packages | cut -f1`
+    [[ -n "$package" ]] && echo $package >> kde-full.dep.tmp
+  done
+
+  for line in `grep "xi:include" $BLFS_XML/kde/devel/devel.xml` ; do
+    base_xml=`echo $line | sed 's/^.*href="//;s/".*//'`
+    package=`grep "kde/devel/$base_xml" packages | cut -f1`
+    [[ -n "$package" ]] && echo $package >> kde-full.dep.tmp
+  done
+
+  tac kde-full.dep.tmp > libs/kde-full.dep
+  rm kde-full.dep.tmp
+}

Copied: jhalfs/branches/experimental/BLFS/libs/func_parser (from rev 2718, jhalfs/branches/experimental/BLFS/func_parser)
===================================================================
--- jhalfs/branches/experimental/BLFS/libs/func_parser	                        (rev 0)
+++ jhalfs/branches/experimental/BLFS/libs/func_parser	2006-05-27 10:33:12 UTC (rev 2721)
@@ -0,0 +1,136 @@
+#!/bin/bash
+#####
+#
+# Parse the XML documents to create a 'package' book
+#
+# $Id$
+#####
+
+
+#----------------------------#
+generate_TARGET_xml()  {     #
+#----------------------------#
+: <<inline_doc
+    function:   Generate the XML document for the TARGET package
+    input vars: nothing
+    externals:  vars: TARGET
+    modifies:   nothing
+    returns:    nothing
+    output:     file: $TARGET-index.xml
+    on error:   nothing
+    on success: nothing
+inline_doc
+
+  local
+  echo -en "\tGenerating $TARGET-index.xml ..."
+
+  #---------------------
+  # Header to $TARGET-index.xml
+{
+cat << EOF
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook XML V4.4//EN"
+  "http://www.oasis-open.org/docbook/xml/4.4/docbookx.dtd" >
+
+<book>
+
+  <xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="../$BLFS_XML/book/bookinfo.xml"/>
+
+  <preface>
+    <?dbhtml filename="preface.html" dir="preface"?>
+
+    <title>Preface</title>
+
+    <xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="../$BLFS_XML/introduction/important/locale-issues.xml"/>
+    <xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="../$BLFS_XML/introduction/important/bootscripts.xml"/>
+
+  </preface>
+
+  <chapter>
+    <?dbhtml filename="chapter.html" dir="installing"?>
+
+    <title>Installing $TARGET in Dependencies Build Order</title>
+
+EOF
+} > $TARGET-index.xml
+
+  #---------------------
+  # Dump $TARGET-index.xml.tmp in reverse order.
+  tac $TARGET-index.xml.tmp >> $TARGET-index.xml
+  rm $TARGET-index.xml.tmp
+
+  #---------------------
+  # Footer of $TARGET-index.xml
+{
+cat << EOF
+
+  </chapter>
+
+  <xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="../$BLFS_XML/appendices/creat-comm.xml"/>
+  <xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="../$BLFS_XML/appendices/ac-free-lic.xml"/>
+
+  <index/>
+
+</book>
+
+EOF
+} >> $TARGET-index.xml
+
+  echo "done"
+}
+
+
+#-------------------------#
+generate_target_book() {  #
+#-------------------------#
+: <<inline_doc
+    function:   Create an HTML document of the requested TARGET.
+    input vars: nothing
+    externals:  vars: TARGET
+                      BLFS_XML
+    modifies:   nothing
+    returns:    nothing
+    output:     file: NUMEROUS FILES
+    on error:   nothing
+    on success: nothing
+inline_doc
+
+  local filename # output filename
+
+  echo -en  "\tGenerating the HTML book ..."
+  xsltproc --xinclude --nonet --stringparam base.dir HTML/ \
+           --stringparam chunk.quietly 1 \
+           ../$BLFS_XML/stylesheets/blfs-chunked.xsl \
+           $TARGET-index.xml > xsltproc.log 2>&1
+
+  mkdir HTML/{stylesheets,images}
+  cp ../$BLFS_XML/stylesheets/*.css HTML/stylesheets
+  cp ../$BLFS_XML/images/*.png HTML/images
+  cd HTML
+  sed -i -e "s at ../stylesheets at stylesheets@g" *.html
+  sed -i -e "s at ../images at images@g" *.html
+  for filename in `find . -name "*.html"` ; do
+    tidy -config ../../$BLFS_XML/tidy.conf $filename || true
+    sh ../../$BLFS_XML/obfuscate.sh $filename
+    sed -i -e "s at text/html at application/xhtml+xml at g" $filename
+  done
+  echo "done"
+}
+
+
+#-------------------------#
+create_build_scripts() {  #
+#-------------------------#
+: <<inline_doc
+    function:
+    input vars: nothing
+    externals:  none
+    modifies:   nothing
+    returns:    nothing
+    output:     none
+    on error:   nothing
+    on success: nothing
+inline_doc
+
+  echo -en  "\tGenerating the build scripts ... not implemented yet, sorry\n"
+}

Modified: jhalfs/branches/experimental/BLFS/packages.sh
===================================================================
--- jhalfs/branches/experimental/BLFS/packages.sh	2006-05-27 10:08:22 UTC (rev 2720)
+++ jhalfs/branches/experimental/BLFS/packages.sh	2006-05-27 10:33:12 UTC (rev 2721)
@@ -6,7 +6,7 @@
 
 #---------------------
 # packages module
-source func_packages
+source libs/func_packages
 [[ $? > 0 ]] && echo -e "\n\tERROR: func_packages did not load..\n" && exit
 
 




More information about the alfs-log mailing list