[glib] gdbus-codegen: Call abspath() earlier



commit cb8bfa758fd14794ffeb9cf62fe2a51886b5a6ac
Author: Colin Walters <walters verbum org>
Date:   Tue Oct 31 12:51:09 2017 -0400

    gdbus-codegen: Call abspath() earlier
    
    The previous change from https://bugzilla.gnome.org/show_bug.cgi?id=786785
    didn't actually work (for me at least) in the `/bin/gdbus-codegen` case
    as the relative `/bin/../share` path works, but then `os.path.abspath()`
    breaks it (as it's not doing `realpath()`, and let's not go there).
    
    Fix this by doing the `abspath` first.
    
    Downstream: https://bugzilla.redhat.com/show_bug.cgi?id=1507661
    
    https://bugzilla.gnome.org/show_bug.cgi?id=789723

 gio/gdbus-2.0/codegen/gdbus-codegen.in |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)
---
diff --git a/gio/gdbus-2.0/codegen/gdbus-codegen.in b/gio/gdbus-2.0/codegen/gdbus-codegen.in
index e3f4f00..67d3675 100755
--- a/gio/gdbus-2.0/codegen/gdbus-codegen.in
+++ b/gio/gdbus-2.0/codegen/gdbus-codegen.in
@@ -37,6 +37,9 @@ else:
     # parent directory to the python path.
     path = os.path.join(filedir, '..')
 
+# Canonicalize, then do further testing
+path = os.path.abspath(path)
+
 # If the above path detection failed, use the hard-coded datadir. This can
 # happen when, for instance, bindir and datadir are not in the same prefix or
 # on Windows where we cannot make any guarantees about the directory structure.
@@ -46,7 +49,7 @@ else:
 if not os.path.isfile(os.path.join(path, 'codegen', 'codegen_main.py')):
     path = os.path.join('@DATADIR@', 'glib-2.0')
 
-sys.path.insert(0, os.path.abspath(path))
+sys.path.insert(0, path)
 from codegen import codegen_main
 
 sys.exit(codegen_main.codegen_main())


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]