]> git.saurik.com Git - cydia.git/blame - Library/firmware.sh
Checkpoint before UICaboodle reorganzation.
[cydia.git] / Library / firmware.sh
CommitLineData
1ca3a01a 1#!/bin/bash
a6147124 2set -e
1ca3a01a
JF
3
4version=$(sw_vers -productVersion)
5
ea173384
JF
6cat /var/lib/dpkg/status | {
7
8while IFS= read -r line; do
9 #echo "#${firmware+@}/${blank+@} ${line}" 1>&2
10
11 if [[ ${line} == '' && "${blank+@}" ]]; then
12 continue
13 else
14 unset blank
15 fi
16
a6147124
JF
17 if [[ ${line} == 'Package: firmware' ]]; then
18 firmware=
19 elif [[ ${line} == '' ]]; then
ea173384
JF
20 blank=
21 fi
22
23 if [[ "${firmware+@}" ]]; then
24 if [[ "${blank+@}" ]]; then
25 unset firmware
26 fi
a6147124
JF
27 continue
28 fi
29
ea173384 30 #echo "${firmware+@}/${blank+@} ${line}" 1>&2
a6147124 31 echo "${line}"
ea173384 32done
a6147124 33
ea173384
JF
34#echo "#${firmware+@}/${blank+@} EOF" 1>&2
35if ! [[ "${blank+@}" || "${firmware+@}" ]]; then
36 echo
37fi
38
39cat <<EOF
1ca3a01a
JF
40Package: firmware
41Essential: yes
42Status: install ok installed
43Priority: required
44Section: System
45Installed-Size: 0
46Maintainer: Jay Freeman (saurik) <saurik@saurik.com>
a6147124 47Architecture: iphoneos-arm
1ca3a01a
JF
48Version: ${version}
49Description: almost impressive Apple frameworks
b88731cd 50Name: iPhone Firmware
1ca3a01a
JF
51
52EOF
a6147124 53
ea173384
JF
54} >/var/lib/dpkg/status_
55
a6147124 56mv -f /var/lib/dpkg/status{_,}
1ca3a01a 57
fda0e863
JF
58echo "/." >/var/lib/dpkg/info/firmware.list
59
1ca3a01a
JF
60if [[ ${version} = 1.0* || ${version} = 1.1.[012] ]]; then
61 user=root
62else
63 user=mobile
64fi
65
66if [[ ! -h /User && -d /User ]]; then
67 cp -afT /User /var/"${user}"
68fi && rm -rf /User && ln -s "/var/${user}" /User