Re: Set shebang line to default (instead of latest) Python 3 interpreter

2014-01-26 Thread Jakub Wilk

* Ben Finney ben+deb...@benfinney.id.au, 2014-01-26, 17:06:
How can I convince ‘dh_python3’ to set the shebang to the *default* 
Python 3 interpreter?


dh_python3 --shebang=/usr/bin/python3
(if I recall correctly)

--
Jakub Wilk


--
To UNSUBSCRIBE, email to debian-python-requ...@lists.debian.org
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org
Archive: http://lists.debian.org/20140126091920.ga5...@jwilk.net



Re: Set shebang line to default (instead of latest) Python 3 interpreter

2014-01-26 Thread Ben Finney
Jakub Wilk jw...@debian.org writes:

 * Ben Finney ben+deb...@benfinney.id.au, 2014-01-26, 17:06:
  How can I convince ‘dh_python3’ to set the shebang to the *default*
  Python 3 interpreter?

 dh_python3 --shebang=/usr/bin/python3
 (if I recall correctly)

Thanks. So the manpage doesn't say, should I add that option for the
“build” action? The “install” action? Some other action? Reading the
source for ‘dh-python’ isn't very enlightening on this.

The important part is that I need to override the shebang rewrite for
only *some* programs, and leave it with the default behaviour for
others.

How can I make it take action only for specified program files? Which
“override_dh_foo” target should I be intercepting, and how should I be
using “dh_python3 --shebang=/usr/bin/python3 foo” to affect only the
specified programs?

-- 
 \ “Oh, I realize it's a penny here and a penny there, but look at |
  `\  me: I've worked myself up from nothing to a state of extreme |
_o__)  poverty.” —Groucho Marx |
Ben Finney


-- 
To UNSUBSCRIBE, email to debian-python-requ...@lists.debian.org
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org
Archive: http://lists.debian.org/854n4rf1ae@benfinney.id.au



Re: Set shebang line to default (instead of latest) Python 3 interpreter

2014-01-26 Thread Ben Finney
Ben Finney ben+deb...@benfinney.id.au writes:

 Thanks. So the manpage doesn't say, should I add that option for the
 “build” action? The “install” action? Some other action? Reading the
 source for ‘dh-python’ isn't very enlightening on this.

The manpage text “call dh_python3 in the binary-* target” suggests those
are the only targets where ‘dh_python3’ will take effect. Is that right?

-- 
 \   “Nothing is so common as to imitate one's enemies, and to use |
  `\   their weapons.” —Voltaire, _Dictionnaire Philosophique_ |
_o__)  |
Ben Finney


-- 
To UNSUBSCRIBE, email to debian-python-requ...@lists.debian.org
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org
Archive: http://lists.debian.org/85zjmjdm0s@benfinney.id.au



Re: Set shebang line to default (instead of latest) Python 3 interpreter

2014-01-26 Thread Barry Warsaw
On Jan 26, 2014, at 10:19 AM, Jakub Wilk wrote:

* Ben Finney ben+deb...@benfinney.id.au, 2014-01-26, 17:06:
How can I convince ‘dh_python3’ to set the shebang to the *default* Python 3 
interpreter?

dh_python3 --shebang=/usr/bin/python3
(if I recall correctly)

Should that be the default?  There are only a few programs that probably
depend on a specific Python 3 version.

-Barry


--
To UNSUBSCRIBE, email to debian-python-requ...@lists.debian.org
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org
Archive: http://lists.debian.org/20140126130539.4cbaf9bf@anarchist



Re: Set shebang line to default (instead of latest) Python 3 interpreter

2014-01-26 Thread Jakub Wilk

* Ben Finney ben+deb...@benfinney.id.au, 2014-01-26, 22:08:
How can I convince ‘dh_python3’ to set the shebang to the *default* 
Python 3 interpreter?


dh_python3 --shebang=/usr/bin/python3
(if I recall correctly)


Thanks. So the manpage doesn't say, should I add that option for the 
“build” action? The “install” action? Some other action? Reading the 
source for ‘dh-python’ isn't very enlightening on this.


You normally call dh_python3 in binary* targets. (Not sure if that's 
what you're asking, though...)


The important part is that I need to override the shebang rewrite for 
only *some* programs, and leave it with the default behaviour for 
others.


Oops, I missed that bit in your original mail. There's --exclude option 
that looked promising to me, but it doesn't seem to have any effect of 
shebang rewriting. :/


In this case, I think the best you can do is to edit the shebang with 
sed. Adding this after dh_auto_install should do the trick:


sed -i -e '1 s,^#!.*,#!/usr/bin/python3,' 
$(package_install_bin_dir)/python3-coverage

--
Jakub Wilk


--
To UNSUBSCRIBE, email to debian-python-requ...@lists.debian.org
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org
Archive: http://lists.debian.org/20140127002026.ga8...@jwilk.net



Re: Set shebang line to default (instead of latest) Python 3 interpreter

2014-01-26 Thread Ben Finney
Jakub Wilk jw...@debian.org writes:

 You normally call dh_python3 in binary* targets. (Not sure if that's
 what you're asking, though...)

It was, thank you.

 There's --exclude option that looked promising to me, but it doesn't
 seem to have any effect of shebang rewriting. :/

Darn. Well, that is independent confirmation that ‘dh_python3’ can't do
what I'd hoped for.

 In this case, I think the best you can do is to edit the shebang with
 sed. Adding this after dh_auto_install should do the trick:

   sed -i -e '1 s,^#!.*,#!/usr/bin/python3,' 
 $(package_install_bin_dir)/python3-coverage

Great, thank you for investigating this package's specific needs to make
that suggestion. I'll try it.

-- 
 \  “He that would make his own liberty secure must guard even his |
  `\ enemy from oppression.” —Thomas Paine |
_o__)  |
Ben Finney


-- 
To UNSUBSCRIBE, email to debian-python-requ...@lists.debian.org
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org
Archive: http://lists.debian.org/85ha8qdzxb@benfinney.id.au



Set shebang line to default (instead of latest) Python 3 interpreter

2014-01-25 Thread Ben Finney
Howdy all,

How can I convince ‘dh_python3’ to set the shebang to the *default*
Python 3 interpreter?

The way the ‘dh_python3’ tool works (by default?), it will write the
shebang with the full “/usr/bin/python3.X” where “3.X” is whichever
version of Python was used to invoke the install.

For bug#736121 URL:http://bugs.debian.org/736121 I need to convince
the Debian packaging to create a program whose shebang has
‘/usr/bin/python3’, or in some other way get the default Python 3.

The behaviour of ‘dh_python3’ in this regard is pretty hard to follow,
even when I read the source. How can I convince it to use a specific
Python version, or the default Python 3 version, or even a specific
shebang, for writing one particular program?

-- 
 \   “Pinky, are you pondering what I'm pondering?” “Well, I think |
  `\   so, Brain, but ‘apply North Pole’ to what?” —_Pinky and The |
_o__)   Brain_ |
Ben Finney


-- 
To UNSUBSCRIBE, email to debian-python-requ...@lists.debian.org
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org
Archive: http://lists.debian.org/858uu3ff9r@benfinney.id.au