[pacman-dev] How does pacman fetch the PKGINFO files for all packages during a --refresh operation
How does pacman fetch the PKGINFO files for all packages during a --refresh operation? Is there a way to extract a single file from an archive even over the network or are there all store in one single location? I'm asking because I'm reimplementing pacman from scratch in C# and I was uncertain how I can achieve the refresh the refresh optimally and I'm a little short on time, so if you can spare me browsing through the source tree I'd be most helpful. Best Regards, Bozhidar
Bozhidar Batsov wrote:
How does pacman fetch the PKGINFO files for all packages during a --refresh operation? Is there a way to extract a single file from an archive even over the network or are there all store in one single location? I'm asking because I'm reimplementing pacman from scratch in C# and I was uncertain how I can achieve the refresh the refresh optimally and I'm a little short on time, so if you can spare me browsing through the source tree I'd be most helpful.
Best Regards, Bozhidar
_______________________________________________ pacman-dev mailing list pacman-dev@archlinux.org http://archlinux.org/mailman/listinfo/pacman-dev
I find the db file I was looking for. Ignore my previous post.
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..
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@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.
On Tuesday 05 June 2007 14:48:17 Bozhidar Batsov wrote:
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.
You know pacman uses a library backend called libalpm you could create bindings to C# for, to ease your development? I do not think it would be against your goal as the Linux way is to reuse existing code and libraries wherever possible - thus it would prove your thesis even further and show that C# is capable to adhere to this philosophy aswell. It could also be useful for others wanting to make use of libalpm with C# if you released your bindings. Ask not what Linux can do for you but what you can do for Linux! ;-) (Or, if you really wish to code everything from scratch in C#, it would also be neat if you implement it like pacman with a backend library and a frontend client, and open source'd it.) Just my two cents. -- Dag Odenhall <xmpp:dag.odenhall@jabber.se>
Dag Odenhall wrote:
On Tuesday 05 June 2007 14:48:17 Bozhidar Batsov wrote:
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.
You know pacman uses a library backend called libalpm you could create bindings to C# for, to ease your development? I do not think it would be against your goal as the Linux way is to reuse existing code and libraries wherever possible - thus it would prove your thesis even further and show that C# is capable to adhere to this philosophy aswell.
It could also be useful for others wanting to make use of libalpm with C# if you released your bindings. Ask not what Linux can do for you but what you can do for Linux! ;-)
(Or, if you really wish to code everything from scratch in C#, it would also be neat if you implement it like pacman with a backend library and a frontend client, and open source'd it.)
Just my two cents.
------------------------------------------------------------------------
_______________________________________________ pacman-dev mailing list pacman-dev@archlinux.org http://archlinux.org/mailman/listinfo/pacman-dev
Well there already is a backend library and a console client codenamed maelstrom. Currently it has limited functionality. It can work with packages locally(update, freshen, remove) and currently I'm developing the sync components for it - a finished a ftp backend library, I have to create one for http communication as well. It understands the pacman.conf format and in the final version I guess I'll reuse pacman.conf itself. I hope I'd be able to show the community a working beta by the end of the month. Some of the advanced functionality won't be implemented by then of course but I'll do my best to rival pacman's features and even provide a couple new... Maelstrom is of course open source and is being developed together with a companion project - Whirlwind, that will try to bring the synaptic functionality to arch's community wrapped in a pretty GTK# UI. P.S. Maelstrom started as a set of C# bindings for libapml, but soon I decided that it would be easier for me to reimplement everything rather than try to wrap it. The current codebase also seemed to me cluttered and inconsistent so I took the "from scratch" approach...
participants (3)
-
Bozhidar Batsov
-
Dag Odenhall
-
Xavier