[Distutils] Re: chmod symbolic mode parser

Greg Ward gward@cnri.reston.va.us
Wed, 24 Mar 1999 16:17:57 -0500

Quoth Andrew Dalke, on 23 March 1999:
> If anyone is interested, I have implemented an "install" program
> compatable with the GNU version, excepting internalization and
> a bug I think is in their code.  I placed a copy at
> ftp://starship.python.net/pub/crew/dalke/install.py for your
> enjoyment.  It uses the Python license, which is doable since
> I never looked at the GNU source code.

Cool!  I don't *think* it's directly applicable to Distutils; a quick
look at the code reveals what that my suspicious are true: the bulk of
the work is in parsing the command-line options and symbolic mode.  It's 
good to know this code is "out there" in Python, but I don't *think*
it'll be needed for the Distutils.

Andrew, since you've looked at my code you can probably see that my
general approach is to put this sort of functionality into smallish
functions in the distutils.util module.  (Eventually this will probably
have to be split into multiple modules, but for now it's manageable.)
When something can be easily implemented in Python -- copying files or
making directory trees -- then I say, "Do it in Python!".  Don't screw
around with running external utilities whose behaviour (or even
presence) is unlikely to be consistent across platforms, especially when
you consider the Mac.

That said, I consider the fact that you announced your utility to this
list as licence to rip off bits of your code and put them into
distutils.util.  There's more than one way to reuse code...

Aside: I bet your install.py is a damn sight faster than the install-sh
distributed with autoconf, and thus with Python.  Might be nice to use
it instead of install-sh when installing Python.

(Of course, it would be even nicer if Python could install itself with
the functions in distutils.util, but that's a ways down the road
yet... ;-)

Greg Ward - software developer                    gward@cnri.reston.va.us
Corporation for National Research Initiatives    
1895 Preston White Drive                      voice: +1-703-620-8990 x287
Reston, Virginia, USA  20191-5434               fax: +1-703-620-0913