[pacman-dev] How does pacman fetch the PKGINFO files for all packages during a --refresh operation

Bozhidar Batsov lordbad at e-card.bg
Tue Jun 5 08:48:17 EDT 2007


Xavier wrote:
> How are you going to reimplement pacman without looking at its code,
> or at the files it uses, like the structure of the database ? :)
> Anyway, I was curious, so I looked more in depth at how it worked.
> First, the database (for example, the current one) is stored there on
> the filesystem :
> /var/lib/pacman/current
> it contains nearly the same information as in .PKGINFO, but it's split
> in two files, and not in the same format, just look at it.
>
> This database is just contained in one archive on the mirrors, for example :
> ftp://ftp.archlinux.org/current/os/i686/current.db.tar.gz
>
> Now for refreshing, pacman apparently doesn't try to do it very efficiently.
> It just stores the date of the last db there :
> /var/lib/pacman/current/.lastupdate
> then it compares it to the date of the db there :
> ftp://ftp.archlinux.org/current/os/i686/current.db.tar.gz
> if it's newer, it downloads the db, and extract the whole thing again.
>
> Edit : I saw your second message too late, after finishing to write
> this one, so I send it anyway..
>
> _______________________________________________
> pacman-dev mailing list
> pacman-dev at archlinux.org
> http://archlinux.org/mailman/listinfo/pacman-dev
>   
Thanks for the response. I need not look into the source at all. I only
need knowledge of the structure of the files .PKGINFO, .FILELIST and a
couple of others like them. My C# version will do an import of the local
pacman DB in a RDBMS - something very lite of course - like
sqlite(currently I use another DB for dev purpose) but it will backward
compatibility with pacman. It may never reach pacman's maturity but I
want to proof my thesis that C# is very capable for Linux development
and can handle any project without sacrificing neither speed  nor power.




More information about the pacman-dev mailing list