[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Allow py-compile to ignore DESTDIR
From: |
Toshio |
Subject: |
Allow py-compile to ignore DESTDIR |
Date: |
Tue, 09 Nov 2004 20:02:59 -0500 |
Hi,
I've been building RPMS of my python program and found that py-compile
is encoding the value of DESTDIR into the byte-compiled .pyc and .pyo
files. I put together this small patch to py-compile and python.am to
solve this. It creates a --destdir [DIR] option to py-compile that
complements --basedir. Using --basedir specifies an additional path
that is encoded on the beginning of the filenames whereas --destdir
specifies an additional path to tack on the front of the filenames only
for the purpose of finding the file to compile.
So the following invocations of py-compile have the following results:
Command: Search dir: Filename in pyc/pyo:
py-compile try.py ./try.py try.py
py-compile --destdir /tmp/qa try.py /tmp/qa/try.py try.py
py-compile --basedir /usr/share/qa try.py
/usr/share/qa/try.py /usr/share/qa/try.py
py-compile --destdir /tmp/qa --basedir /usr/share/qa try.py
/tmp/qa/try.py /usr/share/qa/try.py
This is not entirely as expected as the third example has --basedir
change where the file is searched for as well as the encoding that goes
in the byte compiled file. However, it's how py-compile currently
operates with the --basedir argument.
What are people's thoughts on this? Is it worthwhile to continue
working on this? Is it better that --basedir by itself works the same
as previous versions or should it only change the encoded file path?
-Toshio
--
_______S________U________B________L________I________M________E_______
t o s h i o + t i k i - l o u n g e . c o m
GA->ME 1999
automake-python.patch
Description: Text Data
signature.asc
Description: This is a digitally signed message part
- Allow py-compile to ignore DESTDIR,
Toshio <=