Chameleon

Chameleon Commit Details

Date:2011-09-26 08:49:20 (12 years 6 months ago)
Author:blackosx
Commit:1577
Parents: 1576
Message:Change keylayouts code to match current style for building org.chameleon.Boot.plist.
Changes:
D/branches/blackosx/package/Scripts/Keymaps
M/branches/blackosx/package/buildpkg.sh
M/branches/blackosx/package/TO DO.txt
M/branches/blackosx/package/Scripts/Post/postinstall

File differences

branches/blackosx/package/TO DO.txt
11
22
3
3
44
55
66
TO DO
* Fix - Keylayouts to match new style for building org.chameleon.boot.plist.
* Fix - Keylayouts to match new style for building org.chameleon.boot.plist. = DONE
* Check if boot options already exist before adding with plistbuddy.
* Check also kernel flags before adding with plistbuddy
* Add theme to org.chameleon.boot.plist? (Do what when more than one installed?)
branches/blackosx/package/Scripts/Post/postinstall
1
1
22
33
44
#!/bin/sh
#!/bin/bash
#
# $1: the full path to the installation package; for example:
# /Volumes/Projects/Testing/Simple_Carbon_App.pkg
branches/blackosx/package/buildpkg.sh
149149
150150
151151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173152
174153
175154
......
179158
180159
181160
161
162
163
164
165
166
167
168
169
170
182171
183172
184173
......
194183
195184
196185
197
186
198187
199188
200189
201190
202191
203
204
205
206
207
208
209
210
211
212
213
214
192
193
194
195
196
197
198
199
200
215201
216202
217
203
218204
219205
220206
......
223209
224210
225211
226
227
228
229
230
231
212
213
214
215
232216
233217
234218
235
219
236220
237221
238222
......
244228
245229
246230
247
248
249231
250232
251233
252234
253
254235
255236
256237
......
266247
267248
268249
269
270
271250
272251
273252
274
275
253
276254
277255
278256
......
303281
304282
305283
306
307
308
309284
310285
311286
......
323298
324299
325300
326
301
327302
328303
329304
......
364339
365340
366341
367
342
368343
369344
370345
......
401376
402377
403378
404
379
405380
406381
407382
}
fi
# -
if [ -e ${1%/*}/i386/modules/Keylayout.dylib ]; then
{
mkdir -p ${1}/Keylayout/Root/$chamTemp/Extra/{modules,Keymaps}
mkdir -p ${1}/Keylayout/Root/usr/bin
layout_src_dir="${1%/sym/*}/i386/modules/Keylayout/layouts/layouts-src"
if [ -d "$layout_src_dir" ];then
# Create a tar.gz from layout sources
(cd "$layout_src_dir"; \
tar czf "${1}/Keylayout/Root/$chamTemp/Extra/Keymaps/layouts-src.tar.gz" README *.slt)
fi
# Adding module
ditto --noextattr --noqtn ${1%/*}/i386/modules/Keylayout.dylib ${1}/Keylayout/Root/$chamTemp/Extra/modules
# Adding Keymaps
ditto --noextattr --noqtn ${1%/sym/*}/Keymaps ${1}/Keylayout/Root/$chamTemp/Extra/Keymaps
# Adding tools
ditto --noextattr --noqtn ${1%/*}/i386/cham-mklayout ${1}/Keylayout/Root/usr/bin
echo "[BUILD] Keylayout "
buildpackage "${1}/Keylayout" "/" "" "start_selected=\"true\"" >/dev/null 2>&1
}
fi
# -
if [ -e ${1%/*}/i386/modules/uClibcxx.dylib ]; then
{
mkdir -p ${1}/uClibc/Root
buildpackage "${1}/uClibc" "/$chamTemp/Extra/modules" "" "start_selected=\"true\"" >/dev/null 2>&1
}
fi
# -
if [ -e ${1%/*}/i386/modules/Keylayout.dylib ]; then
{
mkdir -p ${1}/Keylayout/Root
ditto --noextattr --noqtn ${1%/*}/i386/modules/Keylayout.dylib ${1}/Keylayout/Root
echo "[BUILD] Keylayout "
buildpackage "${1}/Keylayout" "/$chamTemp/Extra/modules" "" "start_selected=\"true\"" >/dev/null 2>&1
}
fi
((xmlindent--))
outline[$((outlinecount++))]="${indent[$xmlindent]}\t</line>"
}
# build Extras package
# build options packages
echo "================= Options ================="
echo "================= Options ================="
outline[$((outlinecount++))]="${indent[$xmlindent]}\t<line choice=\"Options\">"
choices[$((choicescount++))]="<choice\n\tid=\"Options\"\n\ttitle=\"Options_title\"\n\tdescription=\"Options_description\"\n>\n</choice>\n"
((xmlindent++))
# build base options packages
packagesidentity="org.chameleon.options"
options=($( find "${pkgroot}/Scripts/BaseOptions" -type d -depth 1 -not -name '.svn' ))
for (( i = 0 ; i < ${#options[@]} ; i++ ))
do
mkdir -p "${1}/${options[$i]##*/}/Root"
#mkdir -p "${1}/${options[$i]##*/}/Scripts"
#ditto --noextattr --noqtn "${options[$i]}/postinstall" "${1}/${options[$i]##*/}/Scripts/postinstall"
cp "${options[$i]}"/* "${1}/${options[$i]##*/}/Root"
echo "[BUILD] ${options[$i]##*/} "
buildpackage "${1}/${options[$i]##*/}" "/$chamTemp/options" "" "start_selected=\"false\"" >/dev/null 2>&1
done
packagesidentity="org.chameleon.options"
options=($( find "${pkgroot}/Scripts/BaseOptions" -type d -depth 1 -not -name '.svn' ))
for (( i = 0 ; i < ${#options[@]} ; i++ ))
do
mkdir -p "${1}/${options[$i]##*/}/Root"
cp "${options[$i]}"/* "${1}/${options[$i]##*/}/Root"
echo "[BUILD] ${options[$i]##*/} "
buildpackage "${1}/${options[$i]##*/}" "/$chamTemp/options" "" "start_selected=\"false\"" >/dev/null 2>&1
done
# End build base options packages
# build KeyLayout option packages
# build KeyLayout options packages
echo "================= Keymaps Options ================="
outline[$((outlinecount++))]="${indent[$xmlindent]}\t<line choice=\"KeyLayout\">"
choices[$((choicescount++))]="<choice\n\tid=\"KeyLayout\"\n\ttitle=\"KeyLayout_title\"\n\tdescription=\"KeyLayout_description\"\n>\n</choice>\n"
keymaps=($( find "${1%/sym/*}/Keymaps" -type f -depth 1 -name '*.lyt' | sed 's|.*/||;s|\.lyt||' ))
for (( i = 0 ; i < ${#keymaps[@]} ; i++ ))
do
mkdir -p "${1}/${keymaps[$i]}/Root/"
mkdir -p "${1}/${keymaps[$i]}/Scripts/"
sed "s/@@KEYMAP@@/${keymaps[$i]}/g" "${pkgroot}/Scripts/Keymaps/postinstall" > "${1}/${keymaps[$i]}/Scripts/postinstall" && \
chmod +rx "${1}/${keymaps[$i]}/Scripts/postinstall"
echo "[BUILD] ${keymaps[$i]} "
buildpackage "${1}/${keymaps[$i]}" "/" "" "start_selected=\"false\"" >/dev/null 2>&1
mkdir -p "${1}/${keymaps[$i]##*/}/Root/"
echo "dummy file" >"${1}/${keymaps[$i]##*/}/Root/KeyLayout=${keymaps[$i]##*/}"
echo "[BUILD] ${keymaps[$i]##*/} "
buildpackage "${1}/${keymaps[$i]##*/}" "/$chamTemp/options" "" "start_selected=\"false\"" >/dev/null 2>&1
done
((xmlindent--))
outline[$((outlinecount++))]="${indent[$xmlindent]}\t</line>"
# End build KeyLayout option packages
# End build base options packages
# build resolution packages
echo "================= Res. Options ================="
for (( i = 0 ; i < ${#resolutions[@]} ; i++ ))
do
mkdir -p "${1}/${resolutions[$i]##*/}/Root/"
#mkdir -p "${1}/${resolutions[$i]##*/}/Scripts/"
#ditto --noextattr --noqtn "${resolutions[$i]}/postinstall" "${1}/${resolutions[$i]##*/}/Scripts/postinstall"
cp "${resolutions[$i]}"/* "${1}/${resolutions[$i]##*/}/Root"
echo "[BUILD] ${resolutions[$i]##*/} "
buildpackage "${1}/${resolutions[$i]##*/}" "/$chamTemp/options" "" "start_selected=\"false\"" >/dev/null 2>&1
done
((xmlindent--))
outline[$((outlinecount++))]="${indent[$xmlindent]}\t</line>"
# End build resolution packages
for (( i = 0 ; i < ${#optionsadv[@]} ; i++ ))
do
mkdir -p "${1}/${optionsadv[$i]##*/}/Root"
#mkdir -p "${1}/${optionsadv[$i]##*/}/Scripts"
#ditto --noextattr --noqtn "${optionsadv[$i]}/postinstall" "${1}/${optionsadv[$i]##*/}/Scripts/postinstall"
cp "${optionsadv[$i]}"/* "${1}/${optionsadv[$i]##*/}/Root"
echo "[BUILD] ${optionsadv[$i]##*/} "
buildpackage "${1}/${optionsadv[$i]##*/}" "/$chamTemp/options" "" "start_selected=\"false\"" >/dev/null 2>&1
done
done
((xmlindent--))
outline[$((outlinecount++))]="${indent[$xmlindent]}\t</line>"
# End build Advanced packages
((xmlindent--))
outline[$((outlinecount++))]="${indent[$xmlindent]}\t</line>"
# End build theme packages
#((xmlindent--))
#outline[$((outlinecount++))]="${indent[$xmlindent]}\t</line>"
# End build Extras package
# build post install package
# clean up
#rm -R -f "${1}"
rm -R -f "${1}"
}
header+="auth=\"root\">\n"
header+="\t<payload installKBytes=\"${installedsize##* }\" numberOfFiles=\"${filecount##* }\"/>\n"
#rm -R -f "${1}/Temp"
rm -R -f "${1}/Temp"
[ -d "${1}/Temp" ] || mkdir -m 777 "${1}/Temp"
[ -d "${1}/Root" ] && mkbom "${1}/Root" "${1}/Temp/Bom"
fi
choices[$((choicescount++))]="<choice\n\tid=\"${packagename// /}\"\n\ttitle=\"${packagename}_title\"\n\tdescription=\"${packagename}_description\"\n${choiceoptions}>\n\t<pkg-ref id=\"${identifier}\" installKBytes='${installedsize}' version='${version}.0.0.${timestamp}' auth='root'>#${packagename// /}.pkg</pkg-ref>\n</choice>\n"
#rm -R -f "${1}"
rm -R -f "${1}"
fi
}

Archive Download the corresponding diff file

Revision: 1577