Bug 1184808

Summary: [weak deps] help on usage of weak dependencies
Product: [Fedora] Fedora Reporter: Parag Nemade <pnemade>
Component: dnfAssignee: Packaging Maintenance Team <packaging-team-maint>
Status: CLOSED CURRENTRELEASE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 22CC: akozumpl, hhorak, jsilhan, mluscon, packaging-team-maint, pnemade, rholy, tim.lauridsen
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2015-07-14 09:50:14 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Parag Nemade 2015-01-22 10:20:45 UTC
Description of problem:
Following what is given here https://github.com/rpm-software-management/dnf/wiki/Bug-Reporting#weak-dependencies

1) created 2 (empty, noarch) packages foo and bar where bar.spec contains
Supplements: foo

2) Copr repo name -> pnemade/weakdeps
   Copr builds -> https://github.com/rpm-software-management/dnf/wiki/Bug-Reporting#weak-dependencies

3) Command used -> dnf install foo

Trying to understand the meaning of " A packages containing Supplements: foo on the other hand should be added if a package named foo or containing Provides: foo is installed." as given on 
http://www.rpm.org/wiki/PackagerDocs/DependenciesOverview#Weakdependencies

From the given statement I think when I do "sudo dnf install foo" , the dnf transaction should also pull bar package. But, its not doing that.

Am I wrong in above understanding of using Supplements:?

Thanks.

Comment 1 Parag Nemade 2015-01-22 10:23:37 UTC
oops let me correct the link

Copr builds -> https://copr.fedoraproject.org/coprs/pnemade/weakdeps/builds/

Comment 2 Honza Silhan 2015-01-23 10:57:49 UTC
Thanks for the report and workground. Seems like weak deps tags are not contained in metadata from COPR. Moreover after downloading RPM packages itself Supplements tag is ignored during resolution in depsolver (tag is saved in internal structure) -> will will look at that.

Comment 3 Parag Nemade 2015-02-02 09:42:00 UTC
I did some testing on using supplements tag. If a package contains only one supplements in spec file then it works but If I need more complex way of using supplements like in foobar.spec ( here consider if xyz already installed then install abc also)

supplements: abc AND xyz
then its not working.

I then split this as
supplements: abc
supplements: xyz

still then "dnf repoquery --supplements foobar" failed to show output as
abc
yyz

Comment 4 Honza Silhan 2015-02-12 21:20:29 UTC
Rich dependencies are not supported even in RPM yet. Would you mind sharing the code (PR) implementing `--supplements` option so we can figure out whats wrong here?

Comment 5 Parag Nemade 2015-02-13 04:53:35 UTC
I first need to understand if following usage is correct?
supplements: abc AND xyz

Using AND to make sure if xyz is already installed on the system then only install abc. Not sure how to achieve this. I have never seen AND used for any Requires: or Provides: tag.

Comment 6 Jaroslav Reznik 2015-03-03 16:45:02 UTC
This bug appears to have been reported against 'rawhide' during the Fedora 22 development cycle.
Changing version to '22'.

More information and reason for this action is here:
https://fedoraproject.org/wiki/Fedora_Program_Management/HouseKeeping/Fedora22

Comment 7 Honza Silhan 2015-03-05 14:33:16 UTC
(In reply to Parag from comment #5)
> I first need to understand if following usage is correct?
> supplements: abc AND xyz

it should be correct

> Using AND to make sure if xyz is already installed on the system then only
> install abc. Not sure how to achieve this. I have never seen AND used for
> any Requires: or Provides: tag.

AND is part of rich dependencies - not already in current rpm AFAIK but it's supported by libsolv. The guideline with use cases should be revealed soon, by Florian Festi.

Comment 8 Honza Silhan 2015-07-14 09:50:14 UTC
The bug request is for [1]. I believe this should be closed. At the time of creation of this report, the Fedora servers didn't support weak deps (in rpm from f21). Now dnf should handle them from COPR or from official Fedora repo. For rich dependencies you would have to probably wait.

[1] https://fedoraproject.org/wiki/Packaging:WeakDependencies