* [gentoo-portage-dev] egencache and dotfiles
@ 2012-11-20 23:40 Chris White
2012-11-21 4:42 ` Zac Medico
0 siblings, 1 reply; 2+ messages in thread
From: Chris White @ 2012-11-20 23:40 UTC (permalink / raw
To: gentoo-portage-dev
When egencache attempts to parse cache files in a directory containing dotfiles, .gitignore for example, a failure occurs:
Unable to parse cp for '.gitignore'
The related code appears to be here (bin/egencache):
----------------------------------------------------------------
for cpv in trg_cache:
cp = cpv_getkey(cpv)
if cp is None:
self.returncode |= 1
writemsg_level(
"Unable to parse cp for '%s'\n" % (cpv,),
level=logging.ERROR, noiselevel=-1)
else:
dead_nodes.add(cpv)
----------------------------------------------------------------
After diving deeper into the code I found the file pym/portage/cache/flat_hash.py. The __iter__ declared here uses os.listdir(), which from what I've read does not ignore dotfiles. I found a quick fix through adding an additional condition here:
-------------------------------------------------------
if l.endswith(".cpickle") or l.startswith("."):
-------------------------------------------------------
However I'm not 100% certain that this is the overall best solution with my knowledge of the portage code and wanted to get some insight.
- Chris
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [gentoo-portage-dev] egencache and dotfiles
2012-11-20 23:40 [gentoo-portage-dev] egencache and dotfiles Chris White
@ 2012-11-21 4:42 ` Zac Medico
0 siblings, 0 replies; 2+ messages in thread
From: Zac Medico @ 2012-11-21 4:42 UTC (permalink / raw
To: gentoo-portage-dev
On 11/20/2012 03:40 PM, Chris White wrote:
> -------------------------------------------------------
> if l.endswith(".cpickle") or l.startswith("."):
> -------------------------------------------------------
I've fixed it to do a lot more validation:
http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=2694610b1fcd2818e203936bf663c9c44f4e6ca7
--
Thanks,
Zac
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2012-11-21 6:06 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-11-20 23:40 [gentoo-portage-dev] egencache and dotfiles Chris White
2012-11-21 4:42 ` Zac Medico
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox