Changeset 9c90294 for common


Ignore:
Timestamp:
03/20/2006 11:07:53 PM (18 years ago)
Author:
George Boudreau <georgeb@…>
Branches:
experimental
Children:
386bc75
Parents:
7161bc9
Message:

CLFS extract_commands now part of common_func. pushd/popd added to master.sh to deal with multitiple files defined in config param FILES. Added to xsl files to CLFS dir

File:
1 edited

Legend:

Unmodified
Added
Removed
  • common/common-functions

    r7161bc9 r9c90294  
    547547  local saveIFS=$IFS
    548548  local IFS
    549   echo -ne "Creating the patch file list "
     549
     550  rm -f patches
    550551
    551552  LOC_add_patches_entry() {
     
    555556  }
    556557
    557   xsltproc --nonet \
    558            --xinclude \
    559            --stringparam model $MODEL \
    560            -o patcheslist_.wget \
    561            patcheslist.xsl \
    562            $BOOK/chapter04/patches.xml
    563 
    564   rm -f patches
     558  case ${PROGNAME} in
     559    hlfs)
     560         echo -n "Creating the ${L_arrow}${BOLD}HLFS${R_arrow} specific patcheslist_.wget file"
     561         xsltproc --nonet \
     562                  --xinclude \
     563                  --stringparam model $MODEL \
     564                  -o patcheslist_.wget \
     565                  patcheslist.xsl \
     566                  $BOOK/chapter04/patches.xml
     567                  #> /dev/null 2>&1
     568
     569         # .... U G L Y .... what to do with the grsecurity patch to the kernel..
     570         for f in `grep "/grsecurity-" patcheslist_.wget`; do
     571           basename $f >> patches
     572         done
     573      ;;
     574
     575    clfs)  # Pull out a list of arch specific patches
     576         echo -n "Creating ${L_arrow}${BOLD}$ARCH${R_arrow} specific patcheslist_.wget file"
     577         xsltproc -xinclude  \
     578                  -o patcheslist_.wget \
     579                  patcheslist.xsl \
     580                  $BOOK/${ARCH}-index.xml   
     581      ;;
     582    *)  return
     583  esac
     584
    565585
    566586  IFS=$'\x0A'  # Modify the 'internal field separator' to break on 'LF' only
     
    574594  done
    575595
    576   # .... U G L Y .... what to do with the grsecurity patch to the kernel..
    577   for f in `grep "/grsecurity-" patcheslist_.wget`; do
    578       basename $f >> patches
    579   done
    580 
    581   rm -f patcheslist_.wget
    582   echo "...OK"
    583 }
    584 
     596  echo " ...OK"
     597}
    585598
    586599
     
    588601extract_commands() {         #
    589602#----------------------------#
     603  local saveIFS=$IFS
     604 
    590605  # Check for libxslt instead of just letting the script hit 'xsltproc' and fail.
    591606  test `type -p xsltproc` || eval "echo \"This feature requires libxslt.\"
     
    605620  case ${PROGNAME} in
    606621    clfs)
    607         echo -n "${tab_} ${L_arrow}${BOLD}$ARCH${R_arrow} target architecture"
     622        echo -n " ${L_arrow}${BOLD}$ARCH${R_arrow} target architecture"
    608623        xsltproc --xinclude \
    609624                 --nonet \
     
    612627      ;;
    613628    hlfs)
    614         echo -n "${tab_} ${L_arrow}${BOLD}$MODEL${R_arrow} HLFS architecture"
     629        echo -n " ${L_arrow}${BOLD}$MODEL${R_arrow} HLFS architecture"
    615630        xsltproc --nonet \
    616631                 --xinclude \
     
    626641      ;;
    627642    lfs)
    628         echo -n "${tab_} ${L_arrow}${BOLD}LFS${R_arrow} build"
     643        echo -n " ${L_arrow}${BOLD}LFS${R_arrow} build"
    629644        xsltproc --nonet \
    630645                 --xinclude \
     
    637652      ;;
    638653    blfs)
    639         echo -n "${tab_} ${L_arrow}${BOLD}BLFS${R_arrow} build"
     654        echo -n " ${L_arrow}${BOLD}BLFS${R_arrow} build"
    640655        xsltproc --nonet \
    641656                 --xinclude \
     
    653668
    654669  # Grab the patches and package names.
    655   cd $JHALFSDIR
    656   for i in patches packages ; do rm -f $i ; done
    657   grep "\-version" $BOOK/general.ent | sed -e 's@<!ENTITY @@' -e 's@">@"@' \
    658   -e '/generic/d' >> packages
     670  for i in patches packages ; do
     671    rm -f $i
     672  done
     673  #
     674  case "${PROGNAME}" in
     675    clfs)
     676      ################################
     677      # A LOCAL function
     678      # xx_.wget contains arch specific files but in URL format
     679      # Build a file with only arch specific files.. small ugly..
     680      LOC_add_packages_entry() {
     681        local fileMATCH aFILE
     682   
     683        fileMATCH="/$1"
     684        # format.. Filename-Version  or FilenameVersion
     685        for aFILE in `grep ${fileMATCH}-*[[:digit:]] packageslist_.wget`; do
     686         # The aFILE%\?* is necessary to strip the "?download" appended to sourceforge files
     687         echo "$1-version \"$2\"" >> packages
     688        done
     689      }
     690      #################################
     691 
     692      # We only want a list arch specific files..
     693      # Unfortunately this script produces URL's which must be converted to a std format
     694      echo -n "Creating CLFS ${L_arrow}${BOLD}${ARCH}${R_arrow} specific packageslist_.wget file"
     695      xsltproc -xinclude  \
     696               -o packageslist_.wget \
     697               packageslist.xsl \
     698               $BOOK/${ARCH}-index.xml   
     699
     700      # This has the correct format but contains packages from every book 
     701      grep "\-version " $BOOK/packages.ent | sed -e 's@<!ENTITY @@' \
     702                                                 -e 's@">@"@' \
     703                                                 -e '/generic/d' > packages.tmp
     704      # This variable is necessary to make sure the `cat $JHALFSDIR/packages`
     705      # separates each iteration by lines.
     706      # Modify the 'internal field separator' to break on 'LF' only
     707      IFS=$'\x0A'
     708      for f in `cat packages.tmp`; do
     709        IFS=$saveIFS  # Restore the system defaults     
     710        LOC_add_packages_entry \
     711        `echo $f | sed -e 's/-version//' \
     712                       -e 's/-file.*//' \
     713                       -e 's/"//g'`
     714     done
     715     echo " ...OK"
     716     ;;
     717           
     718    *)
     719      echo -n "Creating <${PROGNAME}> specific packageslist_.wget file"
     720      grep "\-version" $BOOK/general.ent | sed -e 's@<!ENTITY @@' \
     721                                               -e 's@">@"@' \
     722                                               -e '/generic/d' >> packages
     723      ;;
     724  esac
    659725
    660726  # Download the vim-lang package if it must be installed
     
    664730  echo `grep "udev-config-file" $BOOK/general.ent | sed -e 's@<!ENTITY @@' -e 's@">@"@'` >> packages
    665731
    666   # There is no HLFS patches.ent file so we will create one.
    667 
     732  # There is no useful patches.ent file so we will create one.
    668733  case "${PROGNAME}" in
    669     hlfs)  build_patches_file ;;
    670     clfs) ;;
     734    hlfs)
     735      build_patches_file ;;
     736    clfs )
     737      build_patches_file ;;
    671738    lfs)
    672739      grep "^<\!ENTITY" $BOOK/patches.ent | sed -e 's/.* "//' -e 's/">//' >> patches
Note: See TracChangeset for help on using the changeset viewer.