Bug 1241506 - RFE: expose CompsQuery
Summary: RFE: expose CompsQuery
Keywords:
Status: CLOSED INSUFFICIENT_DATA
Alias: None
Product: Fedora
Classification: Fedora
Component: dnf
Version: rawhide
Hardware: Unspecified
OS: Unspecified
low
unspecified
Target Milestone: ---
Assignee: rpm-software-management
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
: 1090292 (view as bug list)
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2015-07-09 11:00 UTC by Lukas Brabec
Modified: 2023-08-22 07:29 UTC (History)
5 users (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2023-08-22 07:29:03 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Bugzilla 1090292 0 unspecified CLOSED [api][rfe] no way to see if a group is installed from API 2021-02-22 00:41:40 UTC

Internal Links: 1090292

Description Lukas Brabec 2015-07-09 11:00:15 UTC
At the moment, Subject from DNF API does not supports groups. We can do:

# package name
dnf.subject.Subject("foo") 

# provides
dnf.subject.Subject("libfoo.so()(64bit)")

# file name
dnf.subject.Subject("/usr/bin/foo")


but this doesn't work:

dnf.subject.Subject("@foogroup")


It would be nice to have this feature so we can easily check whether is given item installed or not (using get_best_query() method), regardless what type it is (pacckage name, provides, file name or group).

Comment 1 Radek Holy 2015-07-09 11:11:08 UTC
FTR, actually, we probably could benefit from this feature in DNF as well but I personally consider the "@" character to be very DNF-CLI specific. Essentially, every client can choose how to differentiate between different arguments on its own. One can use e.g. "group:FooGroup" and "pkg:foo-pkg" etc. Also currently the Subject implementation (down to the hawkey library) knows nothing about the group concept (including the Query objects returned by Subject). So, from the implementation POV it does not make sense to extend Subject in this direction. Or at least it's a huge amount of work. But maybe we can support the use case somehow else. Or my team mates can outvote me :-)

Comment 2 Lukas Brabec 2015-07-09 12:47:48 UTC
Actually, we don't necessarily need it in Subject, if there is other simple way for groups we can use that one based on "@" character. Currently, we use subprocess.Popen from Python code (and relying on return code) to do the stuff, but we'd like to change it to cleaner solution.

Comment 3 Honza Silhan 2015-07-29 13:46:25 UTC
We'd rather expose a refactored CompsQuery to make it easily handle installed and available groups/environments and at the meantime having the same API as base.sack.query().

Comment 4 Honza Silhan 2015-07-29 13:47:40 UTC
*** Bug 1090292 has been marked as a duplicate of this bug. ***

Comment 5 Fedora Admin XMLRPC Client 2016-07-08 09:27:04 UTC
This package has changed ownership in the Fedora Package Database.  Reassigning to the new owner of this component.

Comment 6 Fedora End Of Life 2016-07-19 15:16:18 UTC
Fedora 22 changed to end-of-life (EOL) status on 2016-07-19. Fedora 22 is
no longer maintained, which means that it will not receive any further
security or bug fix updates. As a result we are closing this bug.

If you can reproduce this bug against a currently maintained version of
Fedora please feel free to reopen this bug against that version. If you
are unable to reopen this bug, please file a new report against the
current release. If you experience problems, please add a comment to this
bug.

Thank you for reporting this bug and we are sorry it could not be fixed.

Comment 7 Jaroslav Mracek 2023-08-22 07:29:03 UTC
In the description there is not written the user story, therefore I am not sure what you want to do with requested features, but I have some alternatives. DNF has a new method called base.install_spec() that accepts package and group specs from commandline. If the method does not found the match it returns an error.

In DNF5 there are group, module query, or even install_spec() method therefore I guess that you can get what you want with a minimal code. Event log allows you to track problems with provided argument. Because I am not sure whether offered approaches resolves the issue, I am closing the issue with - insufficient data.


Note You need to log in before you can comment on or make changes to this bug.