Subject: [UFC-dev] Installation prefix patch

From: "Johannes Ring" <[email-masked]>
Date: Mon, 15 Dec 2008 22:44:43 +0100 (CET)

Hi,

Please apply the attached patch which adds support for specifying the
installation prefix on the form

  python setup.py install --prefix /foo/bar

Currently, only this is supported:

  python setup.py install --prefix=/foo/bar

Both are valid distutils syntax.

Thanks,

Johannes

# HG changeset patch
# User Johannes Ring <[email-masked]>
# Date 1229376663 -3600
# Node ID d779ab717604320f7713b6aa6d151aadf2395159
# Parent  8f4f3a40db98635daf6fdc8e05d06ce39f4f90f2
Added support for specifying installation prefix on the form '--prefix /foo/bar'.

diff -r 8f4f3a40db98 -r d779ab717604 setup.py
--- a/setup.py	Wed Dec 10 17:21:16 2008 +0100
+++ b/setup.py	Mon Dec 15 22:31:03 2008 +0100
@@ -10,8 +10,14 @@
 minor = 1
 
 # Set prefix
-try:    prefix = [item for item in sys.argv[1:] if "--prefix=" in item][0].split("=")[1]
-except: prefix = sys.prefix
+try:
+    prefix = [item for item in sys.argv[1:] \
+              if "--prefix=" in item][0].split("=")[1]
+except:
+    try:
+        prefix = sys.argv[sys.argv.index('--prefix')+1]
+    except:
+        prefix = sys.prefix
 print "Installing UFC under %s..." % prefix
 
 # Generate pkgconfig file