[WPE][GTK] run-minibrowser improperly creates webkit-flatpak environment
authormcatanzaro@igalia.com <mcatanzaro@igalia.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 10 Dec 2018 14:58:31 +0000 (14:58 +0000)
committermcatanzaro@igalia.com <mcatanzaro@igalia.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 10 Dec 2018 14:58:31 +0000 (14:58 +0000)
https://bugs.webkit.org/show_bug.cgi?id=190241

Reviewed by Carlos Garcia Campos.

run-minibrowser calls into webkit-flatpak to check if a flatpak environment is available.
Currently this actually creates the directories needed for the flatpak environment. Fix it.

* flatpak/flatpakutils.py:
(WebkitFlatpak.clean_args):
(WebkitFlatpak.run):

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

Tools/ChangeLog
Tools/flatpak/flatpakutils.py

index 2452823..5f8a578 100644 (file)
@@ -1,5 +1,19 @@
 2018-12-10  Michael Catanzaro  <mcatanzaro@igalia.com>
 
+        [WPE][GTK] run-minibrowser improperly creates webkit-flatpak environment
+        https://bugs.webkit.org/show_bug.cgi?id=190241
+
+        Reviewed by Carlos Garcia Campos.
+
+        run-minibrowser calls into webkit-flatpak to check if a flatpak environment is available.
+        Currently this actually creates the directories needed for the flatpak environment. Fix it.
+
+        * flatpak/flatpakutils.py:
+        (WebkitFlatpak.clean_args):
+        (WebkitFlatpak.run):
+
+2018-12-10  Michael Catanzaro  <mcatanzaro@igalia.com>
+
         [GTK] Don't use the slice allocator
         https://bugs.webkit.org/show_bug.cgi?id=192360
 
index 6a8ed54..715a37a 100644 (file)
@@ -55,12 +55,6 @@ FLATPAK_REQ = [
 scriptdir = os.path.abspath(os.path.dirname(__file__))
 _log = logging.getLogger(__name__)
 
-os.environ["FLATPAK_USER_DIR"] = os.environ.get("WEBKIT_FLATPAK_USER_DIR", os.path.realpath(os.path.join(scriptdir, "../../WebKitBuild", "UserFlatpak")))
-try:
-    os.makedirs(os.environ["FLATPAK_USER_DIR"])
-except OSError as e:
-    pass
-
 
 class Colors:
     HEADER = "\033[95m"
@@ -599,6 +593,12 @@ class WebkitFlatpak:
         self.manifest_path = os.path.abspath(os.path.join(scriptdir, '../flatpak/org.webkit.WebKit.yaml'))
         self.build_name = self.name + "-generated"
 
+        os.environ["FLATPAK_USER_DIR"] = os.environ.get("WEBKIT_FLATPAK_USER_DIR", os.path.realpath(os.path.join(scriptdir, "../../WebKitBuild", "UserFlatpak")))
+        try:
+            os.makedirs(os.environ["FLATPAK_USER_DIR"])
+        except OSError as e:
+            pass
+
         build_root = os.path.join(self.source_root, 'WebKitBuild')
         self.flatpak_build_path = os.path.join(build_root, self.platform, "FlatpakTree" + self.build_type)
         self.cache_path = os.path.join(build_root, "FlatpakCache")
@@ -755,12 +755,12 @@ class WebkitFlatpak:
         return 0
 
     def run(self):
-        if not self.clean_args():
-            return 1
-
         if self.check_available:
             return 0
 
+        if not self.clean_args():
+            return 1
+
         if self.clean:
             if os.path.exists(self.flatpak_build_path):
                 shutil.rmtree(self.flatpak_build_path)