Zac Medico wrote: > Brian Harring wrote: > >This makes portage go looking in two different locations for > >overrides; I know from looking through the code, > >/etc/portage/package.* overrides the includes, but users won't. > > This behavior could be documented and possibly configurable. Adding another configurable to control it gets back to my point- should be a simple, extensible *singular* method of doing this, not N methods.
> >Configuration in two seperate locations of the same thing is usually a > >bad idea (exempting global configuration, user configuration, which > >this is not). It's not intuitive, mainly. > > The idea behind my patch was something akin to /etc/env.d, where > it's easy to yank things in and out in groups. That makes it easy > for tools (unmasking and what else?) to make "transactional" > changes, in a sense. Not so much transactional as groupping/seperation of each apps files. (sort of). The type of changes you're talking about could just as easily be integrated into package.* with source command added to it. Where's the gain in adding a secondary location for these files, when the same can be managed from the existing with a minor tweak? > >>Index: pym/portage_util.py > >>=================================================================== > >>--- pym/portage_util.py (revision 2314) > >>+++ pym/portage_util.py (working copy) > >>@@ -463,3 +463,12 @@ > >> writemsg(line, noiselevel=1) > >> writemsg("Please file a bug for %s\n" % sys.argv[0], noiselevel=1) > >> writemsg("====================================\n\n", noiselevel=1) > >>+ > >>+def subdir_paths(parent): > >>+ full_paths=[] > >>+ if os.path.exists(parent) and os.path.isdir(parent): Two stats when os.path.isdir(parent) would suffice (single stat) > >>+ for x in os.listdir(parent): > >>+ full_path=os.path.join(parent,x) > >>+ if os.path.isdir(full_path): > >>+ full_paths.append(full_path) > >>+ return full_paths <snip> > Good points. I have to admit that I did not put much thought into that > function. Like Jason said, the paths should be sorted. It certainly needs > improvement. :) Actually, in reading this through a bit closer, it won't go recursive- the code above will only go a single dir down, which isn't really friendly- either support recursing through subdirs or don't, basically. :) ~harring
pgp3wQpybvZC2.pgp
Description: PGP signature