Chameleon

Chameleon Commit Details

Date:2011-09-26 22:51:57 (12 years 7 months ago)
Author:blackosx
Commit:1580
Parents: 1579
Message:Attempted to enable 'exclusive' choices in auto generated boot options, but it's not working at present. I've added notes to remind me to look again at some point.
Changes:
M/branches/blackosx/package/buildpkg.sh

File differences

branches/blackosx/package/buildpkg.sh
9393
9494
9595
96
96
97
98
9799
98100
99101
......
226228
227229
228230
229
230231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
231279
232280
233281
ditto --noextattr --noqtn ${1%/*/*}/revision ${1}/Standard/Scripts/Resources/revision
ditto --noextattr --noqtn ${1%/*/*}/version ${1}/Standard/Scripts/Resources/version
echo "[BUILD] Standard "
buildpackage "${1}/Standard" "/" "${coresize}" "start_enabled=\"true\" start_selected=\"upgrade_allowed()\" selected=\"exclusive(choices['EFI']) && exclusive(choices['noboot'])\"" >/dev/null 2>&1
buildpackage "${1}/Standard" "/" "${coresize}" "start_enabled=\"true\" start_selected=\"upgrade_allowed()\" selected=\"exclusive(choices['EFI']) && exclusive(choices['noboot'])\"" >/dev/null 2>&1
# hh="selected=\"exclusive(choices['EFI']) && exclusive(choices['noboot'])\""
# buildpackage "${1}/Standard" "/" "${coresize}" "start_enabled=\"true\" start_selected=\"upgrade_allowed()\" ${hh}" >/dev/null 2>&1
# End build standard package
# build efi package
echo "" > "${1}/$optionName/Root/${keyValue}"
echo "[BUILD] ${optionName} "
buildpackage "${1}/${optionName}" "/$chamTemp/options" "" "start_selected=\"false\"" >/dev/null 2>&1
# ------------------------------------------------------
# Before calling buildpackage, see if any bootOptionFiles
# have requested being set to exclusive.
# Manually set for now to 'Resolutions'.
# It can eventually be non-specifc by adding a dedicated
# field at the top of each bootOptionFiles to indicate
# if the set should be exclusive or not.
# ------------------------------------------------------
# Note: This currently fails to achieve the desired effect?
# I'll improve the code etc. once (if) I can get it working!
# ------------------------------------------------------
if [ $builtOptionsFolderName = "Resolution" ]; then
# build a list of all resolutions but exclude current resolution.
arrayCount=0
while read textLineTemp
do
optionNameTemp=${textLineTemp%:*}
if [ $optionNameTemp != $optionName ]; then
resolutionArray[arrayCount]=$optionNameTemp
((arrayCount++))
fi
done < ${bootOptionFiles[$i]}
# Build exclusive string
stringStart="selected=\""
stringBefore="exclusive(choices['"
stringAfter="']) &amp;&amp; "
stringEnd="'])\""
x=${stringStart}${stringBefore}
totalItems="${#resolutionArray[@]}"
lastItem=$((totalItems-1))
for (( r = 0 ; r < ${#resolutionArray[@]} ; r++ ))
do
x="${x}${resolutionArray[r]}"
# Only add these to end of string up to the one before the last item
if [ $r -lt $lastItem ]; then
x="${x}${stringAfter}${stringBefore}"
fi
done
x="${x}${stringEnd}"
buildpackage "${1}/${optionName}" "/$chamTemp/options" "" "start_selected=\"false\"" ${x} >/dev/null 2>&1
else
buildpackage "${1}/${optionName}" "/$chamTemp/options" "" "start_selected=\"false\"" >/dev/null 2>&1
fi
done < ${bootOptionFiles[$i]}
((xmlindent--))

Archive Download the corresponding diff file

Revision: 1580