Hi all,

Brian Harring noted the possibility of eclass caching being broken and,
unfortunately, my testing has proven it to be true.

$ pwd
/home/portage
$ rm -rf /var/cache/edb/dep/*

$ emerge info | grep PORTDIR
PORTDIR="/usr/portage"
PORTDIR_OVERLAY="/home/portage"
$ grep inherit /usr/portage/sys-devel/patch/patch-2.5.9.ebuild
inherit flag-o-matic

$ echo DEPEND=\"sys-apps/foobar\" > eclass/flag-o-matic.eclass
$ python -c 'import portage; print 
portage.portdb.aux_get("sys-devel/patch-2.5.9", ["DEPEND"])'
['virtual/libc sys-apps/foobar']

$ echo DEPEND=\"sys-apps/foobar2\" > eclass/flag-o-matic.eclass
$ python -c 'import portage; print 
portage.portdb.aux_get("sys-devel/patch-2.5.9", ["DEPEND"])'
['virtual/libc sys-apps/foobar']

$ rm eclass/flag-o-matic.eclass
$ python -c 'import portage; print 
portage.portdb.aux_get("sys-devel/patch-2.5.9", ["DEPEND"])'
['virtual/libc sys-apps/foobar']

$ export PORTDIR_OVERLAY=""
$ emerge info | grep PORTDIR
PORTDIR="/usr/portage"
PORTDIR_OVERLAY=""
$ python -c 'import portage; print 
portage.portdb.aux_get("sys-devel/patch-2.5.9", ["DEPEND"])'
['virtual/libc sys-apps/foobar']

$ su -
# touch /usr/portage/eclass/flag-o-matic.eclass
# exit
$ python -c 'import portage; print 
portage.portdb.aux_get("sys-devel/patch-2.5.9", ["DEPEND"])'
['virtual/libc !bootstrap? ( sys-devel/patch )']

Essentially, the bash side of things will utilize eclasses from overlays,
but the python side of things only verifies whether eclasses of changed
by looking at PORTDIR.

What this means? If you have an eclass in your overlay that results in
different *DEPEND, KEYWORDS or whatever *and* you either use CVS as your
PORTDIR or your PORTDIR's set of eclasses' mtimes match those of CVS,
you'll be committing broken packages.

There's no quick fix for the caching side of things. The easiest option
is to prevent eclasses from overlays being used at all. That would still
leave a hole - when an eclass differs but has the same mtime with regards
to CVS and portdir - but is the easiest and safest.

(Personally, I'd like to fix the caching but I'm trying to keep my bias out
of it ;)

Thoughts?

Regards,
Jason Stubbs

--
[email protected] mailing list

Reply via email to