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

Abstract rpm and deb into modules separate from apt and yum #3473

Closed
techhat opened this issue Jan 28, 2013 · 4 comments
Closed

Abstract rpm and deb into modules separate from apt and yum #3473

techhat opened this issue Jan 28, 2013 · 4 comments
Labels
Feature new functionality including changes to functionality and code refactors, etc.
Milestone

Comments

@techhat
Copy link
Contributor

techhat commented Jan 28, 2013

This surface with issue #3444, wherein ALT Linux uses a combination of apt + rpm for package management. ALT is ultimately in the RedHat family (RedHat -> Mandrake -> ALT), but it split off before yum started being used in RedHat systems.

The big problem is that apt.py will not work with rpm files, because it has several pieces of functionality that are hardcoded to use dpkg (example: list_pkgs()).

SUSE also uses rpm files, but it uses zypper instead of yum. A quick look shows that zypper.py and yumpkg.py both have a list_pkgs() function, which seem to do the same thing, but with different code. Presumably, they could be abstracted into the same function in an rpm.py package.

Tagging @Archtaku, @valintinr, @s0undt3ch. This situation should be approached with care.

@terminalmage
Copy link
Contributor

yumpkg.py uses a python interface for the rpmdb. It could just as easily use (and has done so in the past) the output from rpm -qa to list packages.

So, it seems to me that for RPM, the best solution is to break out the code from zypper's list_pkgs (as it would also work for yumpkg and yumpkg5) into an rpm.py module. The list_pkgs function for zypper, yumpkg, and yumpkg5 would then basically be the following:

def list_pkgs():
    return __salt__['rpm.list_pkgs']()

For DEB, I assume the same could be done.

@UtahDave
Copy link
Contributor

I'm putting this on the Modules to Write milestone.

@techhat
Copy link
Contributor Author

techhat commented Feb 13, 2013

You mean like...

https://github.com/saltstack/salt/blob/develop/salt/modules/rpm.py
https://github.com/saltstack/salt/blob/develop/salt/modules/dpkg.py

We just need to break out the rest of the functionality.

@rallytime rallytime added the Feature new functionality including changes to functionality and code refactors, etc. label Oct 1, 2014
@UtahDave
Copy link
Contributor

We can reopen if someone is going to tackle this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature new functionality including changes to functionality and code refactors, etc.
Projects
None yet
Development

No branches or pull requests

4 participants