r2374 - jhalfs/branches/experimental/CLFS

georgeb at linuxfromscratch.org georgeb at linuxfromscratch.org
Mon Mar 20 14:26:42 PST 2006


Author: georgeb
Date: 2006-03-20 15:26:42 -0700 (Mon, 20 Mar 2006)
New Revision: 2374

Modified:
   jhalfs/branches/experimental/CLFS/master.sh
Log:
Remove custom func extract_commands from master.sh..

Modified: jhalfs/branches/experimental/CLFS/master.sh
===================================================================
--- jhalfs/branches/experimental/CLFS/master.sh	2006-03-20 21:53:24 UTC (rev 2373)
+++ jhalfs/branches/experimental/CLFS/master.sh	2006-03-20 22:26:42 UTC (rev 2374)
@@ -5,164 +5,8 @@
 ###          FUNCTIONS          ###
 ###################################
 
-unset extract_commands
-#----------------------------#
-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 $JHALFSDIR
-  VERSION=`grep "ENTITY version " $BOOK/general.ent | sed 's@<!ENTITY version "@@;s@">@@'`
-
-  # Start clean
-  if [ -d ${PROGNAME}-commands ]; then
-    rm -rf ${PROGNAME}-commands
-  else
-    mkdir -v ${PROGNAME}-commands
-  fi
-  echo "Extracting commands... ${BOLD}START${OFF}"
-
-  echo "${tab_}Extracting commands for ${L_arrow}${BOLD}$ARCH${R_arrow} target architecture"
-  xsltproc --xinclude \
-           --nonet \
-           --output ./${PROGNAME}-commands/ \
-           $BOOK/stylesheets/dump-commands.xsl $BOOK/$ARCH-index.xml
-
-  # Grab the patches and package names.
-  cd $JHALFSDIR
-
-  echo "${tab_}Creating the packages and patches files" ;
-  for i in patches packages ; do rm -f $i ; done
-
-  grep "\-version " $BOOK/packages.ent | sed -e 's@<!ENTITY @@' \
-                                             -e 's@">@"@' \
-                                             -e '/generic/d' >> packages
-
-  # Download the vim-lang package if it must be installed
-  if [ "$VIMLANG" = "1" ] ; then
-    echo `grep "vim" packages | sed 's at vim@&-lang@'` >> packages
-  fi
-
-  grep "^<\!ENTITY" $BOOK/patches.ent | sed -e 's/.* "//' -e 's/">//' >> patches
-  # Needed for Groff patchlevel patch
-  GROFFLEVEL=`grep "groff-patchlevel" $BOOK/general.ent | sed -e 's/groff-patchlevel //' \
-                                                              -e 's/"//g' \
-                                                              -e 's@<!ENTITY @@' \
-                                                              -e 's|>||'`
-  sed -i 's|&groff-patchlevel;|'$GROFFLEVEL'|' patches
-
-
-  # Preprocess the cmd scripts..
-  echo "${tab_}Preprocessing the cmd scripts"
-  #
-  local file this_script package vrs URLs
-  #
-  # Create a list of URLs..
-  echo "${tab_}${tab_}Writing a list of URLs to filelist_.wget "
-  xsltproc --nonet \
-           --xinclude \
-           -o filelist_.wget \
-           $BOOK/stylesheets/wget.xsl \
-           $BOOK/$ARCH-index.xml > /dev/null 2>&1
-  #
-  # Loop through all the command scripts
-  echo "${tab_}${tab_}Modifying the cmd scripts"
-  for file in `ls ${PROGNAME}-commands/*/*`;do
-    #
-    # 1. Compress the script file (remove blank lines)
-    # 2. Add a variable header and a footer to selected scripts
-    this_script=`basename $file`
-    #
-    # DO NOT play with the chroot scripts.. they are used as is later
-    [[ `_IS_ $this_script "chroot"` ]] && continue
-    #
-    # Strip leading index number and misc test.. This is a miserable method
-    package=`echo $this_script | sed -e 's@[0-9]\{3\}-@@' \
-                                     -e 's at -static@@' \
-                                     -e 's at -final@@' \
-                                     -e 's at temp-@@' \
-                                     -e 's at -64bit@@' \
-                                     -e 's at -64@@' \
-                                     -e 's at 64@@' \
-                                     -e 's at -n32@@' \
-                                     -e 's at -build@@' \
-                                     -e 's at glibc-headers@glibc@'`
-    #
-    # Find the package version of the command files
-    #
-    # A little package name manipulation
-    case $package in
-      bootscripts)    package="lfs-bootscripts" ;;
-      kernel)         package="linux" ;;
-    esac
-    vrs=`grep "^$package-version" $JHALFSDIR/packages | sed -e 's/.* //' -e 's/"//g'`
-    #
-    # If $vrs isn't empty, we've got a package...
-    # NOTE: The included \n causes the separator to be written
-    # on the next line. This is for cosmetic purposes only...
-    #
-    # Set the appropriate 'sha-bang'.. depending of the phase..
-    case $package in
-      *introduction* | \
-      *changingowner* | \
-      *creatingdirs* | \
-      *createfiles* ) sha_bang=''
-         ;;
-      *)  sha_bang='#!/bin/bash'
-         ;;
-    esac
-    #
-    #
-    if [ "$vrs" != "" ] ; then
-      HEADER_STR="cd \$PKGDIR${nl_}#------------------"
-      FOOTER_STR="#------------------${nl_}exit"
-    else
-      HEADER_STR="#------------------"
-      FOOTER_STR="#------------------${nl_}exit"
-    fi
-    PKG_URL=`grep -e "$package-$vrs.*tar." $JHALFSDIR/filelist_.wget` && true
-    PATCHES=`grep "$package-$vrs.*patch" $JHALFSDIR/filelist_.wget` && true
-    #
-    # There would be no URL for a cmd only script, reset package name
-    if [[ $PKG_URL = "" ]]; then
-      package=""
-    fi
-(
-cat << EOF
-${sha_bang}
-set -e
-
-#####################################
-    NAME=${this_script}
-    PACKAGE=${package}
-    VERSION=${vrs}
-    PKG_URL=( ${PKG_URL} )
-    PATCHES=( ${PATCHES} )
-#####################################
-
-${HEADER_STR}
-`grep '.' ${file}`
-${FOOTER_STR}
-EOF
-) > tmp.script
-mv tmp.script ${file}
-
-  done # for file in `ls $PROGNAME-commands/*/*`
-  #
-  # Make the scripts executable.
-  chmod -R +x $JHALFSDIR/${PROGNAME}-commands
-
-  # Done. Moving on...
-  echo "Extracting commands... ${BOLD}DONE${OFF}"
-  get_sources
-
-}
-
-
-
 #----------------------------#
 host_prep_Makefiles() {       # Initialization of the system
 #----------------------------#




More information about the alfs-log mailing list