I'm trying to find a portable command line way to get the full configuration of a single
yum repo -- without relying necessarily on the name/id of the repo or what file it's in.
I'd like to just have a pretty straight forward command -- but this is what I've cobbled together.
epel as an example, I've come up with something like: (forgive the ugly prototype)
$ yum repolist -v "$(yum info epel-release | perl -ne 'print if s/^From repo\s*:\s//')" | perl -ne 'print if s/^Repo-filename\s*:\s//' /etc/yum.repos.d/epel.repo $
epel-release as a way to identify which repo I care about and then finding the repo file associated with that repo.
How do I grab just the stanza in that repo file that is for
epel -- no debug, no source, no other random repos appended to the file. I can imagine some beginning and ending regex magic -- starting with
[<Repo-id>] and until I see the next
[<Next Repo-id>] -- that's pretty easy.
/start regex/../end regex/
Is there a better way?