From ea173384eb3f0b9652fba63f188a0599f8842c7b Mon Sep 17 00:00:00 2001 From: "Jay Freeman (saurik)" Date: Mon, 22 Jun 2009 11:35:37 +0000 Subject: Drastic performance and stability increases. --- Library/firmware.sh | 33 ++++++++++++++++++++++++++++----- 1 file changed, 28 insertions(+), 5 deletions(-) (limited to 'Library') 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_ <&2 +if ! [[ "${blank+@}" || "${firmware+@}" ]]; then + echo +fi + +cat </var/lib/dpkg/status_ + mv -f /var/lib/dpkg/status{_,} echo "/." >/var/lib/dpkg/info/firmware.list -- cgit v1.2.3