[Distutils] [zc.buildout] running in safe mode

Ian Bicking ianb at colorstudy.com
Fri Oct 3 18:12:06 CEST 2008


Jim Fulton wrote:
>> Instead of using open(), etc, to write files, there's an instance of 
>> Maker which holds some of the settings (--interactive, --simulate, a 
>> base directory).  Then you do all your file operations like:
>>
>>  maker.ensure_file('path/to/file.txt', content)
>>
>> If that file exists with different content then the user gets asked 
>> about what to do.  It also logs all the writing, shows diffs, can make 
>> backups, etc.  You can force overwriting, but that's a keyword 
>> argument that defaults to False, so only if you actually have good 
>> reason to overwrite files (without asking) then that's fine, but you 
>> will start developing the easy way, which is to be safe about this stuff.
> 
> In a system in which most data is managed automatically, asking the user 
> before doing anything that might remove or overwrite data is, in my 
> experience, counterproductive.  It's like a security system that 
> constantly asks for permission do do things, training users to hit an 
> "OK" button very quickly.
> 
> In a previous version of buildout, it worked the way you and Tarek 
> suggest.  It asked users before performing any action that caused a part 
> to be uninstalled.  This was extremely annoying.  I finally just started 
> piping the output of the yes command into it.
> 
> Again, I can live with people adding an option that causes buildout to 
> prompt before removing files or directories (or maybe just uninstalling 
> parts that would cause it to remove files or directories). I know that I 
> wouldn't use the option myself.

You can also treat that nuisance like a bug and resolve the problem.  I 
think fassembler has mostly done that, so that only really interesting 
problems are noted.  We also switched to a system inspired by gentoo 
ports, where these queries are deferred until the end of the build.

Yes, it can be annoying, but it doesn't have to be annoying.  I'd rather 
start at a slightly annoying situation and try to decrease that problem, 
than start with a periodically infuriating situation.


-- 
Ian Bicking : ianb at colorstudy.com : http://blog.ianbicking.org


More information about the Distutils-SIG mailing list