File: create_japanesemacfonts.sh

package info (click to toggle)
scummvm 2.9.1%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 450,580 kB
  • sloc: cpp: 4,299,825; asm: 28,322; python: 12,901; sh: 11,302; java: 9,289; xml: 7,895; perl: 2,639; ansic: 2,465; yacc: 1,670; javascript: 1,020; makefile: 933; lex: 578; awk: 275; objc: 82; sed: 11; php: 1
file content (106 lines) | stat: -rwxr-xr-x 1,978 bytes parent folder | download | duplicates (3)
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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
#!/bin/bash
#
# This script downloads Mac OS X Lion installer from Apple and extracts fonts

echo_n() {
	printf "$@"
}

echo "Downloading InstallMacOSX.dmg..."
if test ! -f InstallMacOSX.dmg; then
	curl https://updates.cdn-apple.com/2021/macos/041-7683-20210614-E610947E-C7CE-46EB-8860-D26D71F0D3EA/InstallMacOSX.dmg -o InstallMacOSX.dmg
fi

if test ! -f InstallMacOSX.dmg; then
	echo "Cannot download InstallMacOSX.dmg"
	exit
fi

echo "...Done"

echo_n "Extracting InstallMacOSX.pkg..."

7z e InstallMacOSX.dmg "Install Mac OS X/InstallMacOSX.pkg"
rm InstallMacOSX.dmg

if test ! -f "InstallMacOSX.pkg"; then
	echo "Failed to extract InstallMacOSX.pkg"
	exit
fi

echo done

echo_n "Extracting InstallESD.dmg..."

python xar-unpacker.py unpack InstallMacOSX.pkg InstallMacOSX.pkg/InstallESD.dmg InstallESD.dmg
rm InstallMacOSX.pkg

if test ! -f "InstallESD.dmg"; then
	echo "Failed to unpack InstallESD.dmg"
	exit
fi

echo done

echo_n "Extracting Essentials.pkg..."

7z e InstallESD.dmg "Mac OS X Install ESD/Packages/Essentials.pkg"
rm InstallESD.dmg

if test ! -f "Essentials.pkg"; then
	echo "Failed to extract Essentials.pkg;"
	exit
fi

echo done

echo_n "Extracting Payload..."

python xar-unpacker.py unpack Essentials.pkg Payload Payload.cpio.gz
rm Essentials.pkg

if test ! -f "Payload.cpio.gz"; then
	echo "Failed to extract Payload.cpio.gz;"
	exit
fi

echo done

echo_n "Decompressing Payload..."

7z e Payload.cpio.gz
rm Payload.cpio.gz

if test ! -f "Payload.cpio"; then
	echo "Failed to extract Payload.cpio;"
	exit
fi

echo done

echo_n "Extracting fonts..."

7z e Payload.cpio "./Library/Fonts/Osaka*.ttf"
rm Payload.cpio

if test ! -f Osaka.ttf; then
	echo "Failed to extract Osaka.ttf;"
	exit
fi

if test ! -f OsakaMono.ttf; then
	echo "Failed to extract OsakaMono.ttf;"
	exit
fi

echo done

zip -9 japanesemacfonts *.ttf
mv japanesemacfonts.zip japanesemacfonts.dat

echo_n "Cleaning up..."
rm Osaka.ttf
rm OsakaMono.ttf
echo done

ls -l japanesemacfonts.dat