Chameleon

Chameleon Commit Details

Date:2011-12-13 00:02:32 (12 years 4 months ago)
Author:blackosx
Commit:1729
Parents: 1728
Message:Commit some changes I made earlier for better keylayout/keymap installation from the installer package. I will finish this off soon.
Changes:
M/branches/blackosx/package/Resources/en.lproj/Localizable.strings
M/branches/blackosx/package/buildpkg.sh
M/branches/blackosx/package/Scripts/Main/postinstall

File differences

branches/blackosx/package/Scripts/Main/postinstall
4343
4444
4545
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
6646
6747
6848
......
8767
8868
8969
70
9071
9172
9273
......
11091
11192
11293
94
95
96
97
11398
11499
115100
......
117102
118103
119104
105
106
107
108
109
110
111
112
113
114
115
116
117
120118
121119
122120
......
141139
142140
143141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
144172
145173
146174
if [ ! -f "$dest_vol"/.ChameleonExists ]; then
# ---------------------------------------------
# Add any installed modules to the Install Log
# ---------------------------------------------
if [ -e "${chamTemp}"/Extra/modules ]; then
ls "${chamTemp}"/Extra/modules | while read FILE
do
"$scriptDir"InstallLog.sh "${dest_vol}" "Added module: $FILE"
done
fi
# ---------------------------------------------
# Add any installed themes to the Install Log
# ---------------------------------------------
if [ -e "${chamTemp}"/Extra/Themes ]; then
ls "${chamTemp}"/Extra/Themes | while read FILE
do
"$scriptDir"InstallLog.sh "${dest_vol}" "Added Theme: $FILE"
done
fi
# ---------------------------------------------
# Build org.chameleon.Boot.plist
# ---------------------------------------------
# All options selected are now dummy files with
# Read list of all boot options the user added.
arrayCount=0
kernelFlagCount=0
keyLayoutOption=0
while read FILE
do
options[arrayCount]="${FILE##*/}"
returnValue=$?
if [ ${returnValue} -ne 1 ]; then
"$scriptDir"InstallLog.sh "${dest_vol}" "Added boot option: ${keyRead}=${value}"
# Check for KeyLayout option. If used then remember.
if [ "${keyToUse}" == "KeyLayout" ]; then
keyLayoutOption=1
fi
else
"$scriptDir"InstallLog.sh "${dest_vol}" "Can't add ${keyRead}=${value} as an option already exists for: ${keyRead}"
fi
fi
(( arrayCount++ ))
done < <(ls "${chamTemp}"/options )
# Check to see if the user added a KeyLayout or not. If they didn't then we
# need to delete the Keylayout module and Keymaps that were automatically
# 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
fi
# If exclusive options were used and the 'None' option was chosen,
# then a dummy file named DONT=ADD would be in /$chamTemp/Extra/options.
fi
# ---------------------------------------------
# Add any installed modules to the Install Log
# ---------------------------------------------
if [ -e "${chamTemp}"/Extra/modules ]; then
ls "${chamTemp}"/Extra/modules | while read FILE
do
"$scriptDir"InstallLog.sh "${dest_vol}" "Added module: $FILE"
done
fi
# ---------------------------------------------
# Add any installed keymaps to the Install Log
# ---------------------------------------------
if [ -e "${chamTemp}"/Extra/Keymaps ]; then
ls "${chamTemp}"/Extra/Keymaps | while read FILE
do
"$scriptDir"InstallLog.sh "${dest_vol}" "Added Keymaps: $FILE"
done
fi
# ---------------------------------------------
# Add any installed themes to the Install Log
# ---------------------------------------------
if [ -e "${chamTemp}"/Extra/Themes ]; then
ls "${chamTemp}"/Extra/Themes | while read FILE
do
"$scriptDir"InstallLog.sh "${dest_vol}" "Added Theme: $FILE"
done
fi
# ---------------------------------------------
# Merge /Extra folders?
# ---------------------------------------------
# Does the user want to upgrade an existing /Extra folder?
branches/blackosx/package/Resources/en.lproj/Localizable.strings
325325
326326
327327
328
328
329329
330330
331331
// KeyLayout
"KeyLayout_title" = "KeyLayout";
"KeyLayout_description" = "Set one keylayout to use, or select 'None' if you don't want to select a keylayout.";
"KeyLayout_description" = "Set one keylayout to use, or select 'None' if you don't want to select a keylayout. This option will also install the Keylayout module and Keymaps.";
// Themes
"Themes_title" = "Themes";
branches/blackosx/package/buildpkg.sh
212212
213213
214214
215
215
216
217
218
219
216220
217221
218222
# Adding tools
ditto --noextattr --noqtn ${1%/*}/i386/cham-mklayout ${1}/Keylayout/Root/usr/local/bin
echo "[BUILD] Keylayout "
buildpackage "${1}/Keylayout" "/" "" "start_selected=\"true\"" >/dev/null 2>&1
# We will build this package so it's selected and hidden. This will be installed
# automatically to the temporary /Extra folder without giving the user an option.
# Then, in Scripts/Main/postinstall we will check to see if the user selected a
# keymap - if they did then we'll copy these files otherwise we'll ignore them.
buildpackage "${1}/Keylayout" "/$chamTemp" "" "start_visible=\"false\"" "start_selected=\"true\"" >/dev/null 2>&1
}
fi

Archive Download the corresponding diff file

Revision: 1729