From b80a12e748ecbcfeddc33fffddd2cc6ab783e1d8 Mon Sep 17 00:00:00 2001 From: Alex Uebergang Date: Thu, 7 Dec 2023 10:29:23 +1100 Subject: [PATCH] Update yum repo config parsing Supports a [space] around the name key/value --- client/patchman-client | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/client/patchman-client b/client/patchman-client index b6d2d0c9..5d191b84 100755 --- a/client/patchman-client +++ b/client/patchman-client @@ -372,7 +372,7 @@ get_repos() { releasever=$(rpm -q --qf "%{version}\n" --whatprovides redhat-release | sort -u) let numrepos=$(ls /etc/yum.repos.d/*.repo | wc -l) if [ ${numrepos} -gt 0 ] ; then - priorities=$(sed -n -e "/^name/h; /priority *=/{ G; s/\n/ /; s/ity *= *\(.*\)/ity=\1/ ; s/\$releasever/${releasever}/ ; s/name=\(.*\)/'\1 ${host_arch}'/ ; p }" /etc/yum.repos.d/*.repo) + priorities=$(sed -n -e "/^name/h; /priority *=/{ G; s/\n/ /; s/ity *= *\(.*\)/ity=\1/ ; s/\$releasever/${releasever}/ ; s/name *= *\(.*\)/'\1 ${host_arch}'/ ; p }" /etc/yum.repos.d/*.repo) fi # replace this with a dedicated awk or simple python script? yum_repolist=$(yum repolist enabled --verbose 2>/dev/null | sed -e "s/:\? *([0-9]\+ more)$//g" -e "s/ ([0-9]\+$//g" -e "s/:\? more)$//g" -e "s/'//g" -e "s/%/%%/g")