tmt icon indicating copy to clipboard operation
tmt copied to clipboard

Expand `tmt.package_managers.PackageManager` with `remove`

Open LecrisUT opened this issue 1 year ago • 4 comments

I was designing a plan for a package that has a main foo and python3-foo rpms, and I wanted to test the plan without python3-foo installed by testing-farm. The simplest interface for this would be to allow the package manger to remove packages and have an equivalent interface for prepare.install

LecrisUT avatar Oct 02 '24 12:10 LecrisUT

We can definitely add an "uninstall" action to package managers, but how to express "package python3-foo shall be uninstalled". We have require for "shall be present" and recommend for "may be present", but to remove a package, no key yet.

happz avatar Oct 02 '24 12:10 happz

Can't we do "negative" require? Not sure if better than adding a new absent key.

martinhoyer avatar Oct 02 '24 12:10 martinhoyer

One option would be to allow package to be a str or a dict, the latter accepting name, install/remove and missing for the prepare.install. I don't think we should support test.require, etc. right now, at least not until #3085 is resolved.

LecrisUT avatar Oct 02 '24 12:10 LecrisUT

Ok, so if the idea is to implement this for the prepare/install plugin first, then it shouldn't be too hard. We already have a precedent for not-just-a-string "packages", test require accepts also libraries and file paths, so yep, that wouldn't be new. It would be in prepare/install, but not in general.

happz avatar Oct 02 '24 12:10 happz