PKGS-7392: filter only lines starting with a number when checking apt-check

This commit is contained in:
Michael Boelen 2024-05-16 11:13:25 +00:00
parent 14f0d563ed
commit f8e2da3087
No known key found for this signature in database
GPG Key ID: 26141F77A09D7F04
1 changed files with 3 additions and 1 deletions

View File

@ -1161,7 +1161,9 @@ EOF
LogText "Result: found ${ROOTDIR}usr/lib/update-notifier/apt-check"
LogText "Test: checking if any of the updates contain security updates"
# apt-check binary is a script and translated. Do not search for normal text strings, but use numbered output only
FIND=$(${ROOTDIR}usr/lib/update-notifier/apt-check 2>&1 | ${AWKBINARY} -F\; '{ print $2 }')
# We search for the lines that start with a number, as on Ubuntu 24.04 an error can happen:
# Warning: W:Unable to read /var/lib/ubuntu-advantage/apt-esm/etc/apt/apt.conf.d/ - DirectoryExists (2: No such file or directory)
FIND=$(${ROOTDIR}usr/lib/update-notifier/apt-check 2>&1 | ${GREPBINARY} '^[0-9]' | ${AWKBINARY} -F\; '{ print $2 }')
# Check if we get the proper line back and amount of security patches available
if [ -z "${FIND}" ]; then
LogText "Result: did not find security updates line"