Chameleon

Chameleon Commit Details

Date:2011-12-13 20:09:41 (7 years 11 months ago)
Author:blackosx
Commit:1730
Parents: 1729
Message:Apply code review changes to the postinstall script. Thanks JrCs.
Changes:
M/branches/blackosx/package/Scripts/Main/postinstall

File differences

branches/blackosx/package/Scripts/Main/postinstall
1010
1111
1212
13
13
1414
1515
1616
......
5757
5858
5959
60
61
6260
6361
6462
......
108106
109107
110108
111
112
113
114
115
116
109
110
117111
118112
119113
......
123117
124118
125119
126
127
128
120
129121
130122
131123
......
139131
140132
141133
134
135
136
137
138
142139
143140
144
141
145142
146143
147144
......
151148
152149
153150
154
151
155152
156153
157154
......
161158
162159
163160
164
161
165162
166163
167164
......
183180
184181
185182
186
183
187184
188185
189186
190187
191
188
192189
193190
194191
......
250247
251248
252249
253
250
254251
255252
256253
......
260257
261258
262259
263
260
264261
265262
266263
......
269266
270267
271268
272
269
273270
274271
275272
276273
277
274
278275
279276
280277
......
311308
312309
313310
314
311
315312
316313
317314
#echo "DEBUG: $ 4 = Root directory for the system: " $4
# Check target exists
if [ ! -e "$3" ]
if [ ! -d "$3" ]
then
echo "$3 volume does not exist!"
exit 1
if [ ! -d "$chamTemp"/Extra ]; then
mkdir "$chamTemp"/Extra
fi
tempOCBP="$chamTemp"/Extra/org.chameleon.Boot.plist
# Create template for org.chameleon.Boot.plist"
tempOCBP="$chamTemp"/Extra/org.chameleon.Boot.plist
# installed to the temporary /Extra folder (controlled by the call to
# buildpackage for keylayouts in buildpkg.sh).
if [ $keyLayoutOption == 0 ]; then
rm -r "$chamTemp"/Extra/Keymaps/
rm -r "$chamTemp"/Extra/modules/Keylayout.dylib
# Check for empty modules folder - if found then delete it.
if [ ! "$(ls -A $chamTemp/Extra/modules/)" ]; then
rmdir "$chamTemp"/Extra/modules
fi
rm -rf "$chamTemp"/Extra/Keymaps/
rm -f "$chamTemp"/Extra/modules/Keylayout.dylib
fi
# If exclusive options were used and the 'None' option was chosen,
# 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
rm -f "$chamTemp"/Extra/*.Boot.plist
fi
if [ $kernelFlagCount -gt 0 ]; then
fi
# ---------------------------------------------
# Remove empty directories
# ---------------------------------------------
find "${chamTemp}" -type d -depth -print0 | xargs -0 rmdir 2>/dev/null
# ---------------------------------------------
# Add any installed modules to the Install Log
# ---------------------------------------------
if [ -e "${chamTemp}"/Extra/modules ]; then
if [ -d "${chamTemp}"/Extra/modules ]; then
ls "${chamTemp}"/Extra/modules | while read FILE
do
"$scriptDir"InstallLog.sh "${dest_vol}" "Added module: $FILE"
# ---------------------------------------------
# Add any installed keymaps to the Install Log
# ---------------------------------------------
if [ -e "${chamTemp}"/Extra/Keymaps ]; then
if [ -d "${chamTemp}"/Extra/Keymaps ]; then
ls "${chamTemp}"/Extra/Keymaps | while read FILE
do
"$scriptDir"InstallLog.sh "${dest_vol}" "Added Keymaps: $FILE"
# ---------------------------------------------
# Add any installed themes to the Install Log
# ---------------------------------------------
if [ -e "${chamTemp}"/Extra/Themes ]; then
if [ -d "${chamTemp}"/Extra/Themes ]; then
ls "${chamTemp}"/Extra/Themes | while read FILE
do
"$scriptDir"InstallLog.sh "${dest_vol}" "Added Theme: $FILE"
# Check for an existing /Extra folder
# and merge existing /Extra with temp one.
if [ -e "$dest_vol"/.ChameleonEFI ]; then
if [ -e "/Volumes/EFI/Extra" ]; then
if [ -d "/Volumes/EFI/Extra" ]; then
"$scriptDir"InstallLog.sh "${dest_vol}" "Merging existing /Volumes/EFI/Extra folder."
ditto --noextattr --noqtn /Volumes/EFI/Extra "$chamTemp"/Extra
fi
else
if [ -e "$dest_vol/Extra" ]; then
if [ -d "$dest_vol/Extra" ]; then
"$scriptDir"InstallLog.sh "${dest_vol}" "Merging existing ${dest_vol}/Extra folder."
ditto --noextattr --noqtn "${dest_vol}"/Extra "$chamTemp"/Extra
fi
# The Standard install option chosen
# Does an /Extra folder already exist?
if [ -e "$dest_vol"/Extra ]; then
if [ -d "$dest_vol"/Extra ]; then
"$scriptDir"InstallLog.sh "${dest_vol}" "Moving $dest_vol/Extra folder to $dest_vol/Extra-OLD-$( date "+%H-%M-%S" )"
mv "$dest_vol/Extra" "$dest_vol/Extra_OLD-"$( date "+%H-%M-%S" )
fi
else
# The EFI system partition install option was chosen
# Does a /Volumes/Extra folder already exist?
if [ -e "/Volumes/EFI/Extra" ]; then
if [ -d "/Volumes/EFI/Extra" ]; then
"$scriptDir"InstallLog.sh "${dest_vol}" "Moving /Volumes/EFI/Extra folder to /Volumes/EFI/Extra-OLD-$( date "+%H-%M-%S" )"
mv "/Volumes/EFI/Extra" "/Volumes/EFI/Extra_OLD-"$( date "+%H-%M-%S" )
fi
fi
else
if [ ! -f "$dest_vol"/.ChameleonEFI ]; then
if [ -e "$dest_vol"/Extra ]; then
if [ -d "$dest_vol"/Extra ]; then
"$scriptDir"InstallLog.sh "${dest_vol}" "No elements selected for adding to an Extra folder,
so leaving existing $dest_vol/Extra folder untouched."
fi
else
if [ -e "/Volumes/EFI/Extra" ]; then
if [ -d "/Volumes/EFI/Extra" ]; then
"$scriptDir"InstallLog.sh "${dest_vol}" "No elements selected for adding to an Extra folder,
so leaving existing /Volumes/EFI/Extra folder untouched."
fi
fi
# delete the temporary Chameleon folder
if [ -e "$chamTemp" ]; then
if [ -d "$chamTemp" ]; then
cleanUp="${cleanUp},2"
rm -rf "$chamTemp"
fi

Archive Download the corresponding diff file

Revision: 1730