[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


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 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                      ./  
py-compile --destdir /tmp/qa    /tmp/qa/
py-compile --basedir /usr/share/qa
                         /usr/share/qa/ /usr/share/qa/
py-compile --destdir /tmp/qa --basedir /usr/share/qa
                         /tmp/qa/       /usr/share/qa/

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?

  t  o  s  h  i  o  +  t  i  k  i  -  l  o  u  n  g  e  .  c  o  m
                                                          GA->ME 1999

Attachment: automake-python.patch
Description: Text Data

Attachment: signature.asc
Description: This is a digitally signed message part

reply via email to

[Prev in Thread] Current Thread [Next in Thread]