You are not logged in.

#1 2014-08-22 08:45:35

ody
Member
From: Manchester, UK
Registered: 2002-08-12
Posts: 216
Website

Phacman (likely to only interest Pacman/PHP developers)

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 smile

Project: https://github.com/AndrewRose/Phacman

cheers!
Andrew

Offline

#2 2014-08-22 12:45:47

Xyne
Administrator/PM
Registered: 2008-08-03
Posts: 6,965
Website

Re: Phacman (likely to only interest Pacman/PHP developers)

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 StuffForum EtiquetteCommunity Ethos - Arch is not for everyone

Offline

#3 2014-08-22 13:09:16

ody
Member
From: Manchester, UK
Registered: 2002-08-12
Posts: 216
Website

Re: Phacman (likely to only interest Pacman/PHP developers)

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 wink 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

#4 2014-08-23 12:11:55

Xyne
Administrator/PM
Registered: 2008-08-03
Posts: 6,965
Website

Re: Phacman (likely to only interest Pacman/PHP developers)

ody wrote:

Not sure I could get more efficient than reading the database files directly wink 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 StuffForum EtiquetteCommunity Ethos - Arch is not for everyone

Offline

#5 2014-08-26 12:23:16

ody
Member
From: Manchester, UK
Registered: 2002-08-12
Posts: 216
Website

Re: Phacman (likely to only interest Pacman/PHP developers)

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

Board footer

Powered by FluxBB