zeitgeist-0.2.0: using "env python" instead of python executable name

Bug #401199 reported by Thomas Klausner
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Zeitgeist Framework
Fix Released
Low
Siegfried Gevatter

Bug Description

The configure script finds out the name of the python executable, here "python2.5".
However, the two scripts zeitgeist-daemon and zeitgeist-datahub use a hardcoded "/usr/bin/env python" in their shebang lines. Please substitute "${PYTHON}" there instead.

Related branches

Revision history for this message
Seif Lotfy (seif) wrote :

Small task for Siegfried

Changed in zeitgeist:
status: New → Triaged
importance: Undecided → Low
assignee: nobody → Siegfried Gevatter (rainct)
milestone: none → 0.3.0
Revision history for this message
Siegfried Gevatter (rainct) wrote : Re: [Bug 401199] Re: zeitgeist-0.2.0: using "env python" instead of python executable name

This is a WONTFIX from my side (feature, not a bug), but I can be
convinced otherwise.

(In any case, we can't just change the files directly because then
Zeitgeist wouldn't run in-place anymore, but some little sed magic in
the Makefiles would do I guess.)

Revision history for this message
Markus Korn (thekorn) wrote :

I don't get why we need magic like ${PYTHON} at all. Isn't /usr/bin/python always linked to the python version preferred by the user? - so wn't fix for me too, unless there is a good reason I'm missing.

Changed in zeitgeist:
status: Triaged → Incomplete
Revision history for this message
Thomas Klausner (tk-giga) wrote :

@Siegfried:
sed magic in the Makefile sounds fine.

@Markus:
In NetBSD pkgsrc, multiple versions of python can be installed at the same time. They are called python2.4, python2.5, ...; also multiple versions of python modules can be installed, once per python version.

Also, pkgsrc doesn't install into /usr, but /usr/pkg by default.

I can't talk about other packaging systems or Linux distributions, but I think pkgsrc isn't the only one that does it like that, since I've seen support for similar schemes in quite a few programs. They usually check for a usable python interpreter in the configure phase and then use it during installation.

So my suggestion is checking for the existence of python, python2.4, python2.5, python2.6 (python3.0/3.1 if supported), overridable from the environment (e.g. ${PYTHONBIN}) and making a rule that replaces the interpreter in the installed files with the found python executable.

Revision history for this message
Seif Lotfy (seif) wrote :

@Thomas can u send a patch please :)

Revision history for this message
Siegfried Gevatter (rainct) wrote :

I'm on it.

Revision history for this message
Siegfried Gevatter (rainct) wrote :

 1184 Siegfried-Angel Gevatter Pujals 2009-11-27
      Substitute "/usr/bin/env python" with the hardcoded path at compile time

Thomas, can you please verify that the fix works for you? :)

Changed in zeitgeist:
status: Incomplete → Fix Released
Revision history for this message
Thomas Klausner (tk-giga) wrote :

I tried the 0.3.0, and the release has a bug:
The zeitgeist-daemon and zeitgeist-datahub files in the distribution have "#! /usr/bin/python" in the first line, so the sed pattern doesn't match.

While looking for the reason, I also stumbled over:
"all-local: zeitgeist-daemon zeitgeist-datahub.py"
in Makefile.am.

Shouldn't this be "all-local: zeitgeist-daemon zeitgeist-datahub" instead? (no ".py" at the end)

Revision history for this message
Siegfried Gevatter (rainct) wrote :

2009/12/2 Thomas Klausner <email address hidden>:
> The zeitgeist-daemon and zeitgeist-datahub files in the distribution have "#! /usr/bin/python" in the first line, so the sed pattern doesn't match.

zeitgeist-daemon and zeitgeist-datahub are generated from
zeitgeist-daemon.py and zeitgeist-datahub.py at configure time, so the
ones included in the tarball aren't used at all (I just haven't
figured out how to have 'make distcheck' not include them).

--
Siegfried-Angel Gevatter Pujals (RainCT)
Free Software Developer 363DEAE3

Revision history for this message
Thomas Klausner (tk-giga) wrote :

Well, then my detailed diagnosis was incorrect; however, the main part was: it doesn't work. zeitgeist-daemon and zeitgeist-datahub start with "#! /usr/bin/python", while config.log contains:
PYTHON='/usr/pkg/bin/python2.6'
which gets forwarded to Makefile as
PYTHON = /usr/pkg/bin/python2.6

Revision history for this message
Siegfried Gevatter (rainct) wrote :

(Correction: in my previous post "configure time" should be "build
time", ie. it's generated when "make" is run).

2009/12/2 Thomas Klausner <email address hidden>:
> Well, then my detailed diagnosis was incorrect; however, the main part was: it doesn't work. zeitgeist-daemon and zeitgeist-datahub start with "#! /usr/bin/python", while config.log contains:
> PYTHON='/usr/pkg/bin/python2.6'

Hmm, no idea why that could happen. Patches welcome.

Revision history for this message
Thomas Klausner (tk-giga) wrote :

I looked at the dependencies in the Makefile and came up with something that looked more useful to me. The attached patch works for me -- please commit :)

Revision history for this message
Siegfried Gevatter (rainct) wrote :

OK. I don't see any difference but I'll trust you on this :).

Thanks for your contribution.

------------------------------------------------------------
revno: 1217
author: Thomas Klausner
committer: Siegfried-Angel Gevatter Pujals <email address hidden>
branch nick: zeitgeist-trunk
timestamp: Tue 2009-12-08 14:50:42 +0100
message:
  Changes to the hashbang substitution in Makefile.am.
------------------------------------------------------------

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.