]> git.saurik.com Git - cydia.git/blame - Library/firmware.sh
Fixed a bug in Homepage:/Website: and worked around a bug in 3.0 icon caches.
[cydia.git] / Library / firmware.sh
CommitLineData
de0dbbab 1#!/bin/bash
12762dfa 2set -e
de0dbbab
JF
3
4version=$(sw_vers -productVersion)
5
4825688a
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
12762dfa
JF
17 if [[ ${line} == 'Package: firmware' ]]; then
18 firmware=
19 elif [[ ${line} == '' ]]; then
4825688a
JF
20 blank=
21 fi
22
23 if [[ "${firmware+@}" ]]; then
24 if [[ "${blank+@}" ]]; then
25 unset firmware
26 fi
12762dfa
JF
27 continue
28 fi
29
4825688a 30 #echo "${firmware+@}/${blank+@} ${line}" 1>&2
12762dfa 31 echo "${line}"
4825688a 32done
12762dfa 33
4825688a
JF
34#echo "#${firmware+@}/${blank+@} EOF" 1>&2
35if ! [[ "${blank+@}" || "${firmware+@}" ]]; then
36 echo
37fi
38
39cat <<EOF
de0dbbab
JF
40Package: firmware
41Essential: yes
42Status: install ok installed
43Priority: required
44Section: System
45Installed-Size: 0
46Maintainer: Jay Freeman (saurik) <saurik@saurik.com>
12762dfa 47Architecture: iphoneos-arm
de0dbbab
JF
48Version: ${version}
49Description: almost impressive Apple frameworks
7e8e5d66 50Name: iPhone Firmware
de0dbbab
JF
51
52EOF
12762dfa 53
4825688a
JF
54} >/var/lib/dpkg/status_
55
12762dfa 56mv -f /var/lib/dpkg/status{_,}
de0dbbab 57
fa22c13d
JF
58echo "/." >/var/lib/dpkg/info/firmware.list
59
de0dbbab
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