Chameleon

Chameleon Commit Details

Date:2011-10-11 16:48:16 (12 years 6 months ago)
Author:blackosx
Commit:1626
Parents: 1625
Message:Tidy up the built Distibution xml file to make it more readble. Add placeholder for preinstall script.
Changes:
A/branches/blackosx/package/Scripts/Main/preinstall
M/branches/blackosx/package/Resources/en.lproj/Localizable.strings
M/branches/blackosx/package/buildpkg.sh
M/branches/blackosx/package/Distribution

File differences

branches/blackosx/package/Distribution
3333
3434
3535
36
36
3737
3838
3939
function volCheckScript()
{
system.log('volCheckScript: Passed.');
system.log('volCheckScript: Failed.');
return true;
}
branches/blackosx/package/Scripts/Main/preinstall
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
#!/bin/bash
echo "==============================================="
echo "Pre-Install Script"
echo "*********************************"
echo "-----------------------------------------------"
echo ""
# Place holder for maybe setting up install log here?
echo "==============================================="
echo "END - Pre-Install Script"
echo "*********************************"
echo "-----------------------------------------------"
echo ""
exit 0
branches/blackosx/package/Resources/en.lproj/Localizable.strings
1111
1212
1313
14
14
1515
1616
1717
// ============================================================================
// Bootloader
// ----------------------------------------------------------------------------
"Chameleon_title" = "Bootloader";
"Chameleon_title" = "Chameleon Bootloader";
"Chameleon_description" = "Chameleon requires three essential files. (in simple terms)
boot0 (On the drive's MBR) responsible for loading boot1.
boot1 (On the partition's boot-sector) to finding boot2.
branches/blackosx/package/buildpkg.sh
5959
6060
6161
62
63
64
65
66
67
68
69
70
71
72
73
74
6275
6376
64
65
77
6678
6779
6880
......
7991
8092
8193
82
94
95
8396
8497
85
86
87
98
99
100
101
88102
89103
90104
......
116130
117131
118132
119
133
120134
121135
122136
......
131145
132146
133147
134
135
148
149
136150
137151
138152
......
174188
175189
176190
177
191
178192
179193
180194
......
183197
184198
185199
186
187200
188201
189202
190
191
203
204
192205
193206
194207
......
204217
205218
206219
207
208
220
221
209222
210223
211
224
212225
213226
214227
......
233246
234247
235248
236
249
237250
238251
239252
240253
241
242
254
255
243256
244257
245258
......
260273
261274
262275
263
276
264277
265278
266279
267280
268
281
269282
270283
271284
272285
273286
274
275
287
288
276289
277290
278291
......
289302
290303
291304
292
305
293306
294307
295308
296309
297310
311
298312
299313
300314
......
303317
304318
305319
306
320
307321
322
323
324
308325
309326
310
327
311328
312329
313330
......
460477
461478
462479
463
480
464481
465482
466
483
467484
468
469
485
486
487
470488
471489
472490
outline[$((outlinecount++))]="${indent[$xmlindent]}<choices-outline>"
# build pre install package
# This is run before any other package - so this could
# be a good place to initialise the install log???
echo "================= Preinstall ================="
((xmlindent++))
packagesidentity="org.chameleon"
mkdir -p ${1}/Pre/Root
mkdir -p ${1}/Pre/Scripts
cp -f ${pkgroot}/Scripts/Main/preinstall ${1}/Pre/Scripts
echo "[BUILD] Pre "
buildpackage "${1}/Pre" "/" "" "start_visible=\"false\" start_selected=\"true\"" >/dev/null 2>&1
# End build pre install package
# build core package
echo "================= Core ================="
((xmlindent++))
packagesidentity="org.chameleon.core"
packagesidentity="org.chameleon"
mkdir -p ${1}/Core/Root/usr/local/bin
mkdir -p ${1}/Core/Root/usr/standalone/i386
ditto --noextattr --noqtn ${1%/*}/i386/boot ${1}/Core/Root/usr/standalone/i386
local coresize=$( du -hkc "${1}/Core/Root" | tail -n1 | awk {'print $1'} )
echo "[BUILD] i386 "
buildpackage "${1}/Core" "/" "0" "start_visible=\"false\" start_selected=\"true\"" >/dev/null 2>&1
# End build core package
# build Chameleon package
echo "================= Chameleon ================="
outline[$((outlinecount++))]="${indent[$xmlindent]}\t<line choice=\"Chameleon\">"
choices[$((choicescount++))]="<choice\n\tid=\"Chameleon\"\n\ttitle=\"Chameleon_title\"\n\tdescription=\"Chameleon_description\"\n>\n</choice>\n"
outline[$((outlinecount++))]="${indent[$xmlindent]}<line choice=\"Chameleon\">"
choices[$((choicescount++))]="\t<choice\n\t\tid=\"Chameleon\"\n\t\ttitle=\"Chameleon_title\"\n\t\tdescription=\"Chameleon_description\">\n\t</choice>\n"
((xmlindent++))
# build standard package
mkdir -p ${1}/Standard/Root
mkdir -p ${1}/Standard/Scripts/Resources
# End build reset choice package
((xmlindent--))
outline[$((outlinecount++))]="${indent[$xmlindent]}\t</line>"
outline[$((outlinecount++))]="${indent[$xmlindent]}</line>"
# End build Chameleon package
# build Modules package
###############################
if [ "$(ls -A "${1%/*}/i386/modules")" ]; then
{
outline[$((outlinecount++))]="${indent[$xmlindent]}\t<line choice=\"Module\">"
choices[$((choicescount++))]="<choice\n\tid=\"Module\"\n\ttitle=\"Module_title\"\n\tdescription=\"Module_description\"\n>\n</choice>\n"
outline[$((outlinecount++))]="${indent[$xmlindent]}<line choice=\"Module\">"
choices[$((choicescount++))]="\t<choice\n\t\tid=\"Module\"\n\t\ttitle=\"Module_title\"\n\t\tdescription=\"Module_description\">\n\t</choice>\n"
((xmlindent++))
packagesidentity="org.chameleon.modules"
# -
fi
((xmlindent--))
outline[$((outlinecount++))]="${indent[$xmlindent]}\t</line>"
outline[$((outlinecount++))]="${indent[$xmlindent]}</line>"
}
else
{
fi
# End build Modules packages
# build Extras package
# build options packages
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"
outline[$((outlinecount++))]="${indent[$xmlindent]}<line choice=\"Options\">"
choices[$((choicescount++))]="\t<choice\n\t\tid=\"Options\"\n\t\ttitle=\"Options_title\"\n\t\tdescription=\"Options_description\">\n\t</choice>\n"
((xmlindent++))
# ------------------------------------------------------
builtOptionsList=$( echo ${OptionalSettingsFiles[$i]%.txt} )
builtOptionsList=$( echo ${builtOptionsList##*/} )
echo "================= $builtOptionsList ================="
outline[$((outlinecount++))]="${indent[$xmlindent]}\t<line choice=\"${builtOptionsList}\">"
choices[$((choicescount++))]="<choice\n\tid=\"${builtOptionsList}\"\n\ttitle=\"${builtOptionsList}_title\"\n\tdescription=\"${builtOptionsList}_description\"\n>\n</choice>\n"
outline[$((outlinecount++))]="${indent[$xmlindent]}<line choice=\"${builtOptionsList}\">"
choices[$((choicescount++))]="\t<choice\n\t\tid=\"${builtOptionsList}\"\n\t\ttitle=\"${builtOptionsList}_title\"\n\t\tdescription=\"${builtOptionsList}_description\">\n\t</choice>\n"
((xmlindent++))
packagesidentity="org.chameleon.options.$builtOptionsList"
# ------------------------------------------------------
# Read boot option file in to an array.
# ------------------------------------------------------
buildoptionalsettings "$1" "${exclusiveFlag}" "${exclusiveName}"
((xmlindent--))
outline[$((outlinecount++))]="${indent[$xmlindent]}\t</line>"
outline[$((outlinecount++))]="${indent[$xmlindent]}</line>"
done
# 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"
outline[$((outlinecount++))]="${indent[$xmlindent]}<line choice=\"KeyLayout\">"
choices[$((choicescount++))]="\t<choice\n\t\tid=\"KeyLayout\"\n\t\ttitle=\"KeyLayout_title\"\n\t\tdescription=\"KeyLayout_description\">\n\t</choice>\n"
((xmlindent++))
packagesidentity="org.chameleon.options.keylayout"
buildoptionalsettings "$1" "0" "keylayout"
((xmlindent--))
outline[$((outlinecount++))]="${indent[$xmlindent]}\t</line>"
outline[$((outlinecount++))]="${indent[$xmlindent]}</line>"
# End build KeyLayout options packages
((xmlindent--))
outline[$((outlinecount++))]="${indent[$xmlindent]}\t</line>"
outline[$((outlinecount++))]="${indent[$xmlindent]}</line>"
# End build options packages
# build theme packages
echo "================= Themes ================="
outline[$((outlinecount++))]="${indent[$xmlindent]}\t<line choice=\"Themes\">"
choices[$((choicescount++))]="<choice\n\tid=\"Themes\"\n\ttitle=\"Themes_title\"\n\tdescription=\"Themes_description\"\n>\n</choice>\n"
outline[$((outlinecount++))]="${indent[$xmlindent]}<line choice=\"Themes\">"
choices[$((choicescount++))]="\t<choice\n\t\tid=\"Themes\"\n\t\ttitle=\"Themes_title\"\n\t\tdescription=\"Themes_description\">\n\t</choice>\n"
((xmlindent++))
# Using themes section from Azi's/package branch.
done
((xmlindent--))
outline[$((outlinecount++))]="${indent[$xmlindent]}\t</line>"
outline[$((outlinecount++))]="${indent[$xmlindent]}</line>"
# End build theme packages
# End build Extras package
# build post install package
echo "================= Post ================="
packagesidentity="org.chameleon"
mkdir -p ${1}/Post/Root
mkdir -p ${1}/Post/Scripts
cp -f ${pkgroot}/Scripts/Main/Post/* ${1}/Post/Scripts
ditto --noextattr --noqtn ${1%/*/*}/version ${1}/Post/Scripts/Resources/version
echo "[BUILD] Post "
buildpackage "${1}/Post" "/" "" "start_visible=\"false\" start_selected=\"true\"" >/dev/null 2>&1
outline[$((outlinecount++))]="${indent[$xmlindent]}</choices-outline>"
# End build post install package
((xmlindent--))
outline[$((outlinecount++))]="${indent[$xmlindent]}</choices-outline>"
# build meta package
makedistribution "${1}" "${2}" "${3}" "${4}" "${5}"
makedistribution "${1}" "${2}" "${3}" "${4}" #"${5}"
# clean up
popd >/dev/null
outline[$((outlinecount++))]="${indent[$xmlindent]}\t<line choice=\"${packagename// /}\"/>"
outline[$((outlinecount++))]="${indent[$xmlindent]}<line choice=\"${packagename// /}\"/>"
if [ "${4}" ]; then
local choiceoptions="${indent[$xmlindent]}${4}\n"
local choiceoptions="\t\t${4}"
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"
#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"
choices[$((choicescount++))]="\t<choice\n\t\tid=\"${packagename// /}\"\n\t\ttitle=\"${packagename}_title\"\n\t\tdescription=\"${packagename}_description\"\n${choiceoptions}>\n\t\t<pkg-ref id=\"${identifier}\" installKBytes='${installedsize}' version='${version}.0.0.${timestamp}' >#${packagename// /}.pkg</pkg-ref>\n\t</choice>\n"
rm -R -f "${1}"
fi
}

Archive Download the corresponding diff file

Revision: 1626