summaryrefslogtreecommitdiff
path: root/Library/firmware.sh
diff options
context:
space:
mode:
authorJay Freeman (saurik) <saurik@saurik.com>2009-06-22 11:35:37 +0000
committerJay Freeman (saurik) <saurik@saurik.com>2010-09-30 07:13:57 +0000
commitea173384eb3f0b9652fba63f188a0599f8842c7b (patch)
treed11b62876c1e69e947ae95438bca7bd7fda04707 /Library/firmware.sh
parent185f1f6fb02a64bbadb68cfe47c23a063a644f9b (diff)
Drastic performance and stability increases.
Diffstat (limited to 'Library/firmware.sh')
-rwxr-xr-xLibrary/firmware.sh33
1 files changed, 28 insertions, 5 deletions
diff --git a/Library/firmware.sh b/Library/firmware.sh
index 0ad6175..e91eef3 100755
--- a/Library/firmware.sh
+++ b/Library/firmware.sh
@@ -3,19 +3,40 @@ set -e
version=$(sw_vers -productVersion)
-cat /var/lib/dpkg/status | while IFS= read -r line; do
+cat /var/lib/dpkg/status | {
+
+while IFS= read -r line; do
+ #echo "#${firmware+@}/${blank+@} ${line}" 1>&2
+
+ if [[ ${line} == '' && "${blank+@}" ]]; then
+ continue
+ else
+ unset blank
+ fi
+
if [[ ${line} == 'Package: firmware' ]]; then
firmware=
elif [[ ${line} == '' ]]; then
- unset firmware
- elif [[ "${firmware+@}" ]]; then
+ blank=
+ fi
+
+ if [[ "${firmware+@}" ]]; then
+ if [[ "${blank+@}" ]]; then
+ unset firmware
+ fi
continue
fi
+ #echo "${firmware+@}/${blank+@} ${line}" 1>&2
echo "${line}"
-done >/var/lib/dpkg/status_
+done
-cat >>/var/lib/dpkg/status_ <<EOF
+#echo "#${firmware+@}/${blank+@} EOF" 1>&2
+if ! [[ "${blank+@}" || "${firmware+@}" ]]; then
+ echo
+fi
+
+cat <<EOF
Package: firmware
Essential: yes
Status: install ok installed
@@ -30,6 +51,8 @@ Name: iPhone Firmware
EOF
+} >/var/lib/dpkg/status_
+
mv -f /var/lib/dpkg/status{_,}
echo "/." >/var/lib/dpkg/info/firmware.list