mxcl/homebrew — Issue #9593: Potential regexp problem in mercurial.rb
Author: tub78
Created: 2012-01-14 04:03:19+00:00
State: open

I think that the regular expression on line 47 of mercurial.rb need to be improved? If I understand correctly, the purpose of lines 46-7 in mercurial.rb, is to replace:
(1) `#!/usr/bin/env /PATH/TO/python` with (2) `#!/usr/bin/env python`

However, in my installation, I get:
(3) `#!/usr/bin/env /usr/local/Cellar/python/2.7.2/Frameworks/Python.framework/.../MacOS/Python`, replaced with (4) `#!/usr/bin/env python/2.7.2/Frameworks/Python.framework/.../MacOS/Python`

If I revert to (2), editing by hand, the resulting hg appears to be perfectly functional.

For reference, here's lines 46-7:
46: # Remove the hard-coded python invocation from hg
47: inreplace bin+'hg', %r[#!/.*/python], '#!/usr/bin/env python'