setup.py doesn't accept --prefix= option

Bug #835968 reported by Ed Catmur
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
udev-discover
Fix Released
Medium
Ed Catmur
0.2
Fix Released
Medium
J. Félix Ontañón

Bug Description

capella udev-discover-0.2 # python setup.py build --prefix=/usr
usage: setup.py [global_opts] cmd1 [cmd1_opts] [cmd2 [cmd2_opts] ...]
   or: setup.py --help [cmd1 cmd2 ...]
   or: setup.py --help-commands
   or: setup.py cmd --help

error: option --prefix not recognized

I don't know a huge amount about distutils, but your setup.py looks wrong in its handling of this option.

Tags: install
Revision history for this message
Ed Catmur (ed-catmur) wrote :

Also, without specifying --prefix the data files are installed into /usr but the executable continues to refer to /usr/local:

Traceback (most recent call last):
  File "/usr/bin/udev-discover", line 562, in <module>
    UDevDiscoverGUI()
  File "/usr/bin/udev-discover", line 228, in __init__
    'main_window']):
  File "/usr/lib/python2.7/site-packages/gi/types.py", line 44, in function
    return info.invoke(*args)
glib.GError: Failed to open file '/usr/local/share/udev-discover/udev-discover.ui': No such file or directory

Revision history for this message
Ed Catmur (ed-catmur) wrote :
Revision history for this message
Ed Catmur (ed-catmur) wrote :
tags: added: install
Changed in udev-discover:
status: New → Confirmed
importance: Undecided → Medium
assignee: nobody → Ed Catmur (ed-catmur)
Revision history for this message
J. Félix Ontañón (fontanon) wrote :

Patch merged into master.

Still being one error: it always replaces with /usr/local on udev-discover.in file even if you set /usr as prefix (setup.py line 40)
I've been trying to solve my self with no success. It would be really nice if you could do the work.

Changed in udev-discover:
status: Confirmed → Triaged
status: Triaged → In Progress
Revision history for this message
Ed Catmur (ed-catmur) wrote :

Hm, it works fine for me, using python 2.7.2. How are you invoking setup.py?

Revision history for this message
J. Félix Ontañón (fontanon) wrote :

I'm invoking this way:

$ sudo python setup.py install --prefix=/usr

Is anything wrong?

Revision history for this message
J. Félix Ontañón (fontanon) wrote :

Fix Commited:
https://github.com/fontanon/udev-discover/commit/9b2ca0108676397c6554f4390b9e408840e60e72

The issue was because your solution fixed the setup.py's build command but didn't work with the install one.
I'm adding a patch setup.py after applying yours.
Now --prefix works for build and install commands.

Revision history for this message
J. Félix Ontañón (fontanon) wrote :
Changed in udev-discover:
status: In Progress → Fix Committed
Changed in udev-discover:
status: Fix Committed → Fix Released
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.