Changeset 233979 in webkit
- Timestamp:
- Jul 19, 2018 1:24:27 AM (6 years ago)
- Location:
- trunk/Tools
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Tools/ChangeLog
r233944 r233979 1 2018-07-19 Thibault Saunier <tsaunier@igalia.com> 2 3 [Flatpak] Let flatpak process handle SIGINT 4 https://bugs.webkit.org/show_bug.cgi?id=187521 5 6 Reviewed by Philippe Normand. 7 8 Ensuring that flatpak process ends properly and that the sandbox is teard down. 9 It also avoids showing usless backtrace to the end user and makes gdb 10 much more usable. 11 12 Also make flatpakutils not verbose by default 13 14 * flatpak/flatpakutils.py: 15 (disable_signals): 16 (WebkitFlatpak.run_in_sandbox): 17 (WebkitFlatpak.run_gdb): 18 1 19 2018-07-18 Stephan Szabo <stephan.szabo@sony.com> 2 20 -
trunk/Tools/flatpak/flatpakutils.py
r233681 r233979 21 21 except ImportError: 22 22 import ConfigParser as configparser 23 from contextlib import contextmanager 23 24 import errno 24 25 import json … … 26 27 import shlex 27 28 import shutil 29 import signal 28 30 import subprocess 29 31 import sys … … 443 445 self.flatpak("update", self.name, self.branch, show_output=True, 444 446 *extra_args, comment=comment) 447 448 449 @contextmanager 450 def disable_signals(signals=[signal.SIGINT]): 451 old_signal_handlers = [] 452 453 for disabled_signal in signals: 454 old_signal_handlers.append((disabled_signal, signal.getsignal(disabled_signal))) 455 signal.signal(disabled_signal, signal.SIG_IGN) 456 457 yield 458 459 for disabled_signal, previous_handler in old_signal_handlers: 460 signal.signal(disabled_signal, previous_handler) 445 461 446 462 … … 518 534 self.app = None 519 535 520 self.verbose = True536 self.verbose = False 521 537 self.quiet = False 522 538 self.packs = [] … … 705 721 flatpak_command.extend(['sh', "/run/host/" + tmpscript.name]) 706 722 707 try: 708 subprocess.check_call(flatpak_command, stdout=stdout) 709 except subprocess.CalledProcessError as e: 710 sys.stderr.write(str(e) + "\n") 711 return e.returncode 723 with disable_signals(): 724 try: 725 subprocess.check_call(flatpak_command, stdout=stdout) 726 except subprocess.CalledProcessError as e: 727 sys.stderr.write(str(e) + "\n") 728 return e.returncode 712 729 713 730 return 0 … … 795 812 796 813 def run_gdb(self): 797 try: 798 subprocess.check_output(['which', 'coredumpctl']) 799 except subprocess.CalledProcessError as e: 800 sys.stderr.write("'coredumpctl' not present on the system, can't run. (%s)\n" % e) 801 return e.returncode 814 with disable_signals(): 815 try: 816 subprocess.check_output(['which', 'coredumpctl']) 817 except subprocess.CalledProcessError as e: 818 sys.stderr.write("'coredumpctl' not present on the system, can't run. (%s)\n" % e) 819 return e.returncode 802 820 803 821 # We need access to the host from the sandbox to run.
Note: See TracChangeset
for help on using the changeset viewer.