6 export outFile
=Config.
in # file for reading and writing to.
7 export inFile
=packages
# file for reading and writing to.
15 declare SAVE_IFS
=${IFS}
17 declare PREV_DIR1
="none"
18 declare PREV_DIR2
="none"
24 #---------------------#
26 #---------------------#
28 This script will create a Config.in file from the contents
29 of the file <packages>.
30 Packages previously installed will not be included.
33 echo -en "\tGenerating Config.in from package data ..."
42 PKG_XML_FILE
=$
(basename $2)
46 # These are the META packages.
47 if [ $PKG_DIR = "." ]; then
49 # Do not include previously installed packages
50 if [ -n "${PKG_VER}" ] && [[ "x${PKG_VER}" = "x${INST_VER}" ]]; then
53 # Do not include installed packages newer than the book ones
54 if [ -n "${PKG_VER}" ] && [[ "x${PKG_VER}" < "x${INST_VER}" ]]; then
57 # Set installed version for updated meta-packages
58 [ -n "${INST_VER}" ] && INST_STRING
="[installed ${INST_VER}]"
60 META_PKG
=$
(echo ${PKG_NAME} |
tr [a-z
] [A-Z
])
63 config CONFIG_$META_PKG
64 bool "$META_PKG $PKG_VER $INST_STRING"
67 menu "$(echo ${PKG_NAME} | tr [a-z] [A-Z]) components"
68 depends CONFIG_$META_PKG
75 # Include the dependency data for this meta package
79 PKG_VER
=$
(grep "^${PKG_NAME}[[:space:]]" $inFile | cut
-f3)
80 INST_VER
=$
(grep "^${PKG_NAME}[[:space:]]" $inFile | cut
-f4)
81 # Skip installed meta-package components
82 if [ -n "${PKG_VER}" ] && [[ "x${PKG_VER}" = "x${INST_VER}" ]]; then
85 # Do not include installed packages newer than the book ones
86 if [ -n "${PKG_VER}" ] && [[ "x${PKG_VER}" < "x${INST_VER}" ]]; then
89 # Set installed version for updated meta-packages components
90 [ -n "${INST_VER}" ] && INST_STRING
="[installed ${INST_VER}]"
93 config DEP_${META_PKG}_${PKG_NAME}
94 bool "$PKG_NAME ${PKG_VER} ${INST_STRING}"
100 done <.
/libs
/${PKG_NAME}.dep
101 echo -e "endmenu" >> $outFile
104 [[ "${SET_COMMENT}" = "y" ]] && echo "comment \"\"" >>$outFile; unset SET_COMMENT
106 # Deal with targets that are part of a meta-package but that are in the same
107 # directory that non meta-package targets
124 # Skip installed packages
125 if [ -n "${PKG_VER}" ] && [[ "x${PKG_VER}" = "x${INST_VER}" ]]; then
128 # Do not include installed packages newer than the book ones
129 if [ -n "${PKG_VER}" ] && [[ "x${PKG_VER}" < "x${INST_VER}" ]]; then
132 # Set installed version for updated packages
133 [ -n "${INST_VER}" ] && INST_STRING
="[installed ${INST_VER}]"
136 DIR_TREE
=(${PKG_DIR})
139 # Define a top level menu
140 if [ "$PREV_DIR1" != "${DIR_TREE[1]}" ]; then
141 [[ "${DIR_TREE[1]}" = "kde" ]] && continue
142 [[ "${DIR_TREE[1]}" = "gnome" ]] && continue
144 if [ $MENU_SET1 = "y" ]; then
145 # Close out any open secondary menu
146 if [ $MENU_SET2 = "y" ]; then
147 echo -e "\tendmenu" >> $outFile
148 # Reset 'menu open' flag
151 # Close the current top level menu
152 echo -e "endmenu\n" >> $outFile
154 # Open a new top level menu
155 echo -e "menu "$
(echo ${DIR_TREE[1]:0:1} |
tr [a-z
] [A-Z
])${DIR_TREE[1]:1}"" >> $outFile
159 # Define a secondary menu
160 if [ "$PREV_DIR2" != "${DIR_TREE[2]}" ]; then
161 # Close out the previous open menu structure
162 if [ $MENU_SET2 = "y" ]; then
163 echo -e "\tendmenu\n" >> $outFile
165 # Initialize a new 2nd level menu structure.
166 echo -e "\tmenu "$
(echo ${DIR_TREE[2]:0:1} |
tr [a-z
] [A-Z
])${DIR_TREE[2]:1}"" >> $outFile
171 config CONFIG_$PKG_NAME
172 bool "$PKG_NAME ${PKG_VER} ${INST_STRING}"
179 PREV_DIR1
=${DIR_TREE[1]}
180 PREV_DIR2
=${DIR_TREE[2]}
183 if [ $MENU_SET2 = "y" ]; then echo -e "\tendmenu" >> $outFile; fi
184 if [ $MENU_SET1 = "y" ]; then echo "endmenu" >> $outFile; fi
191 menu "Default packages for resolving dependencies"
194 prompt "Default print server"
202 default cups if PS_cups
203 default LPRng if PS_LPRng
216 default sendmail if MS_sendmail
217 default postfix if MS_postfix
218 default exim if MS_exim
221 prompt "Postscript package"
224 config GS_ghostscript
229 default espgs if GS_espgs
230 default ghostscript if GS_ghostscript
241 default heimdal if KER_heimdal
242 default mitkrb if KER_mitkrb
245 prompt "Window package"
253 default xorg7 if WIN_xorg7
254 default xfree86 if WIN_xfree86
258 prompt "Dependency level"
262 bool "Required dependencies only"
265 bool "Required and recommended dependencies"
268 bool "Required, recommended and optional dependencies"
273 default 1 if DEPLVL_1
274 default 2 if DEPLVL_2
275 default 3 if DEPLVL_3
282 Select if sudo will be used (you want build as a normal user)
283 otherwise sudo is not needed (you want build as root)