#!/usr/bin/python -O
-# Copyright 1999-2010 Gentoo Foundation
+# Copyright 1999-2011 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
from __future__ import print_function
+import signal
import sys
# This block ensures that ^C interrupts are handled quietly.
try:
- import signal
def exithandler(signum,frame):
signal.signal(signal.SIGINT, signal.SIG_IGN)
signal.signal(signal.SIGTERM, signal.SIG_IGN)
- sys.exit(1)
+ sys.exit(128 + signum)
signal.signal(signal.SIGINT, exithandler)
signal.signal(signal.SIGTERM, exithandler)
signal.signal(signal.SIGPIPE, signal.SIG_DFL)
except KeyboardInterrupt:
- sys.exit(1)
+ sys.exit(128 + signal.SIGINT)
def debug_signal(signum, frame):
import pdb
#!/usr/bin/python
-# Copyright 2009-2010 Gentoo Foundation
+# Copyright 2009-2011 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
from __future__ import print_function
+import signal
import sys
# This block ensures that ^C interrupts are handled quietly.
try:
- import signal
def exithandler(signum,frame):
signal.signal(signal.SIGINT, signal.SIG_IGN)
signal.signal(signal.SIGTERM, signal.SIG_IGN)
- sys.exit(1)
+ sys.exit(128 + signum)
signal.signal(signal.SIGINT, exithandler)
signal.signal(signal.SIGTERM, exithandler)
except KeyboardInterrupt:
- sys.exit(1)
+ sys.exit(128 + signal.SIGINT)
import codecs
import logging
#!/usr/bin/python
-# Copyright 2006-2009 Gentoo Foundation
+# Copyright 2006-2011 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
from __future__ import print_function
+import signal
import sys
# This block ensures that ^C interrupts are handled quietly.
try:
- import signal
def exithandler(signum,frame):
signal.signal(signal.SIGINT, signal.SIG_IGN)
signal.signal(signal.SIGTERM, signal.SIG_IGN)
- sys.exit(1)
+ sys.exit(128 + signum)
signal.signal(signal.SIGINT, exithandler)
signal.signal(signal.SIGTERM, exithandler)
signal.signal(signal.SIGPIPE, signal.SIG_DFL)
except KeyboardInterrupt:
- sys.exit(1)
+ sys.exit(128 + signal.SIGINT)
def debug_signal(signum, frame):
import pdb
#!/usr/bin/python -O
-# Copyright 1999-2006 Gentoo Foundation
+# Copyright 1999-2011 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
from __future__ import print_function
+import signal
import sys
# This block ensures that ^C interrupts are handled quietly.
try:
- import signal
def exithandler(signum, frame):
signal.signal(signal.SIGINT, signal.SIG_IGN)
signal.signal(signal.SIGTERM, signal.SIG_IGN)
- sys.exit(1)
+ sys.exit(128 + signum)
signal.signal(signal.SIGINT, exithandler)
signal.signal(signal.SIGTERM, exithandler)
except KeyboardInterrupt:
- sys.exit(1)
+ sys.exit(128 + signal.SIGINT)
import os
import subprocess
#!/usr/bin/python -O
-# Copyright 1999-2010 Gentoo Foundation
+# Copyright 1999-2011 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# Next to do: dep syntax checking in mask files
def exithandler(signum=None, frame=None):
logging.fatal("Interrupted; exiting...")
- sys.exit(1)
- os.kill(0, signal.SIGKILL)
+ if signum is None:
+ sys.exit(1)
+ else:
+ sys.exit(128 + signum)
signal.signal(signal.SIGINT,exithandler)
-# Copyright 1999-2010 Gentoo Foundation
+# Copyright 1999-2011 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
from __future__ import print_function
signal.signal(signal.SIGINT, signal.SIG_IGN)
signal.signal(signal.SIGTERM, signal.SIG_IGN)
portage.util.writemsg("\n\nExiting on signal %(signal)s\n" % {"signal":signum})
- sys.exit(100+signum)
+ sys.exit(128 + signum)
signal.signal(signal.SIGINT, emergeexitsig)
signal.signal(signal.SIGTERM, emergeexitsig)