You are not logged in.
Hi everyone,
I've put together an SQL schema and PHP script that scrapes the pacman local and sync databases and imports it into MariaDB. My own goal with this is to create a web based interface that lets me create "builds" by taking a snapshot of the currently setup system and roll this out to multiple servers etc .. Before I go much further I'd be grateful for any feedback on the database structure .. I think I've got it right but the pacman database doesn't lend itself to be easily implemented as a relational database
Project: https://github.com/AndrewRose/Phacman
cheers!
Andrew
Offline
Interesting.
If you provide a JSON interface for this at some point, I suggest that you follow the "standard" one for compatibility if it fulfills your requirements: https://www.archlinux.org/packages/core … cman/json/
Incidentally, for scrapping the database it my be more efficient and future-proof to use pyalpm if that is an option.
My Arch Linux Stuff • Forum Etiquette • Community Ethos - Arch is not for everyone
Offline
It would be simple enough to implement the JSON example you gave and the Phacman web interface will use JSON to communicate with the backend so I'll keep things in line as and where possible.
Not sure I could get more efficient than reading the database files directly Also pyalpm is for Python where as I'm a PHP developer, I will eventually get around to creating an equivalent PHP extension (just as soon as I brush up on my C) for performing package management.
Offline
Not sure I could get more efficient than reading the database files directly Also pyalpm is for Python where as I'm a PHP developer, I will eventually get around to creating an equivalent PHP extension (just as soon as I brush up on my C) for performing package management.
I expect pyalpm to be faster with the C backend than a native re-implementation in PHP, even if I doubt that the difference will be critical in this case. The main advantage would be that eventual changes in database formats would be handled transparently without the need to update the code. Of course I am sure that a "phalpm" library would be appreciated.
It would also be interesting to see how the performance of a real database backend compares to that of the current tarball/file implementation.
My Arch Linux Stuff • Forum Etiquette • Community Ethos - Arch is not for everyone
Offline
Off course, a C backend would be quicker, but it wouldn't be the most efficient means for me to have to use something like PiP to bridge to Python which then uses the C backend when I can just read the database files in directly and parse with relative ease. As this first tool is intended to only be used the once to scrape the file based database into a relational database there was no focus to make it as quick as possible.
The database and schema for testing the performance is there now .. next job is to put together a daemon which monitors for updates, creates save points, installs new packages etc with a nice front end.
Offline