[gnome-settings-daemon] power: Look for the real gnome-session-binary



commit 4bbdc9f0d931c5e71fab0e126be6c2e5e7820b8c
Author: Bastien Nocera <hadess hadess net>
Date:   Tue Jan 17 13:28:13 2017 +0100

    power: Look for the real gnome-session-binary
    
    We now go through a helper script to launch gnome-session, so extract
    the path to the binary before checking what it's linked against.

 plugins/power/test.py |   10 ++++++++++
 1 files changed, 10 insertions(+), 0 deletions(-)
---
diff --git a/plugins/power/test.py b/plugins/power/test.py
index fc9a16b..0399503 100755
--- a/plugins/power/test.py
+++ b/plugins/power/test.py
@@ -178,6 +178,16 @@ class PowerPluginTest(gsdtestcase.GSDTestCase):
 
         path = GLib.find_program_in_path ('gnome-session')
         assert(path)
+        (success, data) = GLib.file_get_contents (path)
+        lines = data.split('\n')
+        new_path = None
+        for line in lines:
+            items = line.split()
+            if items and items[0] == 'exec':
+                new_path = items[1]
+        if not new_path:
+            self.fail("could not get gnome-session's real path from %s" % path)
+        path = new_path
         ldd = subprocess.Popen(['ldd', path], stdout=subprocess.PIPE)
         out = ldd.communicate()[0]
         if not 'libsystemd-login.so.0' in out:


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