I'm currently going through the "joy" of Python3. Mercurial seems to build itself only for Python 2, which is fine for me, however it's contrib script hg-ssh uses shebang /usr/bin/env python. This broke me being able to push with some SyntaxError on except syntax by Python3. I suggest the simple following sed (possibly in another place) to make sure the script is ran with Python 2: diff -u -r1.1 mercurial-2.4-r1.ebuild --- mercurial-2.4-r1.ebuild 24 Nov 2012 22:42:49 -0000 1.1 +++ mercurial-2.4-r1.ebuild 3 Dec 2012 19:10:23 -0000 @@ -73,6 +73,7 @@ dobin hgeditor || die dobin contrib/hgk || die + sed -i -e '1s/python/python2/' contrib/hg-ssh || die # needs Python 2 dobin contrib/hg-ssh || die rm -f contrib/hgk contrib/hg-ssh || die Just run hg-ssh with python3 to see the SyntaxError.
Don't we have some function that helps rewrite the shebangs these days?
you'd probably mean python_rewrite_shebangs or something I lack the experience here.
Yeah, that would be it. Sorry, I don't have much experience with this, either. Also, my devbox is kinda broken ATM, so I'm not sure when I can get to it. And I think Krzysztof is being retired? Anyway, if you can test with the shebangs thingy, feel free to commit.
This seems to work: diff -u -r1.1 mercurial-2.4-r1.ebuild --- mercurial-2.4-r1.ebuild 24 Nov 2012 22:42:49 -0000 1.1 +++ mercurial-2.4-r1.ebuild 3 Dec 2012 20:41:03 -0000 @@ -59,6 +59,7 @@ src_install() { distutils_src_install + python_convert_shebangs 2 contrib/hg-ssh newbashcomp contrib/bash_completion ${PN} || die It effectively does nothing more than the sed I did before, with a lot of extra code to check, but ignore the validity of the first argument.
Sounds about right. Feel free to commit.
done, thanks