[Frugalware-devel] [RFC] pacman-g2 fix and speed up -Sy / -Su

Miklos Vajna vmiklos at frugalware.org
Sun Jun 26 14:35:05 CEST 2011

On Mon, Jun 20, 2011 at 08:36:00AM +0200, Michel Hermier <hermier at frugalware.org> wrote:
> Well most of this code is too much cryptic in some place for me.

Sure, take your time to read it. If something is really hard to read,
then ask, and I'll add comments.

> But from code point I see 2-3 things that annoys me.
> - on first patch you use strcmp to check if the database is local, and in
> second patch you made the same and even made a fuction out of it. Maybe it
> should be defined for real in db.c as a function.

Better to use db == handle->db_local instead, which is what I did in the
updated patch set.

> - _pacman_archive_fgets I see this as a bad practice. From api point of
> view it seems that libarchive don't provide an archive_entry to file
> descriptor open. This would allow the reusage of all the standard libc.
> Maybe you should ask libarchive maintainers to provide such function.

Hmm. In fact it provides a archive_read_data_into_fd(), which will read
data *to* an fd. Combining this with pipe(), you could have this. IOW: I
see the idea and I'm not against a patch if you do it, but it's not
something I promise I'll do.

> - Lats patch seems really cryptic, and I see quite some duplications
> couldn't it be factorised?

I the duplication was mostly about not using _pacman_db_rewind() but
manually closing and opening the file all time - this is now fixed in
the updated patch set. (The perfect solution would be if libarchive
supported seeking, but that's not the case at the moment).

> Other test worth to try, have you tried some testing on using an
> uncomressed version of the .fdb ? (a plain uncompressed archive) It just
> to have quite some extra numbers to compare with.

That's not really easy, since libarchive is smart enough to see fdb is a
.tar.xz. Now we can disable the tar part, but then we loose backwards

An other items from my todo is that pacman -Sy is a noop again on no
updates (I fixed getlastupdate/setlastupdate for the compressed db).

I pushed to patchset to the fdb-direct branch in pacman-g2.git. I think
it's quite ready to be merged to the master branch, but I want to give
time to anybody willing to test before merging. If no objections, I'll
probably merge it on the next weekend.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: not available
URL: </pipermail/attachments/20110626/d51f3006/attachment.asc>

More information about the Frugalware-devel mailing list