Changeset a160d86 for CLFS/master.sh


Ignore:
Timestamp:
06/20/2006 09:14:44 PM (18 years ago)
Author:
George Boudreau <georgeb@…>
Branches:
1.0, 2.3, 2.3.x, 2.4, ablfs, ablfs-more, legacy, new_features, trunk
Children:
ddde18e
Parents:
c044e3c
Message:

Extensive code changes. A different method for finding the tarball name.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • CLFS/master.sh

    rc044e3c ra160d86  
    118118                                  -e 's@-static@@' \
    119119                                  -e 's@-final@@' \
    120                                   -e 's@-headers@@' \
    121                                   -e 's@-64@@' \
     120                                  -e 's@-64@@' \
    122121                                  -e 's@-n32@@'`
    123     # Adjust 'name' and patch a few scripts on the fly..
    124     case $name in
    125       linux-libc) name=linux-libc-headers ;;
    126       linux)      name=linux-headers ;;
    127     esac
    128     #
    129     # Find the version of the command files, if it corresponds with the building of a specific package
    130 
    131     # oh-oh.. This small ugly is necessary to handle the LFS headers naming scheme
    132     if [ "${name}" = "linux-headers" ]; then
    133       linux_vrs=`grep "^linux-version" $JHALFSDIR/packages | sed -e 's/.* //' -e 's/"//g'`
    134       vrs=`grep "^$name-version" $JHALFSDIR/packages | sed -e 's/.* //' -e 's/"//g'`
    135       vrs=${linux_vrs}-${vrs##*-}
    136     else
    137       vrs=`grep "^$name-version" $JHALFSDIR/packages | sed -e 's/.* //' -e 's/"//g'`
    138     fi
     122    pkg_tarball=$(get_package_tarball_name $name)
     123
    139124    #--------------------------------------------------------------------#
    140125    #         >>>>>>>> START BUILDING A Makefile ENTRY <<<<<<<<          #
     
    145130    wrt_target "${this_script}" "$PREV"
    146131    #
    147     # If $vrs isn't empty, we've got a package...
    148     #
    149     [[ "$vrs" != "" ]] && wrt_unpack "$name-$vrs.tar.*"
     132    # If $pkg_tarball isn't empty, we've got a package...
     133    #
     134    [[ "$pkg_tarball" != "" ]] && wrt_unpack "$pkg_tarball"
    150135    #
    151136    wrt_run_as_su "${this_script}" "${file}"
    152137    #
    153     [[ "$vrs" != "" ]] && wrt_remove_build_dirs "${name}"
     138    [[ "$pkg_tarball" != "" ]] && wrt_remove_build_dirs "${name}"
    154139    #
    155140    # Include a touch of the target name so make can check if it's already been made.
     
    184169    name=`echo $this_script | sed -e 's@[0-9]\{3\}-@@'`
    185170    #
    186     # Find the version of the command files, if it corresponds with the building of a specific package
    187     vrs=`grep "^$name-version" $JHALFSDIR/packages | sed -e 's/.* //' -e 's/"//g'`
    188 
     171    pkg_tarball=$(get_package_tarball_name $name)
    189172
    190173    #--------------------------------------------------------------------#
     
    196179    wrt_target "${this_script}" "$PREV"
    197180    #
    198     # If $vrs isn't empty, we've got a package...
     181    # If $pkg_tarball isn't empty, we've got a package...
    199182    # Insert instructions for unpacking the package and to set the PKGDIR variable.
    200183    #
    201     [[ "$vrs" != "" ]] && wrt_unpack "$name-$vrs.tar.*"
    202     [[ "$vrs" != "" ]] && [[ "$OPTIMIZE" = "2" ]] &&  wrt_optimize "$name" && wrt_makeflags "$name"
     184    [[ "$pkg_tarball" != "" ]] && wrt_unpack "$pkg_tarball"
     185    [[ "$pkg_tarball" != "" ]] && [[ "$OPTIMIZE" = "2" ]] &&  wrt_optimize "$name" && wrt_makeflags "$name"
    203186    #
    204187    wrt_run_as_su "${this_script}" "${file}"
    205188    #
    206     [[ "$vrs" != "" ]] && wrt_remove_build_dirs "${name}"
     189    [[ "$pkg_tarball" != "" ]] && wrt_remove_build_dirs "${name}"
    207190    #
    208191    # Include a touch of the target name so make can check if it's already been made.
     
    258241    esac
    259242      # Identify the unique version naming scheme for the clfs bootscripts..(bad boys)
    260     case $name in
    261       bootscripts-cross-lfs)
    262         vrs=`grep "^clfs-bootscripts-version" $JHALFSDIR/packages | sed -e 's/.* //' -e 's/"//g'`
    263          ;;
    264       *) vrs=`grep "^$name-version" $JHALFSDIR/packages | sed -e 's/.* //' -e 's/"//g'`
    265          ;;
    266     esac
     243    pkg_tarball=$(get_package_tarball_name $name)
     244
    267245    #--------------------------------------------------------------------#
    268246    #         >>>>>>>> START BUILDING A Makefile ENTRY <<<<<<<<          #
     
    273251    wrt_target "${this_script}" "$PREV"
    274252    #
    275     # If $vrs isn't empty, we've got a package...
     253    # If $pkg_tarball isn't empty, we've got a package...
    276254    # Insert instructions for unpacking the package and changing directories
    277255    #
    278     [[ "$vrs" != "" ]] && wrt_unpack "$name-$vrs.tar.*"
    279     [[ "$vrs" != "" ]] && [[ "$OPTIMIZE" = "2" ]] &&  wrt_optimize "$name" && wrt_makeflags "$name"
     256    [[ "$pkg_tarball" != "" ]] && wrt_unpack "$pkg_tarball"
     257    [[ "$pkg_tarball" != "" ]] && [[ "$OPTIMIZE" = "2" ]] &&  wrt_optimize "$name" && wrt_makeflags "$name"
    280258    #
    281259    # Select a script execution method
     
    293271    #
    294272    # Housekeeping...remove any build directory(ies) except if the package build fails.
    295     [[ "$vrs" != "" ]] && wrt_remove_build_dirs "${name}"
     273    [[ "$pkg_tarball" != "" ]] && wrt_remove_build_dirs "${name}"
    296274    #
    297275    # Include a touch of the target name so make can check if it's already been made.
     
    330308    # Grab the name of the target, strip id number, XXX-script
    331309    name=`echo $this_script | sed -e 's@[0-9]\{3\}-@@'`
    332     vrs=`grep "^$name-version" $JHALFSDIR/packages | sed -e 's/.* //' -e 's/"//g'`
     310
     311    pkg_tarball=$(get_package_tarball_name $name)
    333312
    334313    #--------------------------------------------------------------------#
     
    340319    wrt_target "${this_script}" "$PREV"
    341320    #
    342     # If $vrs isn't empty, we've got a package...
     321    # If $pkg_tarball isn't empty, we've got a package...
    343322    # Insert instructions for unpacking the package and changing directories
    344323    #
    345     if [ "$vrs" != "" ] ; then
     324    if [ "$pkg_tarball" != "" ] ; then
    346325      case $this_script in
    347         *util-linux)    wrt_unpack  "$name-$vrs.tar.*"  ;;
    348         *)              wrt_unpack2 "$name-$vrs.tar.*"  ;;
     326        *util-linux)    wrt_unpack  "$pkg_tarball"  ;;
     327        *)              wrt_unpack2 "$pkg_tarball"  ;;
    349328      esac
    350329      [[ "$OPTIMIZE" = "2" ]] &&  wrt_optimize "$name" && wrt_makeflags "$name"
     
    354333    case $this_script in
    355334      *kernfs)        wrt_run_as_root    "${this_script}" "${file}"  ;;
    356       *util-linux)    wrt_run_as_su     "${this_script}" "${file}"  ;;
     335      *util-linux)    wrt_run_as_su      "${this_script}" "${file}"  ;;
    357336      *)              wrt_run_as_chroot1 "${this_script}" "${file}"  ;;
    358337    esac
    359338    #
    360339    # Housekeeping...remove the build directory(ies), except if the package build fails.
    361     [[ "$vrs" != "" ]] && wrt_remove_build_dirs "${name}"
     340    [[ "$pkg_tarball" != "" ]] && wrt_remove_build_dirs "${name}"
    362341    #
    363342    # Include a touch of the target name so make can check if it's already been made.
     
    395374                                  -e 's@n32@@'`
    396375
    397     vrs=`grep "^$name-version" $JHALFSDIR/packages | sed -e 's/.* //' -e 's/"//g'`
     376    pkg_tarball=$(get_package_tarball_name $name)
    398377
    399378    #--------------------------------------------------------------------#
     
    406385    #
    407386    case $name in
    408       tcl)    wrt_unpack2 "$name$vrs-src.tar.*" ;;
    409       *)      wrt_unpack2 "$name-$vrs.tar.*"    ;;
     387      tcl)    wrt_unpack2 `grep "^tcl" $JHALFSDIR/my_packages` ;;
     388      *)      wrt_unpack2 "$pkg_tarball"    ;;
    410389    esac
    411390    [[ "$OPTIMIZE" = "2" ]] &&  wrt_optimize "$name" && wrt_makeflags "$name"
     
    450429                                  -e 's@n32@@'`
    451430
    452     vrs=`grep "^$name-version" $JHALFSDIR/packages | sed -e 's/.* //' -e 's/"//g'`
     431    pkg_tarball=$(get_package_tarball_name $name)
    453432
    454433    #--------------------------------------------------------------------#
     
    461440    #
    462441    case $name in
    463       tcl)    wrt_unpack3 "$name$vrs-src.tar.*" ;;
    464       *)      wrt_unpack3 "$name-$vrs.tar.*"    ;;
     442      tcl)    wrt_unpack3 `grep "^tcl" $JHALFSDIR/my_packages` ;;
     443      *)      wrt_unpack3 "$pkg_tarball"    ;;
    465444    esac
    466445    [[ "$OPTIMIZE" = "2" ]] &&  wrt_optimize "$name" && wrt_makeflags "$name"
     
    532511    # a specific package. We need this here to can skip scripts not needed for
    533512    # iterations rebuilds
    534 
    535     # oh-oh.. This small ugly is necessary to handle the LFS headers naming scheme
    536     if [ "${name}" = "linux-headers" ]; then
    537       linux_vrs=`grep "^linux-version" $JHALFSDIR/packages | sed -e 's/.* //' -e 's/"//g'`
    538       vrs=`grep "^$name-version" $JHALFSDIR/packages | sed -e 's/.* //' -e 's/"//g'`
    539       vrs=${linux_vrs}-${vrs##*-}
    540     else
    541       vrs=`grep "^$name-version" $JHALFSDIR/packages | sed -e 's/.* //' -e 's/"//g'`
    542     fi
    543 
    544     if [[ "$vrs" = "" ]] && [[ -n "$N" ]] ; then
     513    pkg_tarball=$(get_package_tarball_name $name)
     514
     515    if [[ "$pkg_tarball" = "" ]] && [[ -n "$N" ]] ; then
    545516      case "${this_script}" in
    546517        *stripping*) ;;
     
    565536    wrt_target "${this_script}${N}" "$PREV"
    566537
    567     # If $vrs isn't empty, we've got a package...
    568     if [ "$vrs" != "" ] ; then
    569       FILE="$name-$vrs.tar.*"
    570       wrt_unpack2 "$FILE"
     538    # If $pkg_tarball isn't empty, we've got a package...
     539    if [ "$pkg_tarball" != "" ] ; then
     540      wrt_unpack2 "$pkg_tarball"
    571541      # If the testsuites must be run, initialize the log file
    572542      case $name in
     
    584554    wrt_run_as_chroot1 "${this_script}" "${file}"
    585555    #
    586     [[ "$vrs" != "" ]] && wrt_remove_build_dirs "${name}"
     556    [[ "$pkg_tarball" != "" ]] && wrt_remove_build_dirs "${name}"
    587557    #
    588558    # Include a touch of the target name so make can check if it's already been made.
     
    651621    # a specific package. We need this here to can skip scripts not needed for
    652622    # iterations rebuilds
    653     vrs=`grep "^$name-version" $JHALFSDIR/packages | sed -e 's/.* //' -e 's/"//g'`
    654 
    655     if [[ "$vrs" = "" ]] && [[ -n "$N" ]] ; then
     623
     624    pkg_tarball=$(get_package_tarball_name $name)
     625
     626    if [[ "$pkg_tarball" = "" ]] && [[ -n "$N" ]] ; then
    656627      case "${this_script}" in
    657628        *stripping*) ;;
     
    676647    wrt_target "${this_script}${N}" "$PREV"
    677648
    678     # If $vrs isn't empty, we've got a package...
    679     if [ "$vrs" != "" ] ; then
    680       FILE="$name-$vrs.tar.*"
     649    # If $pkg_tarball isn't empty, we've got a package...
     650    if [ "$pkg_tarball" != "" ] ; then
     651      FILE="$pkg_tarball"
    681652      wrt_unpack3 "$FILE"
    682653      # If the testsuites must be run, initialize the log file
     
    695666    wrt_run_as_root2 "${this_script}" "${file}"
    696667    #
    697     [[ "$vrs" != "" ]] && wrt_remove_build_dirs2 "${name}"
     668    [[ "$pkg_tarball" != "" ]] && wrt_remove_build_dirs2 "${name}"
    698669    #
    699670    # Include a touch of the target name so make can check if it's already been made.
     
    742713    esac
    743714
    744       # Identify the unique version naming scheme for the clfs bootscripts..(bad boys)
    745     case $name in
    746       bootscripts-cross-lfs)
    747          vrs=`grep "^clfs-bootscripts-version" $JHALFSDIR/packages | sed -e 's/.* //' -e 's/"//g'`
    748          ;;
    749       *) vrs=`grep "^$name-version" $JHALFSDIR/packages | sed -e 's/.* //' -e 's/"//g'`
    750          ;;
    751     esac
     715    pkg_tarball=$(get_package_tarball_name $name)
    752716
    753717    #--------------------------------------------------------------------#
     
    759723    wrt_target "${this_script}" "$PREV"
    760724    #
    761     # If $vrs isn't empty, we've got a package...
    762     #
    763     [[ "$vrs" != "" ]] && wrt_unpack2 "$name-$vrs.tar.*"
     725    # If $pkg_tarball isn't empty, we've got a package...
     726    #
     727    [[ "$pkg_tarball" != "" ]] && wrt_unpack2 "$pkg_tarball"
    764728    #
    765729    wrt_run_as_chroot1 "${this_script}" "${file}"
    766730    #
    767     [[ "$vrs" != "" ]] && wrt_remove_build_dirs "${name}"
     731    [[ "$pkg_tarball" != "" ]] && wrt_remove_build_dirs "${name}"
    768732    #
    769733    # Include a touch of the target name so make can check if it's already been made.
     
    810774       ;;
    811775    esac
    812     vrs=`grep "^$name-version" $JHALFSDIR/packages | sed -e 's/.* //' -e 's/"//g'`
     776
     777    pkg_tarball=$(get_package_tarball_name $name)
    813778
    814779    #--------------------------------------------------------------------#
     
    820785    wrt_target "${this_script}" "$PREV"
    821786    #
    822     # If $vrs isn't empty, we've got a package...
    823     #
    824     [[ "$vrs" != "" ]] && wrt_unpack3 "$name-$vrs.tar.*"
     787    # If $pkg_tarball isn't empty, we've got a package...
     788    #
     789    [[ "$pkg_tarball" != "" ]] && wrt_unpack3 "$pkg_tarball"
    825790    #
    826791    wrt_run_as_root2 "${this_script}" "${file}"
    827792    #
    828     [[ "$vrs" != "" ]] && wrt_remove_build_dirs2 "${name}"
     793    [[ "$pkg_tarball" != "" ]] && wrt_remove_build_dirs2 "${name}"
    829794    #
    830795    # Include a touch of the target name so make can check if it's already been made.
     
    873838       ;;
    874839    esac
    875     vrs=`grep "^$name-version" $JHALFSDIR/packages | sed -e 's/.* //' -e 's/"//g'`
     840
     841    pkg_tarball=$(get_package_tarball_name $name)
    876842
    877843    #--------------------------------------------------------------------#
     
    883849    wrt_target "${this_script}" "$PREV"
    884850    #
    885     # If $vrs isn't empty, we've got a package...
     851    # If $pkg_tarball isn't empty, we've got a package...
    886852    # Insert instructions for unpacking the package and changing directories
    887853    #
    888     [[ "$vrs" != "" ]] && wrt_unpack2 "$name-$vrs.tar.*"
     854    [[ "$pkg_tarball" != "" ]] && wrt_unpack2 "$pkg_tarball"
    889855    #
    890856    # Select a script execution method
     
    900866    #
    901867    # Housekeeping...remove any build directory(ies) except if the package build fails.
    902     [[ "$vrs" != "" ]] && wrt_remove_build_dirs "${name}"
     868    [[ "$pkg_tarball" != "" ]] && wrt_remove_build_dirs "${name}"
    903869    #
    904870    # Include a touch of the target name so make can check if it's already been made.
     
    946912    # Grab the name of the target, strip id number and misc words.
    947913    case $this_script in
    948       *kernel) name=linux
    949          ;;
     914      *kernel) name=linux  ;;
    950915      *)       name=`echo $this_script | sed -e 's@[0-9]\{3\}-@@' -e 's@-build@@' ` ;;
    951916    esac
    952917
    953     vrs=`grep "^$name-version" $JHALFSDIR/packages | sed -e 's/.* //' -e 's/"//g'`
     918    pkg_tarball=$(get_package_tarball_name $name)
    954919
    955920    #--------------------------------------------------------------------#
     
    961926    wrt_target "${this_script}" "$PREV"
    962927    #
    963     # If $vrs isn't empty, we've got a package...
     928    # If $pkg_tarball isn't empty, we've got a package...
    964929    # Insert instructions for unpacking the package and changing directories
    965930    #
    966     [[ "$vrs" != "" ]] && wrt_unpack3 "$name-$vrs.tar.*"
     931    [[ "$pkg_tarball" != "" ]] && wrt_unpack3 "$pkg_tarball"
    967932    #
    968933    # Select a script execution method
     
    980945    #
    981946    # Housekeeping...remove any build directory(ies) except if the package build fails.
    982     [[ "$vrs" != "" ]] && wrt_remove_build_dirs2 "${name}"
     947    [[ "$pkg_tarball" != "" ]] && wrt_remove_build_dirs2 "${name}"
    983948    #
    984949    # Include a touch of the target name so make can check if it's already been made.
     
    10921057clean:  clean-chapter4 clean-chapter3 clean-chapter2
    10931058
     1059restart:
     1060        @echo "This feature does not exist for the CLFS makefile. (yet)"
     1061
    10941062clean-chapter2:
    10951063        -if [ ! -f user-lfs-exist ]; then \\
     
    11711139clean:  clean-makesys clean-makeboot clean-jhalfs
    11721140
     1141restart:
     1142        @echo "This feature does not exist for the CLFS makefile. (yet)"
     1143
    11731144clean-jhalfs:
    11741145        -if [ ! -f user-lfs-exist ]; then \\
Note: See TracChangeset for help on using the changeset viewer.