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

Linux: OpenSUSE package count #25

Closed
Alxhr0 opened this issue Apr 4, 2023 · 5 comments
Closed

Linux: OpenSUSE package count #25

Alxhr0 opened this issue Apr 4, 2023 · 5 comments
Labels
enhancement New feature or request libmacchina Requires a change in libmacchina

Comments

@Alxhr0
Copy link

Alxhr0 commented Apr 4, 2023

pfetch-rs only shows how many flatpaks I have installed rather than how many packages I have installed from different package managers

@Gobidev Gobidev added the bug Something isn't working label Apr 4, 2023
@Gobidev
Copy link
Owner

Gobidev commented Apr 4, 2023

What distro did you base your bedrock installation on and what package manager are you using?

@Alxhr0
Copy link
Author

Alxhr0 commented Apr 4, 2023

openSUSE Tumbleweed and original pfetch used Bedrock's package manager(pmm) to check how many packages are installed

@Gobidev
Copy link
Owner

Gobidev commented Apr 5, 2023

Thank you for reporting this. I couldn't find the usage of either pmm or zypper in the original pfetch source code (these are all package managers checked) so it is strange that it counted them for you there. The solution seems to be to implement a zypper package count (ideally in libmacchina).

@Gobidev Gobidev changed the title Bedrock Linux support Linux: OpenSUSE package count Apr 5, 2023
@Gobidev Gobidev added enhancement New feature or request libmacchina Requires a change in libmacchina and removed bug Something isn't working labels Apr 5, 2023
@Gobidev
Copy link
Owner

Gobidev commented Apr 11, 2023

I just looked more into this and this issue lead me down a rabbit hole.

libmacchina already supports RPM package count, which is the backend used by zypper by interacting with its sqlite database directly. However, it turns out that RPM also supports different database formats (bdb and ndb), where ndb is used by OpenSUSE. It will probably be really hard to create an implementation that directly accesses this ndb file, as this is a RPM native database implementation with no libraries I could find supporting it (for more detail see Macchina-CLI/libmacchina#154).

So to get a package count on OpenSUSE, the options are to either change the RPM backend from ndb to sqlite (has to be done by the user), work on an implementation that gets the info from the bdb file directly (really hard) or just invoke an rpm process like the original pfetch did it (really slow).

I will probably implement the last one for now to have a package count on OpenSUSE (although being really slow) that can be disabled with the PF_FAST_PKG_COUNT option similar to nix.

@Gobidev
Copy link
Owner

Gobidev commented May 16, 2023

With version 2.6.1, openSUSE package count has gotten significantly faster, as long as the rpm-devel package is installed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request libmacchina Requires a change in libmacchina
Projects
None yet
Development

No branches or pull requests

2 participants