Re: [PATCH] svnrdump_sim: start the script with /usr/bin/env python

2 messages, 2 authors, 2016-06-15 · open the first message on its own page

Re: [PATCH] svnrdump_sim: start the script with /usr/bin/env python

From: Junio C Hamano <hidden>
Date: 2016-06-15 22:55:27

Christian Couder [off-list ref] writes:
On Wed, Nov 28, 2012 at 9:03 AM, Felipe Contreras
[off-list ref] wrote:
quoted
On Wed, Nov 28, 2012 at 8:36 AM, Junio C Hamano [off-list ref] wrote:
quoted
Christian Couder [off-list ref] writes:
quoted
All the python scripts except contrib/svn-fe/svnrdump_sim.py
start with "#!/usr/bin/env python".

This patch fix contrib/svn-fe/svnrdump_sim.py to do the same.
I suspect you need a bit more than that.

    $ make git-p4
    $ diff -u git-p4.py git-p4

shows you how we tell the scripts how to find their interpreters
(that way, there is no need to rely on the existence of
/usr/bin/env).
That works if somebody managed to export PYTHON_PATH, which very very
often is not the case for me.
Yeah, and even if PYTHON_PATH is used, in t9020-remote-svn.sh,
svnrdump.py is used as is.
You need a fix for that; didn't I already say "you need a bit more
than that"?

Re: [PATCH] svnrdump_sim: start the script with /usr/bin/env python

From: Felipe Contreras <hidden>
Date: 2016-06-15 22:55:27

On Wed, Nov 28, 2012 at 5:57 PM, Junio C Hamano [off-list ref] wrote:
Christian Couder [off-list ref] writes:
quoted
On Wed, Nov 28, 2012 at 9:03 AM, Felipe Contreras
[off-list ref] wrote:
quoted
quoted
That works if somebody managed to export PYTHON_PATH, which very very
often is not the case for me.
Yeah, and even if PYTHON_PATH is used, in t9020-remote-svn.sh,
svnrdump.py is used as is.
You need a fix for that; didn't I already say "you need a bit more
than that"?
I disagree. Most of the contrib scripts are expected to be used as
they are. There's no step in the Makefile that will convert them, and
it's up to each distribution to decide what to do with them. This is
what Arch Linux does:

  # more contrib stuff
  cp -a ./contrib/* $pkgdir/usr/share/git/
  # scripts are for python 2.x
  sed -i 's|#![ ]*/usr/bin/env python|#!/usr/bin/env python2|' \
    $(find "$pkgdir" -name '*.py') \
    "$pkgdir"/usr/lib/git-core/git-p4 \
    "$pkgdir"/usr/share/git/gitview/gitview

At some point we might decide to change this, but at the moment
contrib scripts are pretty much stand-alone.

Cheers.

-- 
Felipe Contreras
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help