On 5 June 2011 18:20, Greg Swift <[email protected]> wrote:

>
> So I guess if you wanted to get more complicated, you could use the
> output of extras, and do some inversion work... but that migth just be
> a huge pita.  inode0's suggestion about working with the Vendor output
> is probably easier.
>
>
It wouldn't be especially difficult.  Something like this ought to do the
trick:

ylist () {
   yum -quiet list "$@" | awk 'NR > 1 {print $1}' | sort
}
ylist installed > /tmp/installed
ylist extras > /tmp/install

You can get the list of repos from "yum repolist" but --quiet disables all
output for me, yours might be different, but one way or another you want a
list of enabled repos on your machine:

for repo in $repolist; do
    comm -13 /tmp/installed \
        <(ylist --disablerepo=$repo) /tmp/installed |
       fgrep -vf /tmp/extras > /tmp/$repo
done

It's untested, so I've probably got the arguments to comm wrong (I usually
have to try twice, I only use it about once a month, if that) but that
should give you a nicely ordered set of what comes from where.  I wasn't
expecting it, but it does give a list of RPMs that were installed from the
"updates" repos.

jch
_______________________________________________
rhelv5-list mailing list
[email protected]
https://www.redhat.com/mailman/listinfo/rhelv5-list

Reply via email to