Chameleon

Chameleon Commit Details

Date:2011-10-17 18:31:01 (7 years 1 month ago)
Author:blackosx
Commit:1633
Parents: 1632
Message:Remove upgrade_allowed function from Distribution file as it's not used? Add code in buildpkg.sh to set exclusive 'None' option to default choice and re-instate exclusive options for Resolutions and Keylayouts. Discard temp Extra folder if not needed.
Changes:
M/branches/blackosx/package/buildpkg.sh
M/branches/blackosx/package/Scripts/Main/Post/postinstall
M/branches/blackosx/package/Distribution
M/branches/blackosx/package/Changes.txt
M/branches/blackosx/package/OptionalSettings/Resolution.txt

File differences

branches/blackosx/package/Distribution
2727
2828
2929
30
30
3131
3232
3333
......
3737
3838
3939
40
41
42
43
44
45
46
47
48
49
50
51
5240
5341
5442
my.result.type = 'Fatal';
return false;
}
system.log('installCheckScript: Passed.');
system.log('installCheckScript: Failed.');
return false;
}
return true;
}
function upgrade_allowed(){
var upgradable = true;
var upgradeAction = my.choice.packageUpgradeAction;
if((upgradeAction == "downgrade") || (upgradeAction == "mixed")){
my.choice.tooltip = system.localizedString('Newer_Package_Installed_message');
upgradable = false;
}
return upgradable;
}
function systemHasGPT(){
var obj = system.ioregistry.matchingName("EFI System Partition");
if (obj)
branches/blackosx/package/Changes.txt
1
2
13
24
35
- Set exclusive 'None' option to default choice.
- Add code to detect and make necessary changes to avoid possibility of a b1f:error or boot1:error should the user decide to install a secondary boot partition.
- Fix bug installing to /Volumes/EFI
branches/blackosx/package/OptionalSettings/Resolution.txt
2121
2222
2323
24
24
2525
2626
2727
# B) User can select only one of the options from the list.
# Set Exclusive=False for A, or Exclusive=True for B.
#
Exclusive=False
Exclusive=True
# ---------------------------------------------
# Note: There must be a carriage return at end of last line
# ---------------------------------------------
branches/blackosx/package/Scripts/Main/Post/postinstall
111111
112112
113113
114
114
115115
116116
117117
......
123123
124124
125125
126
126
127
128
129
130
131
132
133
134
135
136
137
138
127139
128140
129141
......
185197
186198
187199
188
200
189201
190202
191203
......
196208
197209
198210
199
211
200212
201213
202214
203215
204216
205217
206
218
207219
208220
209221
210222
211223
212224
213
225
214226
215227
216228
value="${options[$arrayCount]#*=}"
# escape any spaces
keyToUse=$( echo $keyRead | sed 's/ /\\ /g' )
if [ "${keyToUse}" != "DONT" ] && [ "${value}" != "USE" ]; then
if [ "${keyToUse}" != "DONT" ] && [ "${value}" != "ADD" ]; then
sudo /usr/libexec/plistbuddy -c "Add :${keyToUse} string ${value}" "$tempOCBP"
returnValue=$?
if [ ${returnValue} -ne 1 ]; then
fi
(( arrayCount++ ))
done < <(ls "${chamTemp}"/options )
# If exclusive options were used and the 'None' option was chosen,
# then a dummy file named DONT=ADD would be in /$chamTemp/Extra/options.
# If that was the only option then the above code would have made a
# temporary Extra folder with a default org.chameleon.Boot.plist
# In this case we don't need it and should discard it otherwise the folder
# will be copied to the users / directory when it's not wanted.
if [ ${arrayCount} == 1 ] && [ "${keyToUse}" == "DONT" ] && [ "${value}" == "ADD" ]; then
if [ -e "${chamTemp}"/Extra ] && [ ! -e "${chamTemp}"/Extra/Themes ] && [ ! -e "${chamTemp}"/Extra/Modules ]; then
rm -r -f "$chamTemp"/Extra
fi
fi
if [ $kernelFlagCount -gt 0 ]; then
# Add kernel flags
for (( i=0 ; i < $kernelFlagCount ; i++ ))
done
fi
else
echo "Removing /.ChameleonExists file"
#echo "Removing /.ChameleonExists file"
"$scriptDir"InstallLog.sh "${dest_vol}" "Cleanup 4"
rm "$dest_vol"/.ChameleonExists
fi
# delete the temporary Chameleon folder
if [ -e "$chamTemp" ]; then
echo "Removing $chamTemp directory"
#echo "Removing $chamTemp directory"
"$scriptDir"InstallLog.sh "${dest_vol}" "Cleanup 1"
rm -rf "$chamTemp"
fi
# Remove /.ChameleonEFI file
if [ -f "$dest_vol"/.ChameleonEFI ]; then
echo "Removing /.ChameleonEFI file"
#echo "Removing /.ChameleonEFI file"
"$scriptDir"InstallLog.sh "${dest_vol}" "Cleanup 2"
rm "$dest_vol"/.ChameleonEFI
fi
# Remove /.ChameleonLogFlag file
if [ -f "$dest_vol"/.ChameleonLogFlag ]; then
echo "Removing /.ChameleonLogFlag file"
#echo "Removing /.ChameleonLogFlag file"
"$scriptDir"InstallLog.sh "${dest_vol}" "Cleanup 3"
# we have to add the final install log messages before
branches/blackosx/package/buildpkg.sh
108108
109109
110110
111
111
112112
113113
114114
......
120120
121121
122122
123
123
124124
125125
126126
127127
128128
129
129
130130
131131
132132
......
270270
271271
272272
273
273
274274
275275
276276
......
412412
413413
414414
415
415
416
417
418
419
420
421
422
423
416424
417425
418426
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']) &amp;&amp; exclusive(choices['noboot'])\"" >/dev/null 2>&1
buildpackage "${1}/Standard" "/" "${coresize}" "start_enabled=\"true\" selected=\"exclusive(choices['EFI']) &amp;&amp; exclusive(choices['noboot'])\"" >/dev/null 2>&1
# End build standard package
# build efi package
ditto --noextattr --noqtn ${1%/*/*}/revision ${1}/EFI/Scripts/Resources/revision
ditto --noextattr --noqtn ${1%/*/*}/version ${1}/EFI/Scripts/Resources/version
echo "[BUILD] EFI "
buildpackage "${1}/EFI" "/" "${coresize}" "start_visible=\"systemHasGPT()\" start_selected=\"false\" selected=\"exclusive(choices['Standard']) &amp;&amp; exclusive(choices['noboot'])\"" >/dev/null 2>&1
buildpackage "${1}/EFI" "/" "${coresize}" "start_visible=\"systemHasGPT()\" selected=\"exclusive(choices['Standard']) &amp;&amp; exclusive(choices['noboot'])\"" >/dev/null 2>&1
# End build efi package
# build reset choice package
mkdir -p ${1}/noboot/Root
echo "[BUILD] Reset choice "
buildpackage "${1}/noboot" "/$chamTemp" "" "start_visible=\"true\" start_selected=\"false\" selected=\"exclusive(choices['Standard']) &amp;&amp; exclusive(choices['EFI'])\"" >/dev/null 2>&1
buildpackage "${1}/noboot" "/$chamTemp" "" "selected=\"exclusive(choices['Standard']) &amp;&amp; exclusive(choices['EFI'])\"" >/dev/null 2>&1
# End build reset choice package
((xmlindent--))
done
# to indicate exclusive option, call buildoptionalsettings with the 2nd parameter set to 1 .
buildoptionalsettings "$1" "0" "keylayout"
buildoptionalsettings "$1" "1" "keylayout"
((xmlindent--))
outline[$((outlinecount++))]="${indent[$xmlindent]}</line>"
fi
done
x="${x}${stringEnd}"
buildpackage "${1}/${optionName}" "/$chamTemp/options" "" "start_selected=\"false\" ${x}" >/dev/null 2>&1
# First exclusive option is the 'no choice' option, so let's make that selected by default.
if [ $c = 0 ]; then
initialChoice="true"
else
initialChoice="false"
fi
buildpackage "${1}/${optionName}" "/$chamTemp/options" "" "start_selected=\"${initialChoice}\" ${x}" >/dev/null 2>&1
else
buildpackage "${1}/${optionName}" "/$chamTemp/options" "" "start_selected=\"false\"" >/dev/null 2>&1
fi

Archive Download the corresponding diff file

Revision: 1633