Bug 73837 - #!/usr/bin/python in data/ontology2code
Summary: #!/usr/bin/python in data/ontology2code
Status: RESOLVED FIXED
Alias: None
Product: Zeitgeist
Classification: Unclassified
Component: libzeitgeist (show other bugs)
Version: unspecified
Hardware: Other FreeBSD
: medium normal
Assignee: zeitgeist-bugs@lists.freedesktop.org
QA Contact: zeitgeist-bugs@lists.freedesktop.org
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-01-20 15:22 UTC by Ting-Wei Lan
Modified: 2015-09-16 17:01 UTC (History)
2 users (show)

See Also:
i915 platform:
i915 features:


Attachments
[PATCH] ontology2code: don't hardcode python path (632 bytes, text/plain)
2014-03-15 15:36 UTC, Allison Lortie (desrt)
Details
[PATCH] test/dbus: don't hardcode python path (3.30 KB, patch)
2015-02-03 06:27 UTC, Ting-Wei Lan
Details | Splinter Review

Description Ting-Wei Lan 2014-01-20 15:22:19 UTC
Some systems may not have python installed in /usr/bin. Can we change it to #!@PYTHON@ and fill in the value via autoconf in configure.ac?
Comment 1 Allison Lortie (desrt) 2014-02-14 02:48:07 UTC
This script doesn't get installed so it would probably be easier to just use the typical 'env' trick...

ie:

#!/usr/bin/env python
Comment 2 Antoine Jacoutot 2014-02-16 22:41:54 UTC
(In reply to comment #1)
> This script doesn't get installed so it would probably be easier to just use
> the typical 'env' trick...

Some systems don't install the python binary as 'python' but rather as python2 or python2.7 or python3.3 ... and such.
Comment 3 Ting-Wei Lan 2014-02-17 05:18:54 UTC
If we can detect the correct python binary in configure, we can use @PYTHON@ or modify the Makefile to use $(PYTHON) to execute the script.
Comment 4 Antoine Jacoutot 2014-03-03 08:53:03 UTC
(In reply to comment #3)
> If we can detect the correct python binary in configure, we can use @PYTHON@
> or modify the Makefile to use $(PYTHON) to execute the script.

Here are the files where 'python' or '/usr/bin/python' is hardcoded. And yes, I agree we could use @PYTHON@ (and something like $PYTHON in configure.ac).

Tests and tools might not be that big of a deal since they're not installed/run as part of the build afaics and one can always run then manually using the correct path to the python interpreter.

configure.ac
data/ontology2code
test/dbus/monitor-test.py
test/dbus/upgrade-test.py
test/dbus/remote-test.py
test/dbus/engine-test.py
test/dbus/histogram-test.py
test/dbus/result-types-test.py
test/dbus/blacklist-test.py
test/dbus/run-all-tests.py
test/dbus/dsr-test.py
tools/tali
Comment 5 Allison Lortie (desrt) 2014-03-15 15:36:59 UTC
Created attachment 95858 [details]
[PATCH] ontology2code: don't hardcode python path

Use the typical /usr/bin/env trick to find python.
Comment 6 Ting-Wei Lan 2015-02-03 06:27:48 UTC
Created attachment 113084 [details] [review]
[PATCH] test/dbus: don't hardcode python path

I find we still need to patch several files in test/dbus to make the test work.
Comment 7 Rico Tzschichholz 2015-06-27 20:48:48 UTC
commit 12b291c2cc516ad9b1c4943b0e5d7501853fd330
Author: Ting-Wei Lan <lantw@src.gnome.org>
Date:   Tue Feb 3 14:24:42 2015 +0800

    test/dbus: don't hardcode python path
    
    https://bugs.freedesktop.org/show_bug.cgi?id=73837


commit d36d90fd0366b84c2e466963c49ad4b48ca740cb
Author: Ryan Lortie <desrt@desrt.ca>
Date:   Sat Mar 15 11:40:10 2014 -0400

    ontology2code: don't hardcode python path
    
    Use the typical /usr/bin/env trick to find python.
    
    https://bugs.freedesktop.org/show_bug.cgi?id=73837
Comment 8 BigBoo13 2015-09-16 17:01:44 UTC
Comment on attachment 95858 [details]
[PATCH] ontology2code: don't hardcode python path

persons i.d search


Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.