You are not logged in.
Pages: 1
I am working on a project to bring some of pacman's and alpm's functionality to a Java library, but i cant in any way read the pacman database files.
core.db
community.db
extra.db
etc.
I tried SQLite 2 and 3 and both failed to open the databse.
Is it a non-standard database format? Is it encrypted?
tl:dr what format is the pacman database?
Offline
I believe it's tar.xz
CPU-optimized Linux-ck packages @ Repo-ck • AUR packages • Zsh and other configs
Offline
I believe it's tar.xz
It is. Thanks.
That seems a little primitive to store a database like that. Why wasn't a more complex format used, like for example sqlite?
Offline
Why make it difficult? Arch operates on a KISS principal.
CPU-optimized Linux-ck packages @ Repo-ck • AUR packages • Zsh and other configs
Offline
Why make it difficult? Arch operates on a KISS principal.
KISS would be a single sqlite table, not a double-tarred archive with a folder for each package.
Oh well, it was developed a long time ago, maybe sqlite wasnt even a thing.
Offline
I believe that, by relying on the filesystem to organise data rather than a database program, there are less moving parts, making the package manager more robust to bugs and less limiting in terms of accessibility (basically you can inspect a local repository with `cd`, `ls` and your text editor of choice).
Maybe performance is an argument [citation needed], but looking around in the package manager ecosystem, I don't think that pacman is currently in need of a performance boost.
Offline
On a tangent from ayekat: Linus Torvalds on C++.
The gist of it is "don't depend on unnecessary complexity that hides details from you because eventually something that was hidden from you will break and it won't be obvious why." Making the pacman database format use sqlite would be adding complexity and therefore, regardless of pros and cons, hide some details that may not be obvious and could be very important.
Offline
Maybe performance is an argument [citation needed]
Not for the sync databases - the numbers come out even. The local database (which is not tarred up) is another story...
Offline
Why wasn't a more complex format used
You want complexity ... just for the sake of complexity?? And you use arch linux?
Now I've seen everything.
"UNIX is simple and coherent..." - Dennis Ritchie, "GNU's Not UNIX" - Richard Stallman
Offline
It's gz not xz
Offline
It is actually any compression scheme supported by libarchive. Arch Linux just chooses gz.
Offline
As an aside, /usr/bin/file would have told you it was a gzipped file which would have led you to the right content format.
$ file /var/lib/pacman/sync/core.db
/var/lib/pacman/sync/core.db: gzip compressed data, last modified: Mon May 2 12:14:00 2016, from Unix
Offline
Pages: 1