Let gen_config.sh to get package version from packages database.
This commit is contained in:
parent
8b0d3b3368
commit
c88f294f76
1 changed files with 9 additions and 41 deletions
|
@ -11,6 +11,7 @@ declare TRACKING_DIR=/var/lib/jhalfs/BLFS
|
|||
declare PKG_NAME
|
||||
declare PKG_XML_FILE
|
||||
declare PKG_DIR
|
||||
declare PKG_VER
|
||||
declare SAVE_IFS=${IFS}
|
||||
declare -a DIR_TREE
|
||||
declare PREV_DIR1="none"
|
||||
|
@ -18,39 +19,6 @@ declare PREV_DIR2="none"
|
|||
declare MENU_SET1="n"
|
||||
declare MENU_SET2="n"
|
||||
|
||||
declare PKG_VER
|
||||
|
||||
get_pkg_ver() {
|
||||
local this_script=$1
|
||||
|
||||
case ${this_script} in
|
||||
# ALSA packages version
|
||||
alsa* ) this_script=alsa ;;
|
||||
|
||||
# KDE packages version
|
||||
kdevelop ) : ;;
|
||||
kde*config ) : ;;
|
||||
kde* ) this_script=kde ;;
|
||||
|
||||
# Xorg7 packages version
|
||||
xorg7-server ) this_script=xorg-server ;;
|
||||
xterm2 ) this_script=xterm ;;
|
||||
xorg7* ) this_script=xorg7 ;;
|
||||
|
||||
# Others (ID value don't match entity name)
|
||||
wireless_tools ) this_script=wireless-tools ;;
|
||||
bind-utils ) this_script=bind ;;
|
||||
html-tidy ) this_script=tidy ;;
|
||||
jdk ) this_script=jdk-src ;;
|
||||
reiserfs ) this_script=reiser ;;
|
||||
xfs ) this_script=xfsprogs ;;
|
||||
esac
|
||||
|
||||
PKG_VER=$(xmllint --noent ./blfs-xml/book/bookinfo.xml 2>/dev/null | \
|
||||
grep -i " ${this_script}-version " | cut -d "\"" -f2 )
|
||||
|
||||
}
|
||||
|
||||
> $outFile
|
||||
|
||||
#---------------------#
|
||||
|
@ -78,15 +46,16 @@ do
|
|||
PKG_NAME=$1
|
||||
PKG_XML_FILE=$(basename $2)
|
||||
PKG_DIR=$(dirname $2)
|
||||
# These are the META packages. for gnome and kde (soon ALSA and Xorg7)
|
||||
PKG_VER=$3
|
||||
# These are the META packages.
|
||||
if [ $PKG_DIR = "." ]; then
|
||||
SET_COMMENT=y
|
||||
# Do not include previously installed packages....
|
||||
if [ -e $TRACKING_DIR/${PKG_NAME} ]; then continue; fi
|
||||
if [ -e $TRACKING_DIR/${PKG_NAME}-${PKG_VER} ]; then continue; fi
|
||||
|
||||
META_PKG=$(echo ${PKG_NAME} | tr [a-z] [A-Z])
|
||||
echo -e "config CONFIG_$META_PKG" >> $outFile
|
||||
echo -e "\tbool \"$META_PKG\"" >> $outFile
|
||||
echo -e "\tbool \"$META_PKG $PKG_VER\"" >> $outFile
|
||||
echo -e "\tdefault n" >> $outFile
|
||||
|
||||
echo -e "menu \"$(echo ${PKG_NAME} | tr [a-z] [A-Z]) components\"" >> $outFile
|
||||
|
@ -95,7 +64,7 @@ do
|
|||
while [ 0 ]; do
|
||||
read || break 1
|
||||
PKG_NAME=${REPLY}
|
||||
get_pkg_ver "${PKG_NAME}"
|
||||
PKG_VER=$(grep "^$PKG_NAME[[:space:]]" $inFile | cut -f3)
|
||||
(
|
||||
cat << EOF
|
||||
config DEP_${META_PKG}_${PKG_NAME}
|
||||
|
@ -119,7 +88,6 @@ EOF
|
|||
|
||||
# IF this package name-version exists in the tracking dir
|
||||
# do not add this package to the list of installable pkgs.
|
||||
get_pkg_ver "${PKG_NAME}"
|
||||
if [ -e $TRACKING_DIR/${PKG_NAME}-${PKG_VER} ]; then continue; fi
|
||||
|
||||
IFS="/"
|
||||
|
|
Reference in a new issue