-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} == 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_ <<EOF
+cat /var/lib/dpkg/status | while IFS= read -r line; do
+ if [[ ${line} == 'Package: firmware' ]]; then
+ firmware=
+ elif [[ ${line} == '' ]]; then
+ unset firmware
+ elif [[ "${firmware+@}" ]]; then
+ continue
+ fi
+
+ echo "${line}"
+done >/var/lib/dpkg/status_
+
+cat >>/var/lib/dpkg/status_ <<EOF