Re: [Rpm-ecosystem] rpm -q --whatrequires and rich deps
On Mon, Apr 11, 2016 at 12:53:35PM +0200, Michael Mraka wrote: > So to make things consistent I'd propose to fix > rpm -q --whatrequires H > which currently returns "none". And fix --whatsuggests, --whatrecommends, etc. > to work the same way. Wait, don't make "rpm -q --whatrequires H" return richdep if richdep contains Requires: (G if H else I) The H package is on the "if" side, so it is not required. Either G or I is required. Putting H in the requires index (that's what you propose) will just mess up rpm's dependency solving. Cheers, Michael. -- Michael Schroeder m...@suse.de SUSE LINUX GmbH, GF Jeff Hawn, HRB 16746 AG Nuernberg main(_){while(_=~getchar())putchar(~_-1/(~(_|32)/13*2-11)*13);} ___ Rpm-ecosystem mailing list Rpm-ecosystem@lists.rpm.org http://lists.rpm.org/mailman/listinfo/rpm-ecosystem
Re: [Rpm-ecosystem] rpm -q --whatrequires and rich deps
Thank you guys for your responses. Not surprisingly - different people, different expectations :). Miroslav Suchy wrote: % In rpm I would like to have semantic "which package will stop working if I remove this package". % I.e. when I run: % rpm -e foo % then I will get some errors that foo cannot be removed because A,B and C requires it. % I would expect that --whatrequires gives me the same list (sans transitive requires). James Antill wrote: % In general I'd say it's pretty confusing to return something that's a % requirement of what's installed, but the thing that's required isn't % installed (and doesn't need to be). So while you can kind of explain % away why it's shown, it will be less useful and confusing to do so. This is one of the possible semantics, let's call it "strict". Michael Schroeder wrote: % The current implementation returns packages that *potentially* break % if the package is deinstalled. Which is kind of opposite "loose" semantic - which packages have this dependency mentioned among its requires (in any expression). % > richdep.spec: % > Requires: A % > Requires: B % > Requires: (C and D) % > Requires: (E or F) % > Requires: (G if H else I) % > Seems that we all agree following rpm -q --whatrequires A rpm -q --whatrequires B rpm -q --whatrequires C rpm -q --whatrequires D rpm -q --whatrequires '(C and D)' rpm -q --whatrequires '(E or F)' rpm -q --whatrequires '(G if H else I)' should definitely output "richdep". I also think we can agree that rpm -q --whatrequires '(G if H)' should output nothing as it's neither a single dependency nor an exact expression. And for the rest rpm -q --whatrequires E rpm -q --whatrequires F rpm -q --whatrequires G rpm -q --whatrequires H rpm -q --whatrequires I it depends on which strategy we will agree. It's either "richdep" for loose one or for strict one it depends on current rpmdb status. Here is couple of reasons why I'd prefer "loose" semantic: - Currently if there is a package with broken dep A (e.g. installed with rpm --nodeps) then --whatrequires A reports it. - Weak deps --whatsuggests, --whatrecommends, etc. As weak deps can naturally be unsatisfied and that's correct, the answer for rpm --whatsuggests A should report possible breakage not the currently installed packages. - And then there's dnf where 'dnf repoquery --whatrequires' also should report all (possibly) broken packages. So to make things consistent I'd propose to fix rpm -q --whatrequires H which currently returns "none". And fix --whatsuggests, --whatrecommends, etc. to work the same way. -- Michael Mráka Software Management Engineering, Red Hat ___ Rpm-ecosystem mailing list Rpm-ecosystem@lists.rpm.org http://lists.rpm.org/mailman/listinfo/rpm-ecosystem
Re: [Rpm-ecosystem] rpm -q --whatrequires and rich deps
Dne 7.4.2016 v 11:17 Michael Mraka napsal(a): > I'd like to hear your unbiased opinion that's why I don't include > neither my preferences nor current rpm behavior for now. > > An example to think about - have a package with following requires installed > richdep.spec: > Requires: A > Requires: B > Requires: (C and D) > Requires: (E or F) > Requires: (G if H else I) > > Which of the following queries should include 'richdep' in the output? > rpm -q --whatrequires A > rpm -q --whatrequires B > > rpm -q --whatrequires C > rpm -q --whatrequires D > rpm -q --whatrequires '(C and D)' > > rpm -q --whatrequires E > rpm -q --whatrequires F > rpm -q --whatrequires '(E or F)' > rpm -q --whatrequires G > rpm -q --whatrequires '(G if H)' > rpm -q --whatrequires '(G if H else I)' The current implementation returns packages that *potentially* break if the package is deinstalled. I.e. all of rpm -q --whatrequires A rpm -q --whatrequires B rpm -q --whatrequires C rpm -q --whatrequires D rpm -q --whatrequires E rpm -q --whatrequires F rpm -q --whatrequires G return "richdep". I think that's the correct behaviour, but I'm biased as I implemented it ;) (I think that "--whatrequires '(G if H else I)'" also gives you an answer, but it does an exact string match.) Cheers, Michael. -- Michael Schroeder m...@suse.de SUSE LINUX GmbH, GF Jeff Hawn, HRB 16746 AG Nuernberg main(_){while(_=~getchar())putchar(~_-1/(~(_|32)/13*2-11)*13);} ___ Rpm-ecosystem mailing list Rpm-ecosystem@lists.rpm.org http://lists.rpm.org/mailman/listinfo/rpm-ecosystem
Re: [Rpm-ecosystem] rpm -q --whatrequires and rich deps
On 7 April 2016 at 11:49, Miroslav Suchýwrote: > Dne 7.4.2016 v 11:17 Michael Mraka napsal(a): > >> How does this work in other distributions? >> >> I'd like to hear your unbiased opinion that's why I don't include >> neither my preferences nor current rpm behavior for now. > > In rpm I would like to have semantic "which package will stop working if I > remove this package". I.e. when I run: > rpm -e foo > then I will get some errors that foo cannot be removed because A,B and C > requires it. I would expect that --whatrequires > gives me the same list (sans transitive requires). > > So in your example: >> An example to think about - have a package with following requires installed >> richdep.spec: >> Requires: A >> Requires: B >> Requires: (C and D) >> Requires: (E or F) >> Requires: (G if H else I) >> >> Which of the following queries should include 'richdep' in the output? >> rpm -q --whatrequires A >> rpm -q --whatrequires B > > richdep for both above. > >> rpm -q --whatrequires C >> rpm -q --whatrequires D >> rpm -q --whatrequires '(C and D)' > > richdep for all three > >> rpm -q --whatrequires E >> rpm -q --whatrequires F > > none What if only one of them is currently installed? >> rpm -q --whatrequires '(E or F)' > > richdep > >> rpm -q --whatrequires G >> rpm -q --whatrequires '(G if H)' >> rpm -q --whatrequires '(G if H else I)' > > for all three: richdep if *I* have H installed, otherwise none > >> rpm -q --whatrequires H > > none > >> rpm -q --whatrequires I > > richdep if there is no H installed on my machine, otherwise none > > Just my 2 cents. > > -- > Miroslav Suchy, RHCA > Red Hat, Senior Software Engineer, #brno, #devexp, #fedora-buildsys > ___ > Rpm-ecosystem mailing list > Rpm-ecosystem@lists.rpm.org > http://lists.rpm.org/mailman/listinfo/rpm-ecosystem ___ Rpm-ecosystem mailing list Rpm-ecosystem@lists.rpm.org http://lists.rpm.org/mailman/listinfo/rpm-ecosystem