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

How to provide a provides DB for a PkgBase repo #7

Open
igalic opened this issue Dec 15, 2022 · 4 comments
Open

How to provide a provides DB for a PkgBase repo #7

igalic opened this issue Dec 15, 2022 · 4 comments

Comments

@igalic
Copy link

igalic commented Dec 15, 2022

Hi!

I'm running https://alpha.pkgbase.live/
an unofficial repository for the FreeBSD PkgBase project, which packages the FreeBSD base as individual packages.

How can i provide a pkg-provides database for these packages, too?

@rosorio
Copy link
Owner

rosorio commented Dec 17, 2022

Hi,

I can suggest a couple of little things we can do to make it in a faster and
unclean way, but it's probably time to start integrating pkg-provides with existing FreeBSD tools such as poudriere for the database generation.

I was procrastinating on this task for a while, but this can be a good opportunity to start working on this task.

If this match your I can try to give you a feedback around June and see how it goes.

Regards
-- rodrigo

@igalic
Copy link
Author

igalic commented Dec 17, 2022

thank you for the response!
I am in no hurry.

i have meanwhile learned from @bapt that the provides db is based on locate(1).
When you try to better integrate it with existing tools, are you gonna migrate it to SQLite?

@rosorio
Copy link
Owner

rosorio commented Dec 18, 2022

Yes, the database uses the bigram algorithm, which is the one used by locate.
So I take advantage of the base system tools to generate the database, and specially the
/usr/libexec/locate.mklocatedb script. In the plugin, I integrate the bigram code itself.

In my first implementation I try to use sqlite, but it was to slow to insert the 1304465
records and rebuilding the index required if you plan to do full text searches.
In fact bigram is quite fast and reduce the size if the database without too much effort.

database dump (text only) : 691M
xz database dump : 32M
bigram db : 96M
xz bigram db : 17M

Of course, I'm open to discussions if you think another way to improve the situation :)

@rosorio
Copy link
Owner

rosorio commented Oct 12, 2023

Hi,
I push two simple scripts to generate the pkg-provides database after a poudriere build.
I think you can use them to generate your pkgbase database.

https://github.com/rosorio/pkg-provides/tree/master/poudriere

I put some details about how to test it with pkg-provides plugin.

@rosorio rosorio closed this as completed Oct 12, 2023
@rosorio rosorio reopened this Oct 12, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants