Quick search in bout "man yum" and "man rpm" shows how to find what package X depends upon, but not what depends upon package X. Of course, we could get a deplist for everything but I'm *guessing* that take more overhead and grep too.
"yum remove" tells us. Then we just have to remember to say "No, don't remove". Am I missing something... like I missed that big Google box on the archives?
Anyway, if I haven't overlooked something, I was thinking that this might be a good enhancement request for yum's buglist. Do like remove but skip making us reliably answer "no".
OK. Did I miss something? Is this a feature that others would find handy? Should I get it on a yum bug list?
Thx,
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
On Fri, May 26, 2006 at 12:35:40PM -0400, William L. Maltby wrote:
Quick search in bout "man yum" and "man rpm" shows how to find what package X depends upon, but not what depends upon package X. Of course, we could get a deplist for everything but I'm *guessing* that take more overhead and grep too.
"yum remove" tells us. Then we just have to remember to say "No, don't remove". Am I missing something... like I missed that big Google box on the archives?
Anyway, if I haven't overlooked something, I was thinking that this might be a good enhancement request for yum's buglist. Do like remove but skip making us reliably answer "no".
OK. Did I miss something? Is this a feature that others would find handy? Should I get it on a yum bug list?
Just needs a little magic:
rpm -q --provides PACKAGE_NAME | sed 's/^/"/;s/([^[:space:]]) *$/\1"/' | xargs rpm -q --whatrequires | grep -v -E '^no package'
ex: rpm -q --provides exim | sed 's/^/"/;s/([^[:space:]]) *$/\1"/' | xargs rpm -q --whatrequires | grep -v -E '^no package'
[]s
- -- Rodrigo Barbosa rodrigob@suespammers.org "Quid quid Latine dictum sit, altum viditur" "Be excellent to each other ..." - Bill & Ted (Wyld Stallyns)
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
On Fri, May 26, 2006 at 01:57:42PM -0300, Rodrigo Barbosa wrote:
On Fri, May 26, 2006 at 12:35:40PM -0400, William L. Maltby wrote:
Quick search in bout "man yum" and "man rpm" shows how to find what package X depends upon, but not what depends upon package X. Of course, we could get a deplist for everything but I'm *guessing* that take more overhead and grep too.
"yum remove" tells us. Then we just have to remember to say "No, don't remove". Am I missing something... like I missed that big Google box on the archives?
Anyway, if I haven't overlooked something, I was thinking that this might be a good enhancement request for yum's buglist. Do like remove but skip making us reliably answer "no".
OK. Did I miss something? Is this a feature that others would find handy? Should I get it on a yum bug list?
Just needs a little magic:
rpm -q --provides PACKAGE_NAME | sed 's/^/"/;s/([^[:space:]]) *$/\1"/' | xargs rpm -q --whatrequires | grep -v -E '^no package'
ex: rpm -q --provides exim | sed 's/^/"/;s/([^[:space:]]) *$/\1"/' | xargs rpm -q --whatrequires | grep -v -E '^no package'
Small correction/improvement:
rpm -q --provides PACKAGE_NAME | sed 's/^/"/;s/([^[:space:]]) *$/\1"/;/=/{h;s/ =.*$/"/;G}' | xargs rpm -q --whatrequires | grep -v -E '^no package'
- -- Rodrigo Barbosa rodrigob@suespammers.org "Quid quid Latine dictum sit, altum viditur" "Be excellent to each other ..." - Bill & Ted (Wyld Stallyns)
On Fri, 2006-05-26 at 14:06 -0300, Rodrigo Barbosa wrote: <snip>
rpm -q --provides PACKAGE_NAME | sed 's/^/"/;s/([^[:space:]]) * $/\1"/;/=/{h;s/ =.*$/"/;G}' | xargs rpm -q --whatrequires | grep -v -E '^no package'
Still needs some work, Ran it here and only got 38 packages, s/b 207 here. Timing on 1st run was
real 0m0.701s user 0m0.186s sys 0m0.019s
By the time we get 207 pkgs, I suspect a little overhead penalty.
Thx
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
On Fri, May 26, 2006 at 01:22:42PM -0400, William L. Maltby wrote:
On Fri, 2006-05-26 at 14:06 -0300, Rodrigo Barbosa wrote:
<snip>
rpm -q --provides PACKAGE_NAME | sed 's/^/"/;s/([^[:space:]]) * $/\1"/;/=/{h;s/ =.*$/"/;G}' | xargs rpm -q --whatrequires | grep -v -E '^no package'
Still needs some work, Ran it here and only got 38 packages, s/b 207 here. Timing on 1st run was
real 0m0.701s user 0m0.186s sys 0m0.019s
By the time we get 207 pkgs, I suspect a little overhead penalty.
I didn't change it to improve performance, for to get all the results correctly (previous one was missing some of them).
I really don't think there is any faster way to do it, since rpm accessing its db3 files is what costs so much on this. 10 or 100 dependencies should make little difference.
- -- Rodrigo Barbosa rodrigob@suespammers.org "Quid quid Latine dictum sit, altum viditur" "Be excellent to each other ..." - Bill & Ted (Wyld Stallyns)
On Fri, 2006-05-26 at 19:01 -0300, Rodrigo Barbosa wrote:
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
On Fri, May 26, 2006 at 01:22:42PM -0400, William L. Maltby wrote:
On Fri, 2006-05-26 at 14:06 -0300, Rodrigo Barbosa wrote:
<snip>
rpm -q --provides PACKAGE_NAME | sed 's/^/"/;s/([^[:space:]]) * $/\1"/;/=/{h;s/ =.*$/"/;G}' | xargs rpm -q --whatrequires | grep -v -E '^no package'
Still needs some work, Ran it here and only got 38 packages, s/b 207 here. Timing on 1st run was
real 0m0.701s user 0m0.186s sys 0m0.019s
By the time we get 207 pkgs, I suspect a little overhead penalty.
I didn't change it to improve performance, for to get all the results correctly (previous one was missing some of them).
I ran the new one on that test. Yours might be right, but yum indicates not.
I really don't think there is any faster way to do it, since rpm accessing its db3 files is what costs so much on this. 10 or 100 dependencies should make little difference.
Maybe it's just 'cause I've been around too long, but string processing is expensive and I expect that if your script found 5.5 times as many entries we would see a substantial increase. But as you say, that's not the issue.
I've not looked at the individual step's output in the pipeline you provided, but I'll have to learn a lot more about the output of rpm before I can dink around with it to find what's missing. Since yum can do it, as long as I can remember to "Just Say No" (TM), I don't feel like chasing it myself.
I'm still interested to know if you think it's worth asking yum to do. It's got to be a simple thing since remove does everything we need it to do already.
What say ye: yea or nay?
<snip sig stuff>
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
On Fri, May 26, 2006 at 07:37:13PM -0400, William L. Maltby wrote:
On Fri, 2006-05-26 at 14:06 -0300, Rodrigo Barbosa wrote:
<snip>
rpm -q --provides PACKAGE_NAME | sed 's/^/"/;s/([^[:space:]]) * $/\1"/;/=/{h;s/ =.*$/"/;G}' | xargs rpm -q --whatrequires | grep -v -E '^no package'
Still needs some work, Ran it here and only got 38 packages, s/b 207 here. Timing on 1st run was
real 0m0.701s user 0m0.186s sys 0m0.019s
By the time we get 207 pkgs, I suspect a little overhead penalty.
I didn't change it to improve performance, for to get all the results correctly (previous one was missing some of them).
I ran the new one on that test. Yours might be right, but yum indicates not.
Considering my sed trick doesn't cross reference the provides data, it is bound to differ from yum at some point.
You see, lets consider exim and sendmail. Both provide smtpd. If a package requires smtpd and you try to remove exim, sendmail still fullfils tnat requirements. Yum will detect this.
I really don't think there is any faster way to do it, since rpm accessing its db3 files is what costs so much on this. 10 or 100 dependencies should make little difference.
Maybe it's just 'cause I've been around too long, but string processing is expensive and I expect that if your script found 5.5 times as many entries we would see a substantial increase. But as you say, that's not the issue.
Actually, that is why I'm using sed. Sed is very fast doing this kind of thing. And yes, I have seen instances where string processing was a big problem.
I've not looked at the individual step's output in the pipeline you provided, but I'll have to learn a lot more about the output of rpm before I can dink around with it to find what's missing. Since yum can do it, as long as I can remember to "Just Say No" (TM), I don't feel like chasing it myself.
You might want to install apt for this trick. apt has an option where it will only check, but not execute anything. So you will be pretty safe.
I'm still interested to know if you think it's worth asking yum to do. It's got to be a simple thing since remove does everything we need it to do already.
What say ye: yea or nay?
Well, the _correct_ way to do this would be to use rpmlib directly (either in C, python, perl etc). However, you can use apt for this. It will do what yum does, with the added benefit you can tell it not to execute anything.
- -- Rodrigo Barbosa rodrigob@suespammers.org "Quid quid Latine dictum sit, altum viditur" "Be excellent to each other ..." - Bill & Ted (Wyld Stallyns)
On Fri, 2006-05-26 at 13:57 -0300, Rodrigo Barbosa wrote:
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
On Fri, May 26, 2006 at 12:35:40PM -0400, William L. Maltby wrote:
<snip>Quick search in bout "man yum" and "man rpm" shows how to find what package X depends upon, but not what depends upon package X. Of course, we could get a deplist for everything but I'm *guessing* that take more overhead and grep too.
"yum remove" tells us. Then we just have to remember to say "No, don't remove". Am I missing something... like I missed that big Google box on the archives?
Anyway, if I haven't overlooked something, I was thinking that this might be a good enhancement request for yum's buglist. Do like remove but skip making us reliably answer "no".
OK. Did I miss something? Is this a feature that others would find handy? Should I get it on a yum bug list?
Just needs a little magic:
rpm -q --provides PACKAGE_NAME | sed 's/^/"/;s/([^[:space:]]) *$/\1"/' | xargs rpm -q --whatrequires | grep -v -E '^no package'
ex: rpm -q --provides exim | sed 's/^/"/;s/([^[:space:]]) *$/\1"/' | xargs rpm -q --whatrequires | grep -v -E '^no package'
LOL! Being an old CLI-oriented fart, your regex is perfectly clear to me. But, being an old CLI-oriented fart, I am now lazy, having earned a big rest for having learned regex et al back when there was no choice.
One nice thing about this list, a post like yours doesn't have all the Perl folks jumping in with their "bigger/better" like they did on LFS.
In the spirit of good fun, I challenge you to enter that reliably (no cheating and putting it into a script) after a 14 hour day of dealing with the PHBs! =>:-O
Also, why don't you run that and do a time command and see if the overhead is reasonable. Using cyrus-sasl should be good. I'll run a time on a yum remove of cyrus-sasl here...
real 0m30.548s user 0m13.005s sys 0m1.401s
This on my AMD PR-2200 Athlon 3/4 GB DDR 2700 ram. Didn't clean any cache first, so benefited from the recent experiments some.
<snip>