[Python-Dev] "Absolute" paths in PEP 376 RECORD files

Tarek Ziadé ziade.tarek at gmail.com
Sat Jul 11 12:28:57 CEST 2009


On Fri, Jul 10, 2009 at 8:17 PM, P.J. Eby<pje at telecommunity.com> wrote:
> At 03:31 PM 7/10/2009 +0200, Tarek Ziadé wrote:
>>
>> On Thu, Jul 9, 2009 at 9:09 PM, P.J. Eby<pje at telecommunity.com> wrote:
>> > At 02:46 PM 7/9/2009 -0400, Tres Seaver wrote:
>> >>
>> >> -----BEGIN PGP SIGNED MESSAGE-----
>> >> Hash: SHA1
>> >>
>> >> Nick Coghlan wrote:
>> >> > P.J. Eby wrote:
>> >> >>>  Also,
>> >> >>> why should the RECORD file be generated at all by bdist* commands?
>> >> >> bdist commands that use "install --root" will get it as a side
>> >> >> effect,
>> >> >> so they don't have to do anything special.  They needn't even
>> >> >> generate
>> >> >> the PREFIXES, if PREFIXES is also generated by "install --root", and
>> >> >> omits the root from the prefixes written.  In other words, most
>> >> >> bdist
>> >> >> tools wouldn't change.  bdist_wininst and bdist_msi might need to
>> >> >> regenerate PREFIXES at actual installation time, but AFAIK those are
>> >> >> the
>> >> >> only ones.  (And the spec would allow for the possibility that a
>> >> >> PREFIXES file can be incorrect.)
>> >> >
>> >> > I haven't seen any suggestions for handling non-relative paths that
>> >> > are
>> >> > cleaner than this. The distutils based list that Tarek posted also
>> >> > gives
>> >> > a good "starter set" of supported entries in the PREFIXES file:
>> >> >
>> >> > PURELIB=<path>
>> >> > PLATLIB=<path>
>> >> > HEADERS=<path>
>> >> > SCRIPTS=<path>
>> >> > DATA=<path>
>> >> >
>> >> > The question then would be whether relative paths should be handled
>> >> > directly in the RECORD file (as in the current PEP) or by writing a
>> >> > "."
>> >> > into PREFIXES to indicate relative paths.
>>
>> I like the idea of a separated PREFIXES file, then using variables in
>> the RECORD file.
>
> Please note that my proposal intentionally omitted "variables", but instead
> used a separate column to designate the prefix.  This allows some guarantees
> regarding path sanity that could otherwise be abused, like combining
> prefixes or inserting them in the middle of paths.  In this way, the formal
> conversion of a path would be os.path.join(PREFIX,
> *relative_path.split('/')), rather than a variable expansion.
>

Let's build a detailed example on real distributions then. I propose
docutils because it has scripts, a module and a package. Could you build its
files so we can see ?

I'll try to look for other real world examples.

Regards
Tarek




>



-- 
Tarek Ziadé | http://ziade.org


More information about the Python-Dev mailing list