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