Gentoo Archives: gentoo-portage-dev

From: Zac Medico <zmedico@×××××.com>
To: gentoo-portage-dev@l.g.o
Subject: Re: [gentoo-portage-dev] DepSet
Date: Sat, 03 Dec 2005 08:06:45
Message-Id: 439151E7.8090509@gmail.com
In Reply to: Re: [gentoo-portage-dev] DepSet by Brian Harring
1 Brian Harring wrote:
2 > the || placement is just a difference in how __str__ outputs... it's
3 > not a bug, it's a difference in how it's presented for str output.
4 > Internally, DepSet parses it correctly.
5
6 I wrote a unit test for DepSet that compares the output of __str__ to the original input. Due to the above mentioned behavior, it was necessary to override __str__ in order to get standard portage syntax.
7
8 With my test I was able to identify a bug in which || ( ( x y ) z ) became || ( x y z ) instead. In order to fix the problem, I wrote a patch so that AndRestrictions are handled in an identical fashion to OrRestrictions. I have tested my whole vdb with the patch and it seems to work well.
9
10 Steps to use my attachments:
11
12 1) Save test_conditionals.py in your PYTHONPATH as portage/test/ebuild/test_conditionals.py
13
14 2) Run `trial portage.test.ebuild` and watch it fail.
15
16 3) Apply DepSet-AndRestriction.patch then watch the previous test succeed.
17
18 4) Run vdb-depset-test.py to try it on your whole vdb (ParseErrors can be expected due to invalid syntax).
19
20 I hope to see test_conditionals.py (or a variation of it) included with the existing unit tests. Feedback is appreciated.
21
22 Zac

Attachments

File name MIME type
test_conditionals.py text/x-python
DepSet-AndRestriction.patch text/x-patch
vdb-depset-test.py text/x-python

Replies

Subject Author
Re: [gentoo-portage-dev] DepSet Zac Medico <zmedico@×××××.com>
Re: [gentoo-portage-dev] DepSet Zac Medico <zmedico@×××××.com>