[merge] look for plugins in arch-independent site directory (was Re: Bundling more plugins into bzrtools)

Alexander Belchenko bialix at ukr.net
Fri Feb 15 20:13:21 GMT 2008


bb:resubmit
Please, avoid path modification
if sys.platform == 'win32'

I'm sure it's not needed on Windows.

Toshio Kuratomi пишет:
> Robert Collins wrote:
>> I'm pretty sure distutils isn't always installed in some places
>>
>> so I suggest:
>>
>> @@ -105,6 +107,10 @@ def set_plugins_path():
>>      path = map(_strip_trailing_sep, path)
>>      # search the plugin path before the bzrlib installed dir
>>      path.append(os.path.dirname(_mod_plugins.__file__))
>> +    # search the arch independent path if we can determine it
>> +    try:
>> +        from distutils.sysconfig import get_python_lib
>> +        archless_path = osutils.pathjoin(get_python_lib(), 'bzrlib',
>> +            'plugins')
>> +        if archless_path not in path:
>> +            path.append(archless_path)
>>      _mod_plugins.__path__ = path
>>
> I think we need to catch the exception as well :-).  Patch that does 
> this is attached.  (This one not tested as I'm away from my x86_64 at 
> the moment.)
> 
>>
>> Or, alternatively, calculate the right path during setup.py's execution.
>>
> That won't work as setup.py will detect what's correct on the build 
> machine.  In a noarch package we need to detect what's right on the 
> system that runs bzr.
> 
> -Toshio
> 




More information about the bazaar mailing list