[evolution] [Flatpak] Change how already running services are detected in the wrapper script



commit d124132df6b5f58e4a23e74597aa5d2b7d71e33d
Author: Milan Crha <mcrha redhat com>
Date:   Tue Apr 30 19:00:20 2019 +0200

    [Flatpak] Change how already running services are detected in the wrapper script
    
    Made as suggested at https://gitlab.gnome.org/GNOME/glib/issues/1737#note_476952

 flatpak/org.gnome.Evolution-master.json | 12 ++++++------
 flatpak/org.gnome.Evolution-stable.json | 12 ++++++------
 2 files changed, 12 insertions(+), 12 deletions(-)
---
diff --git a/flatpak/org.gnome.Evolution-master.json b/flatpak/org.gnome.Evolution-master.json
index 45d8bf802e..773d979467 100644
--- a/flatpak/org.gnome.Evolution-master.json
+++ b/flatpak/org.gnome.Evolution-master.json
@@ -264,20 +264,20 @@
                                                "       export GIO_USE_NETWORK_MONITOR=base",
                                                "       gsettings reset org.gnome.evolution-data-server 
network-monitor-gio-name",
                                                "",
-                                               "       gdbus wait --session --timeout=1@TIMEOUTMULT@ 
@SOURCES_SERVICE@",
-                                               "       if [ \"${PIPESTATUS[0]}\" != \"0\" ]; then",
+                                               "       LINES=$(gdbus call --session --dest 
org.freedesktop.DBus --object-path /org/freedesktop/DBus --method org.freedesktop.DBus.ListNames | grep 
@SOURCES_SERVICE@ | wc -l)",
+                                               "       if [ \"${LINES}\" = \"0\" ]; then",
                                                "               /app/libexec/evolution-source-registry &",
                                                "               gdbus wait --session --timeout=1@TIMEOUTMULT@ 
@SOURCES_SERVICE@",
                                                "       fi",
                                                "",
-                                               "       gdbus wait --session --timeout=1@TIMEOUTMULT@ 
@ADDRESSBOOK_SERVICE@",
-                                               "       if [ \"${PIPESTATUS[0]}\" != \"0\" ]; then",
+                                               "       LINES=$(gdbus call --session --dest 
org.freedesktop.DBus --object-path /org/freedesktop/DBus --method org.freedesktop.DBus.ListNames | grep 
@ADDRESSBOOK_SERVICE@ | wc -l)",
+                                               "       if [ \"${LINES}\" = \"0\" ]; then",
                                                "               /app/libexec/evolution-addressbook-factory -r 
&",
                                                "               gdbus wait --session --timeout=1@TIMEOUTMULT@ 
@ADDRESSBOOK_SERVICE@",
                                                "       fi",
                                                "",
-                                               "       gdbus wait --session --timeout=1@TIMEOUTMULT@ 
@CALENDAR_SERVICE@",
-                                               "       if [ \"${PIPESTATUS[0]}\" != \"0\" ]; then",
+                                               "       LINES=$(gdbus call --session --dest 
org.freedesktop.DBus --object-path /org/freedesktop/DBus --method org.freedesktop.DBus.ListNames | grep 
@CALENDAR_SERVICE@ | wc -l)",
+                                               "       if [ \"${LINES}\" = \"0\" ]; then",
                                                "               /app/libexec/evolution-calendar-factory -r &",
                                                "               gdbus wait --session --timeout=1@TIMEOUTMULT@ 
@CALENDAR_SERVICE@",
                                                "       fi",
diff --git a/flatpak/org.gnome.Evolution-stable.json b/flatpak/org.gnome.Evolution-stable.json
index ecdebc546c..56e451e02e 100644
--- a/flatpak/org.gnome.Evolution-stable.json
+++ b/flatpak/org.gnome.Evolution-stable.json
@@ -263,20 +263,20 @@
                                                "       export GIO_USE_NETWORK_MONITOR=base",
                                                "       gsettings reset org.gnome.evolution-data-server 
network-monitor-gio-name",
                                                "",
-                                               "       gdbus wait --session --timeout=1@TIMEOUTMULT@ 
@SOURCES_SERVICE@",
-                                               "       if [ \"${PIPESTATUS[0]}\" != \"0\" ]; then",
+                                               "       LINES=$(gdbus call --session --dest 
org.freedesktop.DBus --object-path /org/freedesktop/DBus --method org.freedesktop.DBus.ListNames | grep 
@SOURCES_SERVICE@ | wc -l)",
+                                               "       if [ \"${LINES}\" = \"0\" ]; then",
                                                "               /app/libexec/evolution-source-registry &",
                                                "               gdbus wait --session --timeout=1@TIMEOUTMULT@ 
@SOURCES_SERVICE@",
                                                "       fi",
                                                "",
-                                               "       gdbus wait --session --timeout=1@TIMEOUTMULT@ 
@ADDRESSBOOK_SERVICE@",
-                                               "       if [ \"${PIPESTATUS[0]}\" != \"0\" ]; then",
+                                               "       LINES=$(gdbus call --session --dest 
org.freedesktop.DBus --object-path /org/freedesktop/DBus --method org.freedesktop.DBus.ListNames | grep 
@ADDRESSBOOK_SERVICE@ | wc -l)",
+                                               "       if [ \"${LINES}\" = \"0\" ]; then",
                                                "               /app/libexec/evolution-addressbook-factory -r 
&",
                                                "               gdbus wait --session --timeout=1@TIMEOUTMULT@ 
@ADDRESSBOOK_SERVICE@",
                                                "       fi",
                                                "",
-                                               "       gdbus wait --session --timeout=1@TIMEOUTMULT@ 
@CALENDAR_SERVICE@",
-                                               "       if [ \"${PIPESTATUS[0]}\" != \"0\" ]; then",
+                                               "       LINES=$(gdbus call --session --dest 
org.freedesktop.DBus --object-path /org/freedesktop/DBus --method org.freedesktop.DBus.ListNames | grep 
@CALENDAR_SERVICE@ | wc -l)",
+                                               "       if [ \"${LINES}\" = \"0\" ]; then",
                                                "               /app/libexec/evolution-calendar-factory -r &",
                                                "               gdbus wait --session --timeout=1@TIMEOUTMULT@ 
@CALENDAR_SERVICE@",
                                                "       fi",


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