another distutils question
Robert Kern
robert.kern at gmail.com
Fri Sep 29 22:16:24 EDT 2006
Keith Perkins wrote:
> I did install it in ~/.script/data.txt, and distutils set the
> user/group as root. Is it impossible to install this with distutils?
> Since I'm running setup as root, should I just add a class or method to
> chown the datafolder/file to the installer. Should I use autotools
> instead? I haven't looked into eggs yet would that be a better choice? The
> data file is something that is necessary for the program (it reads it and
> prints out a random line--the whole idea of the script)if that's all I
> wanted it to do I wouldn't have any problems--I could even include it as a
> list in the script file, but I would like the user to be able to add other
> data.
Don't use "setup.py install" to install that directory. Imagine a case where the
root user installs the package for everyone on the system to use. How do the
multiple users get ~/.script/?
Instead, include the default data inside the package (read-only to non-root
users). Then allow the script itself to create the directory the first time it
is run (read-write, and it should then automatically be accessible to the user
that ran the script). You might also add a command-line option to *only* install
that directory.
--
Robert Kern
"I have come to believe that the whole world is an enigma, a harmless enigma
that is made terrible by our own mad attempt to interpret it as though it had
an underlying truth."
-- Umberto Eco
More information about the Python-list
mailing list