]> git.saurik.com Git - cydia.git/blame_incremental - Library/firmware.sh
Further factorization, file content list, checkbox clarication, advanced search tease...
[cydia.git] / Library / firmware.sh
... / ...
CommitLineData
1#!/bin/bash
2
3version=$(sw_vers -productVersion)
4
5if grep '^Package: firmware$' /var/lib/dpkg/status >/dev/null; then
6 cat /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 [[ ${line} == Version:* && "${firmware+@}" ]]; then
12 echo "Version: ${version}"
13 continue
14 fi
15
16 echo "${line}"
17 done >/var/lib/dpkg/status_
18else
19 cat /var/lib/dpkg/status - >/var/lib/dpkg/status_ <<EOF
20Package: firmware
21Essential: yes
22Status: install ok installed
23Priority: required
24Section: System
25Installed-Size: 0
26Maintainer: Jay Freeman (saurik) <saurik@saurik.com>
27Architecture: darwin-arm
28Version: ${version}
29Description: almost impressive Apple frameworks
30Name: iPhone Firmware
31
32EOF
33fi && mv -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