[Distutils] Patch for new install options

Harry Henry Gebel hgebel@inet.net
Wed, 26 Apr 2000 05:38:31 -0400


On Tue, Apr 25, 2000 at 10:31:38PM -0400, Greg Ward wrote:
> I forgot to mention that (I think) this will require an extra run of the
> setup script compared to Harry's scheme: one to do the fake install to
> /tmp/usr/lib/python1.5, and one to get the list of files (ie. "setup.py
> install --record-install").  This doesn't bother me a bit, in fact I
> think it makes more sense than trying to do them both at the same time.

I must be in a contentious mood tonight, but here goes ;) If you make the
file list using a separate step, you are basically throwing away all the
data that the install left in get_outputs(), data that is just sitting
there begging for somebody to use it. If the setup script has be run again
(and in RPM spec files the file lists are usually generate immediately
after the install script is run) all it is doing is regenerating data that
was there for the taking a few moments ago. Of course you could also do
something like this (copied verbatim from Mandrake's python spec file):

rm -f modules-list.full
for n in $RPM_BUILD_ROOT/usr/lib/python1.5/*; do
  [ -d $n ] || echo $n
done >> modules-list.full

for mod in $RPM_BUILD_ROOT/usr/lib/python1.5/lib-dynload/* ; do
  [ `basename $mod` = _tkinter.so ] || echo $mod
done >> modules-list.full
sed -e "s|$RPM_BUILD_ROOT||g" < modules-list.full > modules-list

#get files list for python-tools
DIR1=$RPM_BUILD_ROOT/usr/lib/python1.5/site-packages/pynche
DIR2=$RPM_BUILD_ROOT/usr/lib/python1.5/site-packages/idle
DIR3=$RPM_BUILD_ROOT/usr/lib/python1.5/site-packages/modulator

find $DIR1 -type f | sed -e "s#^$RPM_BUILD_ROOT##g" > python-tools.files
find $DIR2 -type f | sed -e "s#^$RPM_BUILD_ROOT##g" >> python-tools.files
find $DIR3 -type f | sed -e "s#^$RPM_BUILD_ROOT##g" >> python-tools.files


Sorry about that not-very-applicable example, for most python modules this
would be as simple as:

find $RPM_BUILD_ROOT/usr/lib/python1.5/site-packages/pyncurses -type f > files

But still, just adding --record-install is even easier, and is an option I
have wished for on every spec file I have ever written. I once made my own
custom RPM based distribution, and got to become very tired of the things
existing install scripts made me do to right a spec file (and don't even
get me started on the actual install parts of many spec file install
scripts). This is why I use Mandrake now instead of my own, I let somebody
else worry about that stuff now.

-- 
Harry Henry Gebel, Senior Developer, Landon House SBS
West Dover Hundred, Delaware
PyNcurses ncurses binding for Python: http://pyncurses.sourceforge.ne