Changeset e1093cd


Ignore:
Timestamp:
10/24/2005 07:21:09 PM (19 years ago)
Author:
Manuel Canales Esparcia <manuel@…>
Branches:
0.2, 1.0, 2.3, 2.3.x, 2.4, ablfs, ablfs-more, legacy, new_features, trunk
Children:
7d4b863
Parents:
49aea5e
Message:

Changed the "if" test to use a cunstomized function.
Thanks to George B.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • jhalfs

    r49aea5e re1093cd  
    44# Load the configuration file
    55#
    6  . jhalfs.conf
     6source jhalfs.conf
    77
    88
     
    278278}
    279279
     280#-----------------------------------------------#
     281_IS_()  # Function to test build scripts names
     282#-----------------------------------------------#
     283{
     284  # Returns substr $2 or null str
     285  # Must use string testing
     286  case $1 in
     287    *$2*) echo "$2" ;;
     288       *) echo ""   ;;
     289  esac
     290}
     291
    280292#----------------------------#
    281293chapter4_Makefiles() {
     
    322334    # If no testsuites will be run, then TCL, Expect and DejaGNU isn't needed
    323335    if [ "$TOOLCHAINTEST" = "0" ]; then
    324       if echo $i | grep -q "tcl" ; then
    325         continue
    326       elif echo $i | grep -q "expect" ; then
    327         continue
    328       elif echo $i | grep -q "dejagnu" ; then
     336      if [[ `_IS_ $i tcl` ]] || [[ `_IS_ $i expect` ]] || [[ `_IS_ $i dejagnu` ]] ; then
    329337        continue
    330338      fi
     
    379387
    380388    # Dump the path to the Binutils or TCL sources directory.
    381     if [ ${i:4:8} = "binutils" -o ${i:4:3} = "tcl" ] ; then
     389    if [[ `_IS_ $i binutils` ]] || [[ `_IS_ $i tcl` ]] ; then
    382390(
    383391    cat << EOF
     
    387395
    388396    # For the Adjusting phase we must to cd to the binutils-build directory.
    389     elif [ ${i:4:9} = "adjusting" ] ; then
     397    elif [[ `_IS_ $i adjusting` ]] ; then
    390398(
    391399    cat << EOF
     
    396404
    397405    # For the Expect build we need to set the TCLPATH envar.
    398     elif [ ${i:4:6} = "expect" ] ; then
     406    elif [[ `_IS_ $i expect` ]] ; then
    399407(
    400408    cat << EOF
     
    427435    # For Binutils and TCL the sources must be retained some time.
    428436    if [ "$vrs" != "" ] ; then
    429       if [ ${i:4:8} != "binutils" ] && [ ${i:4:3} != "tcl" ] ; then
     437      if [[ ! `_IS_ $i binutils` ]] && [[ ! `_IS_ $i tcl` ]] ; then
    430438(
    431439    cat << EOF
     
    441449
    442450    # Remove the Binutils pass 1 sources after a successful Adjusting phase.
    443     if [ ${i:4:9} = "adjusting" ] ; then
     451    if [[ `_IS_ $i adjusting` ]] ; then
    444452(
    445453    cat << EOF
     
    452460
    453461    # Remove the TCL sources after a successful Expect build.
    454     if [ ${i:4:6} = "expect" ] ; then
     462    if [[ `_IS_ $i expect` ]] ; then
    455463(
    456464    cat << EOF
     
    483491    # We'll run the chroot commands differently than the others, so skip them in the
    484492    # dependencies and target creation.
    485     if echo $i | grep -q "chroot" ; then
     493    if [[ `_IS_ $i chroot` ]] ; then
    486494       continue
    487495    fi
     
    523531
    524532    # For the Re-Adjusting phase we must to cd to the binutils-build directory.
    525     if [ ${i:4:11} = "readjusting" ] ; then
     533    if [[ `_IS_ $i readjusting` ]] ; then
    526534(
    527535    cat << EOF
     
    530538EOF
    531539) >> $MKFILE.tmp
    532     fi
    533540
    534541    # For Glibc we need to set TIMEZONE envar.
    535     if [ ${i:4:5} = "glibc" ] ; then
     542    elif [[ `_IS_ $i glibc` ]] ; then
    536543(
    537544    cat << EOF
     
    540547EOF
    541548) >> $MKFILE.tmp
    542     fi
    543549
    544550    # For Groff we need to set PAGE envar.
    545     if [ ${i:4:5} = "groff" ] ; then
     551    elif [[ `_IS_ $i groff` ]] ; then
    546552(
    547553    cat << EOF
     
    554560    # In the mount of kernel filesystems we need to set LFS
    555561    # and not to use chroot.
    556     if [ ${i:4:6} = "kernfs" ] ; then
     562    if [[ `_IS_ $i kernfs` ]] ; then
    557563(
    558564    cat << EOF
     
    572578EOF
    573579) >> $MKFILE.tmp
    574 
    575580    fi
    576581
     
    589594
    590595    # Remove the Binutils pass 2 sources after a successful Re-Adjusting phase.
    591     if [ ${i:4:11} = "readjusting" ] ; then
     596    if [[ `_IS_ $i readjusting` ]] ; then
    592597(
    593598    cat << EOF
     
    619624    i=`basename $file`
    620625
    621     # Grub must be configured manually
    622     if echo $i | grep -q "grub" ; then
     626    # Grub must be configured manually.
     627    # The filesystems can't be unmounted via Makefile and the user
     628    # should to enter to the chroot environment to create the root
     629    # password, edit several files and setup Grub,
     630    if [[ `_IS_ $i grub` ]] || [[ `_IS_ $i reboot` ]] ; then
    623631       continue
    624     # The filesystems can't be unmounted yet due that the user must
    625     # to enter to the chroot environment to create the root password,
    626     # edit several files and setup Grub,
    627     elif echo $i | grep -q "reboot" ; then
    628        continue
    629632    fi
    630633
    631634    # If no .config file is supplied, the kernel build is skipped
    632     if [ -z $CONFIG ] ; then
    633       if echo $i | grep -q "kernel" ; then
    634         continue
    635       fi
     635    if [ -z $CONFIG ] && [[ `_IS_ $i kernel` ]] ; then
     636      continue
    636637    fi
    637638
     
    651652
    652653    # Find the the bootscripts and kernel package names
    653     if [ ${i:4:11} = "bootscripts" -o ${i:4:6} = "kernel" ] ; then
    654       if [ ${i:4:11} = "bootscripts" ] ; then
     654    if [[ `_IS_ $i bootscripts` ]] || [[ `_IS_ $i kernel` ]] ; then
     655      if [[ `_IS_ $i bootscripts` ]] ; then
    655656        vrs=`grep "^lfs-bootscripts-version" $JHALFSDIR/packages | sed -e 's/.* //' -e 's/"//g'`
    656657        FILE="lfs-bootscripts-$vrs.tar.bz2"
    657       elif [ ${i:4:6} = "kernel" ] ; then
     658      elif [[ `_IS_ $i kernel` ]] ; then
    658659        vrs=`grep "^linux-version" $JHALFSDIR/packages | sed -e 's/.* //' -e 's/"//g'`
    659660        FILE="linux-$vrs.tar.bz2"
     
    670671
    671672    # Put in place the kernel .config file
    672     if [ ${i:4:6} = "kernel" ] ; then
     673    if [[ `_IS_ $i kernel` ]] ; then
    673674(
    674675    cat << EOF
     
    679680
    680681    # Check if we have a real /etc/fstab file
    681     if [ ${i:4:5} = "fstab" ] && [ -n "$FSTAB" ] ; then
     682    if [[ `_IS_ $i fstab` ]] && [[ -n "$FSTAB" ]] ; then
    682683(
    683684    cat << EOF
     
    699700
    700701    # Remove the build directory except if the package build fails.
    701     if [ ${i:4:11} = "bootscripts" -o ${i:4:6} = "kernel" ] ; then
     702    if [[ `_IS_ $i bootscripts` ]] || [[ `_IS_ $i kernel` ]] ; then
    702703(
    703704    cat << EOF
     
    831832  echo "You must be logged in as root to successfully build LFS."
    832833  exit 1
    833 fi
    834 
    835 # Find the download client to use, if not already specified.
    836 
    837 if [ -z $DL ] ; then
    838   if [ `type -p wget` ] ; then
    839     DL=wget
    840   elif [ `type -p curl` ] ; then
    841     DL=curl
    842   else
    843     eval "$no_dl_client"
    844   fi
    845834fi
    846835
     
    966955done
    967956
     957# Find the download client to use, if not already specified.
     958
     959if [ -z $DL ] ; then
     960  if [ `type -p wget` ] ; then
     961    DL=wget
     962  elif [ `type -p curl` ] ; then
     963    DL=curl
     964  else
     965    eval "$no_dl_client"
     966  fi
     967fi
     968
    968969[[ ! -d $JHALFSDIR ]]        && mkdir -pv $JHALFSDIR
    969970[[ "$PWD" != "$JHALFSDIR" ]] && cp -v $0 $XSL $FILES $JHALFSDIR/
Note: See TracChangeset for help on using the changeset viewer.