Sort BLFS packages file by XML filename.

This commit is contained in:
Manuel Canales Esparcia 2006-08-17 21:19:23 +00:00
parent 350c9cb972
commit ee8dc261dc
2 changed files with 30 additions and 32 deletions

View file

@ -4,7 +4,7 @@
# #
export outFile=aConfig.in # file for reading and writing to. export outFile=aConfig.in # file for reading and writing to.
export inFile=packages.sorted # file for reading and writing to. export inFile=packages # file for reading and writing to.
declare TRACKING_DIR=/var/lib/jhalfs/BLFS declare TRACKING_DIR=/var/lib/jhalfs/BLFS
@ -22,14 +22,12 @@ declare PKG_VER
get_pkg_ver() { get_pkg_ver() {
local this_script=$1 local this_script=$1
PKG_VER=$(xmllint --noent ./blfs-xml/book/bookinfo.xml 2>/dev/null | \ PKG_VER=$(xmllint --noent ./blfs-xml/book/bookinfo.xml 2>/dev/null | \
grep -i " ${this_script#*-?-}-version " | cut -d "\"" -f2 ) grep -i " ${this_script#*-?-}-version " | cut -d "\"" -f2 )
} }
sort packages -b --key=2 --field-separator=/ --output=packages.sorted
> $outFile > $outFile
#---------------------# #---------------------#
@ -51,9 +49,9 @@ do
[[ "${REPLY:0:1}" = "#" ]]; then [[ "${REPLY:0:1}" = "#" ]]; then
continue continue
fi fi
set -- $REPLY set -- $REPLY
PKG_NAME=$1 PKG_NAME=$1
PKG_XML_FILE=$(basename $2) PKG_XML_FILE=$(basename $2)
PKG_DIR=$(dirname $2) PKG_DIR=$(dirname $2)
# These are the META packages. for gnome and kde (soon ALSA and Xorg7) # These are the META packages. for gnome and kde (soon ALSA and Xorg7)
@ -81,18 +79,18 @@ cat << EOF
default y default y
EOF EOF
) >> $outFile ) >> $outFile
done <./libs/${PKG_NAME}.dep done <./libs/${PKG_NAME}.dep
echo -e "endmenu" >> $outFile echo -e "endmenu" >> $outFile
continue continue
fi fi
[[ "${SET_COMMENT}" = "y" ]] && echo "comment \"\"" >>$outFile; unset SET_COMMENT [[ "${SET_COMMENT}" = "y" ]] && echo "comment \"\"" >>$outFile; unset SET_COMMENT
# Deal with a few unusable chapter names # Deal with a few unusable chapter names
case ${PKG_NAME} in case ${PKG_NAME} in
other-* | others-* ) continue other-* | others-* ) continue
;; ;;
xorg7-* ) # Deal with sub-elements of Xorg7, mandatory for build. xorg7-* ) # Deal with sub-elements of Xorg7, mandatory for build.
# No need to (even possible?) to build separately # No need to (even possible?) to build separately
continue continue
;; ;;
@ -102,19 +100,19 @@ EOF
# do not add this package to the list of installable pkgs. # do not add this package to the list of installable pkgs.
get_pkg_ver "${PKG_NAME}" get_pkg_ver "${PKG_NAME}"
if [ -e $TRACKING_DIR/${PKG_NAME}-${PKG_VER} ]; then continue; fi if [ -e $TRACKING_DIR/${PKG_NAME}-${PKG_VER} ]; then continue; fi
IFS="/" IFS="/"
DIR_TREE=(${PKG_DIR}) DIR_TREE=(${PKG_DIR})
IFS="$SAVE_IFS" IFS="$SAVE_IFS"
# Define a top level menu # Define a top level menu
if [ "$PREV_DIR1" != "${DIR_TREE[1]}" ]; then if [ "$PREV_DIR1" != "${DIR_TREE[1]}" ]; then
[[ "${DIR_TREE[1]}" = "kde" ]] && continue [[ "${DIR_TREE[1]}" = "kde" ]] && continue
[[ "${DIR_TREE[1]}" = "gnome" ]] && continue [[ "${DIR_TREE[1]}" = "gnome" ]] && continue
if [ $MENU_SET1 = "y" ]; then if [ $MENU_SET1 = "y" ]; then
# Close out any open secondary menu # Close out any open secondary menu
if [ $MENU_SET2 = "y" ]; then if [ $MENU_SET2 = "y" ]; then
echo -e "\tendmenu" >> $outFile echo -e "\tendmenu" >> $outFile
# Reset 'menu open' flag # Reset 'menu open' flag
MENU_SET2="n" MENU_SET2="n"
@ -124,24 +122,24 @@ EOF
fi fi
# Open a new top level menu # Open a new top level menu
echo -e "menu "$(echo ${DIR_TREE[1]:0:1} | tr [a-z] [A-Z])${DIR_TREE[1]:1}"" >> $outFile echo -e "menu "$(echo ${DIR_TREE[1]:0:1} | tr [a-z] [A-Z])${DIR_TREE[1]:1}"" >> $outFile
MENU_SET1="y" MENU_SET1="y"
fi fi
# Define a secondary menu # Define a secondary menu
if [ "$PREV_DIR2" != "${DIR_TREE[2]}" ]; then if [ "$PREV_DIR2" != "${DIR_TREE[2]}" ]; then
# Close out the previous open menu structure # Close out the previous open menu structure
if [ $MENU_SET2 = "y" ]; then if [ $MENU_SET2 = "y" ]; then
echo -e "\tendmenu\n" >> $outFile echo -e "\tendmenu\n" >> $outFile
fi fi
# Initialize a new 2nd level menu structure. # Initialize a new 2nd level menu structure.
echo -e "\tmenu "$(echo ${DIR_TREE[2]:0:1} | tr [a-z] [A-Z])${DIR_TREE[2]:1}"" >> $outFile echo -e "\tmenu "$(echo ${DIR_TREE[2]:0:1} | tr [a-z] [A-Z])${DIR_TREE[2]:1}"" >> $outFile
MENU_SET2="y" MENU_SET2="y"
fi fi
( (
cat << EOF cat << EOF
config CONFIG_$PKG_NAME config CONFIG_$PKG_NAME
bool "$PKG_NAME ${PKG_VER}" bool "$PKG_NAME ${PKG_VER}"
default n default n
EOF EOF
) >> $outFile ) >> $outFile
@ -169,7 +167,7 @@ endchoice
config PRINT_SERVER config PRINT_SERVER
string string
default cups if PS_cups default cups if PS_cups
default LPRng if PS_LPRng default LPRng if PS_LPRng
choice choice
prompt "Mail server" prompt "Mail server"
@ -203,7 +201,7 @@ choice
config KER_mitkrb config KER_mitkrb
bool "mitkrb" bool "mitkrb"
config KER_heimdal config KER_heimdal
bool "heimdal" bool "heimdal"
endchoice endchoice
config KBR5 config KBR5
string string
@ -218,7 +216,7 @@ choice
bool "Xorg" bool "Xorg"
config WIN_xfree86 config WIN_xfree86
bool "xfree86" bool "xfree86"
endchoice endchoice
config X11 config X11
string string
default xorg7 if WIN_xorg7 default xorg7 if WIN_xorg7
@ -226,27 +224,27 @@ config X11
default xfree86 if WIN_xfree86 default xfree86 if WIN_xfree86
endmenu endmenu
choice choice
prompt "Dependency level" prompt "Dependency level"
default DEPLVL_2 default DEPLVL_2
config DEPLVL_1 config DEPLVL_1
bool "Required dependencies only" bool "Required dependencies only"
config DEPLVL_2 config DEPLVL_2
bool "Required and recommended dependencies" bool "Required and recommended dependencies"
config DEPLVL_3 config DEPLVL_3
bool "Required, recommended and optional dependencies" bool "Required, recommended and optional dependencies"
endchoice endchoice
config optDependency config optDependency
int int
default 1 if DEPLVL_1 default 1 if DEPLVL_1
default 2 if DEPLVL_2 default 2 if DEPLVL_2
default 3 if DEPLVL_3 default 3 if DEPLVL_3
config SUDO config SUDO
bool "Build as User" bool "Build as User"
default y default y

View file

@ -34,10 +34,10 @@ kde-full $BLFS_XML
kde-koffice $BLFS_XML kde-koffice $BLFS_XML
xorg7 $BLFS_XML xorg7 $BLFS_XML
EOF EOF
} > packages } >> packages.tmp
# Dump packages list # Dump packages list
sort packages.tmp >> packages sort packages.tmp -b --key=2 --field-separator=/ --output=packages
# Clean up # Clean up
rm packages.tmp rm packages.tmp