Bug 1620324 - Installing a group with dnf.base.group_install() doesn't mark the group as installed [NEEDINFO]
Summary: Installing a group with dnf.base.group_install() doesn't mark the group as in...
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Fedora
Classification: Fedora
Component: dnf
Version: 28
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Daniel Mach
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks: 1624820
TreeView+ depends on / blocked
 
Reported: 2018-08-23 03:04 UTC by Adam Miller
Modified: 2022-11-28 15:45 UTC (History)
8 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
: 1624820 (view as bug list)
Environment:
Last Closed: 2019-03-02 16:00:31 UTC
Type: Bug
dmach: needinfo? (admiller)


Attachments (Terms of Use)
install_group.py (373 bytes, text/x-python)
2018-08-23 03:04 UTC, Adam Miller
no flags Details

Description Adam Miller 2018-08-23 03:04:36 UTC
Created attachment 1478030 [details]
install_group.py

Description of problem:
When I install a group via the dnf API, it does not mark the group as installed but instead just installs the packages from the group.

Version-Release number of selected component (if applicable):
dnf-2.7.5-12.fc28.noarch

How reproducible:
Always


Steps to Reproduce:
1. Run the attached script install_group.py
2. Attempt to remove the group with the command 'dnf groupremove "Development Tools"'


Actual results:
$ cat /tmp/install_group.py
#!/usr/bin/python3

import dnf

base = dnf.Base()

conf = base.conf
conf.assumeyes = True
conf.read()

base.read_all_repos()
base.fill_sack(load_system_repo='auto')
base.read_comps()

group = base.comps.group_by_pattern("Development Tools")

base.group_install(group.id, dnf.const.GROUP_PACKAGE_TYPES)

base.resolve(allow_erasing=True)

print(base.transaction.install_set)

$ /tmp/install_group.py
{<hawkey.Package object id 13556, systemtap-3.3-1.fc28.x86_64, updates>, <hawkey.Package object id 13557, systemtap-client-3.3-1.fc28.x86_64, updates>, <hawkey.Package object id 28743, diffstat-1.61-6.fc28.x86_64, fedora>, <hawkey.Package object id 42632, libdwarf-20180129-4.fc28.x86_64, fedora>, <hawkey.Package object id 13561, systemtap-runtime-3.3-1.fc28.x86_64, updates>, <hawkey.Package object id 13559, systemtap-devel-3.3-1.fc28.x86_64, updates>, <hawkey.Package object id 29357, dyninst-9.3.2-11.fc28.x86_64, fedora>}

$ dnf groupremove "Development Tools"
Warning: Group 'Development Tools' is not installed.
Error: No groups marked for removal.

Expected results:
The dnf API to actually mark the group as installed.

Comment 3 Adam Miller 2018-09-06 14:44:07 UTC
Sorry, I realized my reproducer code I posed is incomplete. Here's a functional version. (Results are the same)


#!/usr/bin/python3

import dnf

base = dnf.Base()

conf = base.conf
conf.assumeyes = True
conf.read()

base.read_all_repos()
base.fill_sack(load_system_repo='auto')
base.read_comps()

group = base.comps.group_by_pattern("Development Tools")

base.group_install(group.id, dnf.const.GROUP_PACKAGE_TYPES)

base.resolve(allow_erasing=True)
print(base.transaction.install_set)
base.download_packages(base.transaction.install_set)

base.do_transaction()

Comment 4 Daniel Mach 2018-11-12 15:49:43 UTC
Adam,
I've reproduced the issue on F28, but I've also verified it's fixed on F29+ because there's new DNF with reworked groups.

Do you need this in F28 or are you ok with this being fixed in F29 and later?

Comment 5 Daniel Mach 2019-03-02 16:00:31 UTC
Works fine on F29.
Please reopen if you need it on F28 or any older release for any reason.


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