[pacman-dev] bug in alpm/deps.c

Dan McGee dpmcgee at gmail.com
Mon Feb 26 21:06:31 EST 2007


On 2/25/07, Nagy Gabor <ngaba at petra.hos.u-szeged.hu> wrote:
> Hi!
>
> The function _alpm_depcheck is buggy: lines 246-255 is terrible...
> I think, that the whole provides concept is not really tested
> and reasoned. I think packages that provides the same 'foo', should be
> mutual (I mean, conflicts with each other as I wrote earlier) by
> definition (this is the usual practice anyway); and if you use -S and a
> package needs a provided 'foo' package: it is not defined, which
> provider package will be installed etc. etc.
>
> Back to the current problem:
> During -U foo2, the old foo2's requiredby field is checked, and tested
> if the new version of foo2 is satisfies these dependencies too. As you
> look into the source, you'll see that pacman checks all packages found
> in requiredby, if they "accept" the new foo2 or not. However the
> dependency can be through provide. This should be checked between the
> lines what I mentioned; but it doesn't do that. That part is absolutely
> wrong! (To be precise: It checks if foo2 is between the dependencies,
> if not, checks if the _last_ dependency is provided by an other
> package: if yes, you will get a dependency error ... <- I tried it :-S)

Hey Nagy,

I committed some new tests for pactest tonight, and I think the one at
pactest/tests/upgrade052.py is what you describe as the problem above.
However, I'm not completely sure. Can you look it over and tell me if
it is what you describe?

If it is not, can you write a new one that does describe what you are
trying to point out. In addition, please attempt to run it if you can
on your patch- currently both code patched with your patch and the
unpatched CVS version fail on this test.

To run tests (this is for Nagy and anyone else interested), do the following:
All tests:
./configure --disable-fakeroot
make clean
make check

One test:
./configure --disable-fakeroot
make clean
make
python ./pactest/pactest.py -t /pactest/tests/<testname.py> -p
./src/pacman/pacman

-Dan




More information about the pacman-dev mailing list