[Distutils] setuptools 0.6c7 and zc.buildout: find-links egg fragment issue

Tarek Ziadé ziade.tarek at gmail.com
Thu Feb 7 21:42:03 CET 2008


Hello,

If I create a buildout that uses subversion links to get some eggs, with a
download cache, like
this (I can provide a test case):

  [buildout]

  find-links =
      http://svn.example.com/my.package/trunk#egg=my.package
      http://svn.example.com/my.package2/trunk#egg=my.package2

  egg =
      my.package
      my.package2

  download-cache = /Users/tziade/.buildout/downloads/

It will fail because setuptools will try to extract the egg name from the
url, using 
this code in package_index._download_url:

  name = filter(None,urlparse.urlparse(url)[2].split('/'))

The name will then be "trunk" and the method will fail to work properly on
the next
download (my.package2) because the "trunk" folder will already be there:

  IOError:
  [Errno 21] Is a directory: '/Users/tziade/.buildout/downloads/trunk'


That's because the function should extract the egg name from the egg
fragment.
If I add this code there:

  if '#egg=' in url:
     name = url.split('#=egg')[-1].strip()
  else:
     ... existing code to get the name..

It will work fine, because it will use unique egg names for folders.
I would like to suggest changing the code this way.

++
Tarek


-- 
View this message in context: http://www.nabble.com/setuptools-0.6c7-and-zc.buildout%3A-find-links-egg-fragment-issue-tp15342830p15342830.html
Sent from the Python - distutils-sig mailing list archive at Nabble.com.



More information about the Distutils-SIG mailing list