+ if grep -q 'These unknown packages' "${LOGDIR}"/software.log ; then
+ echo "Identified unknown packages in ${LOGDIR}/software.log"
+ grep 'These unknown packages' "${LOGDIR}"/software.log | \
+ sed 's/.*These unknown packages.*: //; s/ / not_installable\n/g' >> "${LOGDIR}/package_errors.log"
+ fi
+fi
+
+PACKAGE_LIST=/var/log/install_packages.list
+# shellcheck disable=SC2154
+if ! [ -r "${target}/${PACKAGE_LIST}" ] ; then
+ echo "No ${target}/${PACKAGE_LIST} found, will not run package validation check."
+else
+ echo "Validating package list against dpkg state..."