Permalink
Browse files

allow for yum repos with slashes in the repo-name

  • Loading branch information...
1 parent 9b7b8f7 commit 00415b01d011a54bfd777831706133e559b349fa @furlongm furlongm committed Mar 28, 2012
Showing with 1 addition and 1 deletion.
  1. +1 −1 client/patchman-client
View
2 client/patchman-client
@@ -202,7 +202,7 @@ function get_repos {
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`
# replace this with a dedicated awk or simple python script?
for i in $(yum repolist enabled --verbose 2>/dev/null | awk '{ if ($1=="Repo-name") {printf "'"'"'"; for (i=3; i<NF; i++) printf $i " "; printf $NF"'" ${host_arch}'"' "} if ($1=="Repo-baseurl" || $1=="Repo-baseurl:" || $1=="Repo-mirrors") { url=1; comma=match($NF,","); if (comma) out=substr($NF,1,comma-1); else out=$NF; printf "'"'"'"out"'"'"' "; } else { if (url==1) { if ($1==":") { comma=match($NF,","); if (comma) out=substr($NF,1,comma-1); else out=$NF; printf "'"'"'"out"'"'"' "; } else {url=0; print "";} } } }' | sed -e "s/\/'/'/g" | sed -e "s/'more)'//" | sed -e "s/ ' /' /") ; do
- name=`echo ${i} | cut -d \' -f 2`
+ name=`echo ${i} | cut -d \' -f 2 | sed -e 's/\//\\\\\//g'`
priority=`echo "${priorities}" | grep "'${name}'" | sed -e "s/priority=\(.*\) '${name}'/\1/"`
# default yum priority is 99
if [ "${priority}" == "" ] ; then

0 comments on commit 00415b0

Please sign in to comment.