[Distutils] Problems with --record option.

Sean Reifschneider jafo-distutils at tummy.com
Sun Jul 25 00:08:44 CEST 2004


I've checked both the Distutils in Python 2.3.4, and the CVS version,
they both have this problem.

If you do a "python setup.py install --record INSTALLED_FILES", on a
package that installs .py files, the INSTALLED_FILES list will include
the .py files installed, but not the .pyo and .pyc files which were
generated because of the compile.

This in particular causes problems with "bdist_rpm", which relies on
--record.  Newer RPMs, unless otherwise configured not to, will complain
and die if there are files in the installation directory which are not
in the %files section.  The %files section generated in the RPM spec
file is pulled from "INSTALLED_FILES".

I'm not sure what the right way to approach this is, though.  I'd think
that if you are compiling the .py files, you'd want to write the names
of the .pyo and .pyc files into the --record when you write the .py
file names.  On the other hand, you can also add the lines:

   ( cd "$RPM_BUILD_ROOT"; find . -type f \( -name \*.pyo 
      -o -name \*.pyc \) ) | sed 's/^\.//' >>INSTALLED_FILES

after the "python setup.py install" lines in the spec file.

Sean
-- 
 Men are from Mars. Women are from Venus. Computers are from hell.
Sean Reifschneider, Member of Technical Staff <jafo at tummy.com>
tummy.com, ltd. - Linux Consulting since 1995.  Qmail, Python, SysAdmin
      Back off man. I'm a scientist.   http://HackingSociety.org/


More information about the Distutils-SIG mailing list