-if ! [ -r "$target/${PACKAGE_LIST}" ] ; then
- echo "No $target/${PACKAGE_LIST} found, will not run package validation check."
+if ! [ -e "${LOGDIR}"/software.log ] ; then
+ echo "Warning: no ${LOGDIR}/software.log found (build/update run?), skipping check for unknown packages."
+else
+ 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."