[pacman-dev] [PATCH 0/2] Remove REQUIREDBY usage

Xavier shiningxc at gmail.com
Tue Nov 13 03:07:26 EST 2007


On Mon, Nov 12, 2007 at 08:01:02PM -0600, Dan McGee wrote:
> This is mainly an RFC on the whole idea. Nagy, you made me think
> enough about it that I just went ahead and whipped something up.
> 
> I'd first like to say that I did this in the quickest way possible, so
> there is no guarantee I did everything right. I also did nothing to
> optimize for efficiency. In some cases, we could be calling the
> alpm_pkg_compute_requiredby() function way more than we should,
> because I basically replaced any call to alpm_pkg_get_requiredby()
> with a corresponding alpm_pkg_compute_requiredby() and free().
> 

I wonder if it couldn't be later improved by a sort of runtime cache.
The first time, doing pkg->requiredby = alpm_pkg_compute_requiredby(),
and then just returning this. But that would add some complexity again, and
some difficulties we already have with the pkgcache (that is, when do we
update it).

> Note that we should definitely find a way to pactest or otherwise test
> the computed requiredby entries.
> 

I didn't think about that at all. It looks problematic at first sight.
I wonder though if problems in the requiredby code couldn't be detected by
the other rules (return code, installed / removed packages, etc).

> Some quick observations:
> $ time pacman -Qt > /dev/null (pacman 3, latest GIT release)
> real    0m0.084s
> user    0m0.020s
> sys     0m0.043s
> 
> $ time ./src/pacman/pacman -Qt > /dev/null (with compute_requiredby switch)
> real    0m1.893s
> user    0m1.800s
> sys     0m0.037s
> 
> Obviously a slowdown, but is it all that bad in the big scheme of
> things when corrupted requiredby entries no longer hurt us?
> 

Indeed, that's a big slowdown, and for -Qt, it's really not surprising at
all. The only thing it does is looking at requiredby.
I was mostly thinking about a more common operation like -Su.


> Also:
> $ pacman -Qt > orphans-old
> $ ./src/pacman/pacman -Qt > orphans-new
> $ diff orphans-old orphans-new
> 5a6
> > agg 2.5-2
> 121a123
> > libnet 1.1.2.1-1
> 144a147
> > mysql 5.0.45-1
> 184a188
> > python-eyed3 0.6.14-1
> 237a242
> > ttf-bitstream-vera 1.10-5
> 306a312
> > xmlsec 1.2.10-3
> 
> At first, I was worried. Then I see that the new code is much better!
> openoffice-base has at least two stale entries in the requiredby
> fields of agg and xmlsec, while libnet is stale from being an old
> depend of ettercap. So yeah, this new code helps us in a lot of places
> (everywhere but speed).
> 

Well, yes, that's mostly why I made testdb. To find the incorrect requiredby
entries in the database, and fix them manually by reinstalling the affected
packages with pacman.
That tool becomes quite obsolete now, but not totally. It still looks for
missing dependencies (caused by Rd for example). And it could be extended for
conflicts checking too.




More information about the pacman-dev mailing list