Chameleon

Chameleon Commit Details

Date:2011-09-25 01:46:51 (8 years 1 month ago)
Author:JrCs
Commit:1570
Parents: 1569
Message:Revert the renaming of postinstall script (r1551) The postinstall.in file in Keymaps directory is not a "true" script: it's a template. This is why it's suffix is `.in'.
Changes:
R/trunk/package/Scripts/Keymaps/postinstall → /trunk/package/Scripts/Keymaps/postinstall.in
M/trunk/package/buildpkg.sh

File differences

trunk/package/Scripts/Keymaps/postinstall
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
#!/usr/bin/python
# Script to add KeyLayout for Chameleon boot loaders
import sys
import os
import shutil
vol = str(sys.argv[3])
boot = "/Extra/org.chameleon.Boot.plist"
plist = vol + boot
if not os.path.exists(plist):
shutil.copy('/Library/Preferences/SystemConfiguration/com.apple.Boot.plist', plist)
infile = open(plist, "r")
# check if Graphics_Mode has been written or not
KeyLayoutCheck = False
body = ""
for line in infile:
# if we finish the tags and haven't written KeyLayout Yet
if "</dict>" in line and KeyLayoutCheck == False:
line = " <key>KeyLayout</key>\n"
line += " <string>@@KEYMAP@@</string>\n"
line += "</dict>\n"
KeyLayoutCheck = True
body += line
infile.close()
outfile = open(plist, "w")
outfile.write(body)
outfile.close()
trunk/package/Scripts/Keymaps/postinstall.in
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
#!/usr/bin/python
# Script to add KeyLayout for Chameleon boot loaders
import sys
import os
import shutil
vol = str(sys.argv[3])
boot = "/Extra/org.chameleon.Boot.plist"
plist = vol + boot
if not os.path.exists(plist):
shutil.copy('/Library/Preferences/SystemConfiguration/com.apple.Boot.plist', plist)
infile = open(plist, "r")
# check if Graphics_Mode has been written or not
KeyLayoutCheck = False
body = ""
for line in infile:
# if we finish the tags and haven't written KeyLayout Yet
if "</dict>" in line and KeyLayoutCheck == False:
line = " <key>KeyLayout</key>\n"
line += " <string>@@KEYMAP@@</string>\n"
line += "</dict>\n"
KeyLayoutCheck = True
body += line
infile.close()
outfile = open(plist, "w")
outfile.write(body)
outfile.close()
trunk/package/buildpkg.sh
258258
259259
260260
261
261
262262
263263
264264
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" && \
sed "s/@@KEYMAP@@/${keymaps[$i]}/g" "${pkgroot}/Scripts/Keymaps/postinstall.in" > "${1}/${keymaps[$i]}/Scripts/postinstall" && \
chmod +rx "${1}/${keymaps[$i]}/Scripts/postinstall"
echo "[BUILD] ${keymaps[$i]} "
buildpackage "${1}/${keymaps[$i]}" "/tmpcham" "" "start_selected=\"false\"" >/dev/null 2>&1

Archive Download the corresponding diff file

Revision: 1570