Re: [Rpm-ecosystem] rpm -q --whatrequires and rich deps

2016-04-07 Thread Michael Schroeder
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

2016-04-07 Thread Pascal Terjan
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