Changeset 236261 in webkit


Ignore:
Timestamp:
Sep 20, 2018, 9:12:30 AM (7 years ago)
Author:
commit-queue@webkit.org
Message:

[WPE][GTK] webkit-flatpak intercepts --help for other commands
https://bugs.webkit.org/show_bug.cgi?id=189058

The approach of run_in_sandbox_if_available is that we basically have the
same set of arguments to setup the sandbox (ie. port name, build type, etc...)
and we can pass those args first to setup the flatpak launcher object
and then to the underlying script. That doesn't work well with the --help argument
as once processed it 1. prints the help (which make no sense to the user of the calling script)

  1. exits the app - The solution is to just make sure that --help is not used when using

flatpakutils from any script that is not webkit-flatpak itself.

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

  • flatpak/flatpakutils.py:

(WebkitFlatpak.load_from_args):
(run_in_sandbox_if_available):

Location:
trunk/Tools
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Tools/ChangeLog

    r236244 r236261  
     12018-09-20  Thibault Saunier  <tsaunier@igalia.com>
     2
     3        [WPE][GTK] webkit-flatpak intercepts --help for other commands
     4        https://bugs.webkit.org/show_bug.cgi?id=189058
     5
     6        The approach of run_in_sandbox_if_available is that we basically have the
     7        same set of arguments to setup the sandbox (ie. port name, build type, etc...)
     8        and we can pass those args first to setup the flatpak launcher object
     9        and then to the underlying script. That doesn't work well with the `--help` argument
     10        as once processed it 1. prints the help (which make no sense to the user of the calling script)
     11        2. exits the app - The solution is to just make sure that `--help` is not used when using
     12        flatpakutils from any script that is not `webkit-flatpak` itself.
     13
     14        Reviewed by Michael Catanzaro.
     15
     16        * flatpak/flatpakutils.py:
     17        (WebkitFlatpak.load_from_args):
     18        (run_in_sandbox_if_available):
     19
    1202018-09-20  Xabier Rodriguez Calvar  <calvaris@igalia.com>
    221
  • trunk/Tools/flatpak/flatpakutils.py

    r236203 r236261  
    464464
    465465    @staticmethod
    466     def load_from_args(args=None):
     466    def load_from_args(args=None, add_help=True):
    467467        self = WebkitFlatpak()
    468468
    469         parser = argparse.ArgumentParser(prog="webkit-flatpak")
     469        parser = argparse.ArgumentParser(prog="webkit-flatpak", add_help=add_help)
    470470        general = parser.add_argument_group("General")
    471471        general.add_argument('--verbose', action='store_true',
     
    857857        return None
    858858
    859     flatpak_runner = WebkitFlatpak.load_from_args(args)
     859    flatpak_runner = WebkitFlatpak.load_from_args(args, add_help=False)
    860860    if not flatpak_runner.clean_args():
    861861        return None
Note: See TracChangeset for help on using the changeset viewer.