Skip to content
Permalink
Browse files
[Flatpak] Use our own check of flatpak repos
https://bugs.webkit.org/show_bug.cgi?id=190194

Allowing us to not mess up with user installation
and "--assumeyes" everywhere.

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

* flatpak/flatpakutils.py:
(FlatpakPackage.__init__):
(FlatpakPackage.install):
(FlatpakPackage.update):
(WebkitFlatpak.load_from_args):
(WebkitFlatpak.__init__):
(WebkitFlatpak.clean_args):

Canonical link: https://commits.webkit.org/205153@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@236743 268f45cc-cd09-0410-ab3c-d52691b4dbfc
  • Loading branch information
thiblahute authored and webkit-commit-queue committed Oct 2, 2018
1 parent d2aacaa commit fc049d576d563b5a1faeb4debac0633dfd189875
Showing 2 changed files with 33 additions and 20 deletions.
@@ -1,3 +1,21 @@
2018-10-02 Thibault Saunier <tsaunier@igalia.com>

[Flatpak] Use our own check of flatpak repos
https://bugs.webkit.org/show_bug.cgi?id=190194

Allowing us to not mess up with user installation
and "--assumeyes" everywhere.

Reviewed by Michael Catanzaro.

* flatpak/flatpakutils.py:
(FlatpakPackage.__init__):
(FlatpakPackage.install):
(FlatpakPackage.update):
(WebkitFlatpak.load_from_args):
(WebkitFlatpak.__init__):
(WebkitFlatpak.clean_args):

2018-10-02 Wenson Hsieh <wenson_hsieh@apple.com>

[macOS] Implement a way for the UI process to request typing attributes at the current selection
@@ -55,6 +55,12 @@
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"
@@ -390,15 +396,14 @@ def repo_file(self):
class FlatpakPackage(FlatpakObject):
"""A flatpak app."""

def __init__(self, name, branch, repo, arch, user=True, hash=None, assumeyes=False):
def __init__(self, name, branch, repo, arch, user=True, hash=None):
FlatpakObject.__init__(self, user=user)

self.name = name
self.branch = str(branch)
self.repo = repo
self.arch = arch
self.hash = hash
self.assumeyes = assumeyes

def __str__(self):
return "%s/%s/%s %s" % (self.name, self.arch, self.branch, self.repo.name)
@@ -421,10 +426,7 @@ def install(self):
if not self.repo:
return False

args = ["install", self.repo.name, self.name, "--reinstall", self.branch]

if self.assumeyes:
args.append("--assumeyes")
args = ["install", self.repo.name, self.name, "--reinstall", self.branch, "--assumeyes"]

self.flatpak(*args, show_output=True,
comment="Installing from " + self.repo.name + " " +
@@ -440,8 +442,7 @@ def update(self):
extra_args = ["--commit", self.hash]
comment += " to %s" % self.hash

if self.assumeyes:
extra_args.append("--assumeyes")
extra_args.append("--assumeyes")

self.flatpak("update", self.name, self.branch, show_output=True,
*extra_args, comment=comment)
@@ -502,9 +503,6 @@ def load_from_args(args=None, add_help=True):
nargs=argparse.REMAINDER,
help="The command to run in the sandbox",
dest="user_command")
general.add_argument("-y", "--assumeyes",
help="Automatically answer yes for all questions.",
action="store_true")
general.add_argument('--available', action='store_true', dest="check_available", help='Check if required dependencies are available.'),
general.add_argument("--use-icecream", help="Use the distributed icecream (icecc) compiler.", action="store_true")

@@ -562,7 +560,6 @@ def __init__(self):
self.app_module = None
self.flatpak_default_args = []
self.check_available = False
self.assumeyes = False

# Default application to run in the sandbox
self.command = None
@@ -581,6 +578,8 @@ def __init__(self):

def clean_args(self):
configure_logging(logging.DEBUG if self.verbose else logging.INFO)
_log.debug("Using flatpak user dir: %s" % os.environ["FLATPAK_USER_DIR"])

if not self.debug and not self.release:
factory = PortFactory(SystemHost())
port = factory.get(self.platform)
@@ -631,21 +630,17 @@ def clean_args(self):
self.finish_args = remove_extension_points(self.finish_args)
self.runtime = FlatpakPackage("org.gnome.Platform", self.sdk_branch,
self.sdk_repo, "x86_64",
hash=manifest.get("runtime-hash"),
assumeyes=self.assumeyes)
hash=manifest.get("runtime-hash"))
self.locale = FlatpakPackage("org.gnome.Platform.Locale",
self.sdk_branch, self.sdk_repo, "x86_64",
assumeyes=self.assumeyes)
self.sdk_branch, self.sdk_repo, "x86_64")
self.sdk = FlatpakPackage("org.gnome.Sdk", self.sdk_branch,
self.sdk_repo, "x86_64",
hash=manifest.get("sdk-hash"),
assumeyes=self.assumeyes)
hash=manifest.get("sdk-hash"))
self.packs = [self.runtime, self.locale, self.sdk]

if self.debug:
self.sdk_debug = FlatpakPackage("org.gnome.Sdk.Debug", self.sdk_branch,
self.sdk_repo, "x86_64",
assumeyes=self.assumeyes)
self.sdk_repo, "x86_64")
self.packs.append(self.sdk_debug)
self.manifest_generated_path = os.path.join(self.cache_path,
self.build_name + ".json")

0 comments on commit fc049d5

Please sign in to comment.