Changeset c88f294


Ignore:
Timestamp:
08/19/2006 12:09:55 PM (18 years ago)
Author:
Manuel Canales Esparcia <manuel@…>
Branches:
experimental
Children:
7b08c36
Parents:
8b0d3b3
Message:

Let gen_config.sh to get package version from packages database.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • BLFS/gen_config.sh

    r8b0d3b3 rc88f294  
    1212declare PKG_XML_FILE
    1313declare PKG_DIR
     14declare PKG_VER
    1415declare SAVE_IFS=${IFS}
    1516declare -a DIR_TREE
     
    1819declare MENU_SET1="n"
    1920declare MENU_SET2="n"
    20 
    21 declare PKG_VER
    22 
    23 get_pkg_ver() {
    24   local this_script=$1
    25 
    26   case ${this_script} in
    27                   # ALSA packages version
    28             alsa* ) this_script=alsa ;;
    29 
    30                   # KDE packages version
    31           kdevelop ) : ;;
    32         kde*config ) : ;;
    33               kde* ) this_script=kde ;;
    34 
    35                   # Xorg7 packages version
    36       xorg7-server ) this_script=xorg-server ;;
    37             xterm2 ) this_script=xterm ;;
    38             xorg7* ) this_script=xorg7 ;;
    39 
    40                    # Others (ID value don't match entity name)
    41     wireless_tools ) this_script=wireless-tools ;;
    42         bind-utils ) this_script=bind ;;
    43          html-tidy ) this_script=tidy ;;
    44                jdk ) this_script=jdk-src ;;
    45           reiserfs ) this_script=reiser ;;
    46                xfs ) this_script=xfsprogs ;;
    47   esac
    48 
    49   PKG_VER=$(xmllint --noent ./blfs-xml/book/bookinfo.xml 2>/dev/null | \
    50             grep -i " ${this_script}-version " | cut -d "\"" -f2 )
    51 
    52 }
    5321
    5422> $outFile
     
    7947  PKG_XML_FILE=$(basename $2)
    8048  PKG_DIR=$(dirname $2)
    81     # These are the META packages. for gnome and kde (soon ALSA and Xorg7)
     49  PKG_VER=$3
     50    # These are the META packages.
    8251  if [ $PKG_DIR = "." ]; then
    8352    SET_COMMENT=y
    8453      # Do not include previously installed packages....
    85     if [ -e $TRACKING_DIR/${PKG_NAME} ]; then continue; fi
     54    if [ -e $TRACKING_DIR/${PKG_NAME}-${PKG_VER} ]; then continue; fi
    8655
    8756    META_PKG=$(echo ${PKG_NAME} | tr [a-z] [A-Z])
    8857    echo -e "config CONFIG_$META_PKG" >> $outFile
    89     echo -e "\tbool \"$META_PKG\"" >> $outFile
     58    echo -e "\tbool \"$META_PKG $PKG_VER\"" >> $outFile
    9059    echo -e "\tdefault n" >> $outFile
    9160
     
    9564       while [ 0 ]; do
    9665         read || break 1
    97         PKG_NAME=${REPLY}
    98          get_pkg_ver "${PKG_NAME}"
     66        PKG_NAME=${REPLY}
     67         PKG_VER=$(grep "^$PKG_NAME[[:space:]]" $inFile | cut -f3)
    9968(
    10069cat << EOF
     
    12089    # IF this package name-version exists in the tracking dir
    12190    # do not add this package to the list of installable pkgs.
    122   get_pkg_ver "${PKG_NAME}"
    12391  if [ -e $TRACKING_DIR/${PKG_NAME}-${PKG_VER} ]; then continue; fi
    12492
     
    12795  IFS="$SAVE_IFS"
    12896
    129         # Define a top level menu
     97    # Define a top level menu
    13098  if [ "$PREV_DIR1" != "${DIR_TREE[1]}" ]; then
    13199    [[ "${DIR_TREE[1]}" = "kde" ]] && continue
     
    147115  fi
    148116
    149         # Define a secondary menu
     117    # Define a secondary menu
    150118  if [ "$PREV_DIR2" != "${DIR_TREE[2]}" ]; then
    151119      # Close out the previous open menu structure
Note: See TracChangeset for help on using the changeset viewer.