Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[WIP] ncm-spma: yumdnf: use spmaleaves dnf plugin #1507

Draft
wants to merge 8 commits into
base: master
Choose a base branch
from

Conversation

stdweird
Copy link
Member

@stdweird stdweird commented May 2, 2021

Requires #1401

@stdweird stdweird changed the title ncm-spma: yumdnf: use spmaleaves dnf plugin [WIP] ncm-spma: yumdnf: use spmaleaves dnf plugin May 2, 2021
@stdweird
Copy link
Member Author

stdweird commented May 2, 2021

@jrha @ned21 i don't actually expect this gets merged ever (it ships a piece of GPL code). but this is my current attempt, not sure how deal with this (it's annoying i can't make el8 rpms yet, so i can ship this in a seperate rpm and have it installed via a rpm dependency).

@stdweird stdweird force-pushed the yumdnf_spmaleaves branch 5 times, most recently from 530d822 to edaa99f Compare May 4, 2021 08:02
@@ -8,6 +8,7 @@ use Set::Scalar;
push our @ISA , qw(NCM::Component::spma::yum);

use constant YUM_CONF_FILE => "/etc/dnf/dnf.conf";
use constant YUM_CONF_CLEANUP_ON_REMOVE_VALUE => 0;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why not?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is potentionally dangerous; and i was surprised it was enabled on yum.

the usual scenario is that a (installed) leave has a (installed) dependency on something you have listed in the packages list (but the leave itself is not listed; only the dependency). the current code will generate a remove command for the leave, and no install command for the dependency (it's already nstalled). autoremove will remove the leave and the dependency; and you will end up with something you didn't ask for.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK, makes sense - thanks,

@ned21
Copy link
Contributor

ned21 commented May 7, 2021

@jrha @ned21 i don't actually expect this gets merged ever (it ships a piece of GPL code). but this is my current attempt, not sure how deal with this (it's annoying i can't make el8 rpms yet, so i can ship this in a seperate rpm and have it installed via a rpm dependency).

Sounds like the right approach - nice to see this functionality being maintained by someone other than us - but it appears to be part of RH maintained dnf-plugins-core so why would we need to make our own rpm rather than getting it from OS?

@stdweird
Copy link
Member Author

stdweird commented May 7, 2021

@ned21 yes and no. most of the code is the same, but the output is different from the leaves plugin. also, the el8 rpm for dnf-plugins-core does not include the leaves plugin at all (and it looks intentional).

@ned21
Copy link
Contributor

ned21 commented May 8, 2021

@ned21 yes and no. most of the code is the same, but the output is different from the leaves plugin. also, the el8 rpm for dnf-plugins-core does not include the leaves plugin at all (and it looks intentional).

That's a bit odd. Can you ping me some details on where you seeing it's missing and why you think it's intentional and maybe I can raise a support case asking them to add it? (Or do we need a different plugin of the same name? That's confusing... But again maybe we can ask for RH about it.)

@stdweird
Copy link
Member Author

stdweird commented May 9, 2021

e.g. https://git.centos.org/rpms/dnf-plugins-core/blob/c8s/f/SPECS/dnf-plugins-core.spec#_226

but tbh, without rpm-software-management/dnf-plugins-core#399 and a way to change the format of the of showing the results (we need only need the name and the arch; and must be able to identify the scc somehow (see eg the PR; but ideally in a more machine readable version like the version i used)) it's pretty pointless.

@jrha jrha marked this pull request as draft May 18, 2021 15:37
@jrha
Copy link
Member

jrha commented May 18, 2021

As you stated that you have no expectation for this to ever be merged I've converted this PR to a draft.

@jrha
Copy link
Member

jrha commented Aug 10, 2023

i don't actually expect this gets merged ever (it ships a piece of GPL code)

We could of course ship the plugin as a separate RPM in the externals repo and have ncm-spma depend upon it.

@wpoely86
Copy link
Member

i don't actually expect this gets merged ever (it ships a piece of GPL code)

We could of course ship the plugin as a separate RPM in the externals repo and have ncm-spma depend upon it.

That sounds like an excellent idea to me. It's just this one python file (the leaves plugin itself) which is slightly adjusted from upstream if I understand it correctly? Can we make a dedicated repo for the plugin and spec file? Or do we have some other place to put it?

@jrha
Copy link
Member

jrha commented Aug 11, 2023

I'd be tempted to try and get the now very small changes merged upstream if possible.

@StephaneGerardVUB
Copy link

I've tried out this PR/WIP, and there are problems when dealing with several architectures of a same package. For example, if the package glibc-gconv-extra is installed with 2 architectures (i686 and x86_64), spma will remove both as they are not declared in /software/packages and userpkgs is set to 'no', but doing so, it also removes all Quattor and perl packages. The full story is the following: glibc-gconv-extra is a dependency of redhat-rpm-extra that is itself a dependency of perl (via perl-devel). You can remove one arch of glibc-gconv-extra, but not both.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants