[Distutils] mkpath patch

Greg Ward gward@python.net
Tue, 28 Mar 2000 22:33:37 -0500


On 23 March 2000, Bastian Kleineidam said:
> this patch lets the mkpath() function return all created directories. You
> will need that if you want to generate a list of installed files and
> directories.

Yup, and it's also consistent with many of the other functions in
distutils.util: the general trend is to return the list of files (or
directories) that you affected/created.

One inconsistency: 'mkpath()' always returns the empty list if 'dry_run'
is true.  This is not a very big deal, IMHO.

Incidentally, I don't think you want to include directories in the
list-of-things-created.  For creation/installation, it's obvious that
directories need to be created to hold the files that are supposed to be
in them.  For uninstallation, the uninstallation code should be smart
enough to remove directories that it renders empty.  That's the approach
I took in adapting your "clean" command: after cleaning is done, it
attempts to remove the "build" directory, and doesn't care if it fails.
I think a similar approach would work for uninstallation.

Anyways, the mkpath patch is checked in now.  Thanks!

        Greg
-- 
Greg Ward - Linux geek                                  gward@python.net
http://starship.python.net/~gward/
Sure, I'm paranoid... but am I paranoid ENOUGH?