Skip to content

Commit

Permalink
Update yum repo config parsing
Browse files Browse the repository at this point in the history
Supports a [space] around the name key/value
  • Loading branch information
Alex Uebergang committed Dec 6, 2023
1 parent 1f39836 commit b80a12e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion client/patchman-client
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down

0 comments on commit b80a12e

Please sign in to comment.