diff options
Diffstat (limited to 'Library')
-rwxr-xr-x | Library/firmware.sh | 33 |
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 |