diff --git a/files/bash/available_updates_rh.sh b/files/bash/available_updates_rh.sh index 97a46b0..df3ab7c 100755 --- a/files/bash/available_updates_rh.sh +++ b/files/bash/available_updates_rh.sh @@ -6,7 +6,13 @@ # Security: kernel-3.14.2-200.fc20.x86_64 is the currently running version # --- # We need to filter those out as they screw up the package listing -PKGS=$(yum -q check-update 2>/dev/null | egrep -v "is broken|^Security:|^Loaded plugins" | awk '/^[[:alnum:]]/ {print $0}' | sort) +# +# Also the PhotonOS version of tdnf generates lines by printing spaces, the +# repository, a carriage return, (less) spaces, the version, a carriage return, +# the package name and a line feed. The human output is unchanged but this +# confuse the rest of the tooling, so "fix" the output to have the expected +# format. +PKGS=$(yum -q check-update 2>/dev/null | egrep -v "is broken|^Security:|^Loaded plugins" | awk '{ split($0, r, "\x0d"); res = r[1]; for (f in r) { keep = substr(res, 1 + length(r[f])); res = r[f] keep }; print res }' | grep -e '^[[:alnum:]]' | sort) cat <&1) diff --git a/tasks/cache_update_linux.sh b/tasks/cache_update_linux.sh index b087ceb..0f1b839 100644 --- a/tasks/cache_update_linux.sh +++ b/tasks/cache_update_linux.sh @@ -11,7 +11,7 @@ source "${PT__installdir}/patching/files/bash/os_test.sh" case $OS_RELEASE in ################################################################################ - RHEL | CENTOS | FEDORA | ROCKY | OL | ALMALINUX) + RHEL | CENTOS | FEDORA | ROCKY | OL | ALMALINUX | PHOTON) # RedHat variant # update yum cache OUTPUT=$(yum clean expire-cache 2>&1) diff --git a/tasks/reboot_required_linux.sh b/tasks/reboot_required_linux.sh index 12538b6..a474c0c 100644 --- a/tasks/reboot_required_linux.sh +++ b/tasks/reboot_required_linux.sh @@ -8,7 +8,7 @@ export REBOOT_REQUIRED="false" case $OS_RELEASE in ################################################################################ - RHEL | CENTOS | FEDORA | ROCKY | OL | ALMALINUX) + RHEL | CENTOS | FEDORA | ROCKY | OL | ALMALINUX | PHOTON) # RedHat variant source "${PT__installdir}/patching/files/bash/reboot_required_rh.sh" ;; diff --git a/tasks/update_linux.sh b/tasks/update_linux.sh index ce0c7ff..8a5de8c 100644 --- a/tasks/update_linux.sh +++ b/tasks/update_linux.sh @@ -24,7 +24,7 @@ STATUS=0 case $OS_RELEASE in ################################################################################ - RHEL | CENTOS | FEDORA | ROCKY | OL | ALMALINUX) + RHEL | CENTOS | FEDORA | ROCKY | OL | ALMALINUX | PHOTON) # RedHat variant source "${PT__installdir}/patching/files/bash/update_rh.sh" STATUS=$?