Make check_flatpak() not verbose when only trying to run command inside flatpak
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 30 Jun 2018 14:24:22 +0000 (14:24 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 30 Jun 2018 14:24:22 +0000 (14:24 +0000)
https://bugs.webkit.org/show_bug.cgi?id=187187

Patch by Thibault Saunier <tsaunier@igalia.com> on 2018-06-30
Reviewed by Michael Catanzaro.

* flatpak/flatpakutils.py:
(run_in_sandbox_if_available):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@233395 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Tools/ChangeLog
Tools/flatpak/flatpakutils.py

index 1a9bd72..b07b6b4 100644 (file)
@@ -1,3 +1,13 @@
+2018-06-30  Thibault Saunier  <tsaunier@igalia.com>
+
+        Make check_flatpak() not verbose when only trying to run command inside flatpak
+        https://bugs.webkit.org/show_bug.cgi?id=187187
+
+        Reviewed by Michael Catanzaro.
+
+        * flatpak/flatpakutils.py:
+        (run_in_sandbox_if_available):
+
 2018-06-29  Daniel Bates  <dabates@apple.com>
 
         build-webkit: Perl "use of uninitialized value $previousContents"
index a54d446..e3bca09 100644 (file)
@@ -75,7 +75,7 @@ class Console:
         sys.stdout.flush()
 
 
-def check_flatpak():
+def check_flatpak(verbose=True):
     # Flatpak is only supported on Linux.
     if not sys.platform.startswith("linux"):
         return False
@@ -84,12 +84,13 @@ def check_flatpak():
         try:
             output = subprocess.check_output([app, "--version"])
         except (subprocess.CalledProcessError, OSError):
-            Console.message("\n%sYou need to install %s >= %s"
-                            " to be able to use the '%s' script.\n\n"
-                            "You can find some informations about"
-                            " how to install it for your distribution at:\n"
-                            "    * http://flatpak.org/%s\n", Colors.FAIL,
-                            app, required_version, sys.argv[0], Colors.ENDC)
+            if verbose:
+                Console.message("\n%sYou need to install %s >= %s"
+                                " to be able to use the '%s' script.\n\n"
+                                "You can find some informations about"
+                                " how to install it for your distribution at:\n"
+                                "    * http://flatpak.org/%s\n", Colors.FAIL,
+                                app, required_version, sys.argv[0], Colors.ENDC)
             return False
 
         def comparable_version(version):
@@ -810,7 +811,7 @@ def run_in_sandbox_if_available(args):
     if is_sandboxed():
         return None
 
-    if not check_flatpak():
+    if not check_flatpak(verbose=False):
         return None
 
     flatpak_runner = WebkitFlatpak.load_from_args(args)