andrewhwood / alembic

Automatically exported from code.google.com/p/alembic
Other
0 stars 0 forks source link

Bootstrap fails for boost hierarchy with multiple "boost" entries #174

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Install boost headers to path like 
/path/to/projects/tools/include/boost/1_44_0. 
2. Run python bootstrap program
3. Specify lexical cast header at: 
/path/to/projects/tools/include/boost/1_44_0/boost/lexical_cast.hpp

What is the expected output? 

It correctly identifies that the boost headers are in:

/path/to/projects/tools/include/boost/1_44_0/

What do you see instead?

It calculates that the headers are in:

/path/to/projects/tools/include/

What version of the product are you using? On what operating system?

0.9.3 on Ubuntu 11.04

Please provide any additional information below.

This is because the index method in Path.py in abcutils uses: list.index() 
which returns the left most match of the item in the list. I can't find a neat 
way of doing "rindex" for lists (which is available on strings I think) so you 
can replace the code with:

   169      def index( self, val ):
   170          if val in self:
   171              # Search backwards for val
   172              for i in range( -1, -len(self._plist), -1):
   173                  if self._plist[i] == val:
   174                      return i
   175          else:
   176              raise ValueError, "%s is not in path." % val

In order to search from the right inwards. Solves the problem but possibly 
makes this method less than intuitive. 

I realise my include headers are heavily "subdirectoried" and this is a minor 
issue but wanted to report. 

Cheers,
Michael

Original issue reported on code.google.com by m.pricej...@gmail.com on 11 Jun 2011 at 5:43

GoogleCodeExporter commented 9 years ago
Hi Michael!  Thanks for pointing that out.  For terrible reasons you shouldn't 
need to worry about, I can't actually accept your fix, unless you sign a formal 
contributor's agreement.

So, rather than force you to do paperwork in order to have your problem solved, 
when you've already gone above and beyond the call of duty by proffering a 
solution, I solved it in an alternate way that is probably less efficient, but 
that's probably OK (unless you have a multi-threaded app that is using my Path 
module and calling the index() method on paths with thousands of entries):

http://code.google.com/r/ardent-embic/source/detail?r=ebe2f4caccc50e7ab4cf28801d
a9e31195c1fe44&name=default

This should go into a new release very soon!

Original comment by ard...@gmail.com on 23 Jun 2011 at 9:05

GoogleCodeExporter commented 9 years ago
Hi,

I'm very happy to sign forms if you'd like. Provided they are reasonable. I 
certainly don't desire to have any claim over my contribution and the fact, 
that by offering a solution I block you from using it, is most unfortunate.

I don't have a great investment in Alembic at this point but I'm using it for a 
side project and might use it for more so clearing the way for future 
contributions might be no bad thing.

Though, of course, your solution is fine.

Cheers,
Michael 

Original comment by m.pricej...@gmail.com on 24 Jun 2011 at 2:29