From 12762dfadae0a8f450bc8fc25ad31384d4c096ef Mon Sep 17 00:00:00 2001 From: "Jay Freeman (saurik)" Date: Sun, 21 Dec 2008 07:34:47 +0000 Subject: [PATCH] Gracefully handle someone /deleting/ the firmware package. --- Library/firmware.sh | 39 +++++++++++++++++---------------------- 1 file changed, 17 insertions(+), 22 deletions(-) diff --git a/Library/firmware.sh b/Library/firmware.sh index 3edf8d08..0ad61754 100755 --- a/Library/firmware.sh +++ b/Library/firmware.sh @@ -1,27 +1,21 @@ #!/bin/bash +set -e -# XXX: FIX THIS!! -architecture=iphoneos-arm version=$(sw_vers -productVersion) -if grep '^Package: firmware$' /var/lib/dpkg/status >/dev/null; then - cat /var/lib/dpkg/status | while IFS= read -r line; do - if [[ ${line} == 'Package: firmware' ]]; then - firmware= - elif [[ ${line} == '' ]]; then - unset firmware - elif [[ ${line} == Architecture:* && "${firmware+@}" ]]; then - echo "Architecture: ${architecture}" - continue - elif [[ ${line} == Version:* && "${firmware+@}" ]]; then - echo "Version: ${version}" - continue - fi - - echo "${line}" - done >/var/lib/dpkg/status_ -else - cat /var/lib/dpkg/status - >/var/lib/dpkg/status_ </var/lib/dpkg/status_ + +cat >>/var/lib/dpkg/status_ < -Architecture: ${architecture} +Architecture: iphoneos-arm Version: ${version} Description: almost impressive Apple frameworks Name: iPhone Firmware EOF -fi && mv -f /var/lib/dpkg/status{_,} + +mv -f /var/lib/dpkg/status{_,} echo "/." >/var/lib/dpkg/info/firmware.list -- 2.45.2