h2def configure test should consider installs that have .pyc without .py

Bug #743881 reported by Arkadiusz Miśkiewicz
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
ntrack
Fix Released
High
Alexander Sack

Bug Description

  if test -x /usr/share/pygobject/2.0/codegen/h2def.py; then
    H2DEF=/usr/share/pygobject/2.0/codegen/h2def.py
    PYG_CODEGEN=pygobject-codegen-2.0

Note that this test doesn't seem good.

First py files could not be there. It's perfectly fine to have only *.pyc or *.pyo files (just like on my system).

Also here that file is not executable and can be called only by "python file.pyc" instead of just file.pyc.

Related branches

Revision history for this message
Alexander Sack (asac) wrote :

> First py files could not be there. It's perfectly fine to have only *.pyc or *.pyo files (just like on my system).

what do you have in /usr/bin/pygobject-codegen-2.0 ?

I see ... exec /usr/bin/python $codegendir/codegen.py "$@" here

do you have a .pyc there?

Revision history for this message
Arkadiusz Miśkiewicz (arekm) wrote :

$ cat /usr/bin/pygobject-codegen-2.0
#!/bin/sh

prefix=/usr
datarootdir=${prefix}/share
datadir=/usr/share
codegendir=${datadir}/pygobject/2.0/codegen

PYTHONPATH=$codegendir
export PYTHONPATH

if [ -f $codegendir/codegen.pyc ]; then
        codegenexe="$codegendir/codegen.pyc"
else
        codegenexe="$codegendir/codegen.py"
fi

exec /usr/bin/python $codegenexe "$@"

Revision history for this message
Alexander Sack (asac) wrote :

please checkout bzr branch:
 lp:~asac/ntrack/lp743881

patch attampt is: http://bazaar.launchpad.net/~asac/ntrack/lp743881/revision/285

let me know if thats good enough for your purpose.

Changed in ntrack:
assignee: nobody → Alexander Sack (asac)
importance: Undecided → High
status: New → In Progress
milestone: none → 014
Revision history for this message
Alexander Sack (asac) wrote :

oh, also: what version of pygobject are you running?

Revision history for this message
Arkadiusz Miśkiewicz (arekm) wrote :

2.28 but that above comes from local distro patch.

Could you use
PYTHON=python
and then call like $PYTHON something in configure.in ? That will allow to easier pointing PYTHON to specified binary. Like ./configure PYTHON=/usr/bin/python2 etc.

Alexander Sack (asac)
summary: - h2def checking problem
+ h2def configure test should consider installs that have .pyc without .py
Revision history for this message
Alexander Sack (asac) wrote :

yeah, I can try to make PYTHON configurable.

BTW, our ubuntu python guru told me that no .py files is not really something supported for all corner cases; so basically it's expected that folks have to patch stuff if they opt-in to remove all .py ;).

Revision history for this message
Alexander Sack (asac) wrote :

for commit log: what distro are you running?

Revision history for this message
Arkadiusz Miśkiewicz (arekm) wrote :

Kind of "own" - www.pld-linux.org

Revision history for this message
Alexander Sack (asac) wrote :

------------------------------------------------------------
revno: 285 [merge]
fixes bug(s): https://launchpad.net/bugs/743881
committer: Alexander Sack <email address hidden>
branch nick: ntrack
timestamp: Sun 2011-04-03 12:49:45 +0200
message:
  merge::build: improve H2DEF detect; recognize .pyc and .py extensions - lp:743881
  + merged branch lp:~asac/ntrack/lp743881
  + reported by arekm as needed for http://www.pld-linux.org
------------------------------------------------------------

Changed in ntrack:
status: In Progress → Fix Committed
Revision history for this message
Alexander Sack (asac) wrote :
Changed in ntrack:
milestone: 014 → none
status: Fix Committed → Fix Released
milestone: none → 014
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.