|
|
6c9d0f |
From 9d80b0bca3f90e2489aac8e7765081c47e8a66f5 Mon Sep 17 00:00:00 2001
|
|
|
6c9d0f |
From: Colin Walters <walters@verbum.org>
|
|
|
6c9d0f |
Date: Tue, 31 Oct 2017 12:51:09 -0400
|
|
|
6c9d0f |
Subject: [PATCH] gdbus-codegen: Call abspath() earlier
|
|
|
6c9d0f |
|
|
|
6c9d0f |
The previous change from https://bugzilla.gnome.org/show_bug.cgi?id=786785
|
|
|
6c9d0f |
didn't actually work (for me at least) in the `/bin/gdbus-codegen` case
|
|
|
6c9d0f |
as the relative `/bin/../share` path works, but then `os.path.abspath()`
|
|
|
6c9d0f |
breaks it (as it's not doing `realpath()`, and let's not go there).
|
|
|
6c9d0f |
|
|
|
6c9d0f |
Fix this by doing the `abspath` first.
|
|
|
6c9d0f |
|
|
|
6c9d0f |
Downstream: https://bugzilla.redhat.com/show_bug.cgi?id=1507661
|
|
|
6c9d0f |
---
|
|
|
6c9d0f |
gio/gdbus-2.0/codegen/gdbus-codegen.in | 5 ++++-
|
|
|
6c9d0f |
1 file changed, 4 insertions(+), 1 deletion(-)
|
|
|
6c9d0f |
|
|
|
6c9d0f |
diff --git a/gio/gdbus-2.0/codegen/gdbus-codegen.in b/gio/gdbus-2.0/codegen/gdbus-codegen.in
|
|
|
6c9d0f |
index e3f4f00f8..67d367543 100755
|
|
|
6c9d0f |
--- a/gio/gdbus-2.0/codegen/gdbus-codegen.in
|
|
|
6c9d0f |
+++ b/gio/gdbus-2.0/codegen/gdbus-codegen.in
|
|
|
6c9d0f |
@@ -37,6 +37,9 @@ else:
|
|
|
6c9d0f |
# parent directory to the python path.
|
|
|
6c9d0f |
path = os.path.join(filedir, '..')
|
|
|
6c9d0f |
|
|
|
6c9d0f |
+# Canonicalize, then do further testing
|
|
|
6c9d0f |
+path = os.path.abspath(path)
|
|
|
6c9d0f |
+
|
|
|
6c9d0f |
# If the above path detection failed, use the hard-coded datadir. This can
|
|
|
6c9d0f |
# happen when, for instance, bindir and datadir are not in the same prefix or
|
|
|
6c9d0f |
# on Windows where we cannot make any guarantees about the directory structure.
|
|
|
6c9d0f |
@@ -46,7 +49,7 @@ else:
|
|
|
6c9d0f |
if not os.path.isfile(os.path.join(path, 'codegen', 'codegen_main.py')):
|
|
|
6c9d0f |
path = os.path.join('@DATADIR@', 'glib-2.0')
|
|
|
6c9d0f |
|
|
|
6c9d0f |
-sys.path.insert(0, os.path.abspath(path))
|
|
|
6c9d0f |
+sys.path.insert(0, path)
|
|
|
6c9d0f |
from codegen import codegen_main
|
|
|
6c9d0f |
|
|
|
6c9d0f |
sys.exit(codegen_main.codegen_main())
|
|
|
6c9d0f |
--
|
|
|
6c9d0f |
2.13.6
|
|
|
6c9d0f |
|