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

Xavier shiningxc at gmail.com
Tue Jun 5 07:34:38 EDT 2007


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




More information about the pacman-dev mailing list