* [gentoo-commits] proj/catalyst:pending commit in: bin/, catalyst/base/
@ 2017-03-09 10:02 Brian Dolbec
0 siblings, 0 replies; 4+ messages in thread
From: Brian Dolbec @ 2017-03-09 10:02 UTC (permalink / raw
To: gentoo-commits
commit: 106c588e852927d244df2a9b66d188c60252e31d
Author: Brian Dolbec <dolsen <AT> gentoo <DOT> org>
AuthorDate: Tue Sep 8 06:15:25 2015 +0000
Commit: Brian Dolbec <dolsen <AT> gentoo <DOT> org>
CommitDate: Thu Mar 9 09:59:33 2017 +0000
URL: https://gitweb.gentoo.org/proj/catalyst.git/commit/?id=106c588e
Move the signal handler into the StageBase class so it can handle unbind() cleanup
Not quite complete, still errors on some unmounting
bin/catalyst | 19 -------------------
catalyst/base/stagebase.py | 19 +++++++++++++++++++
2 files changed, 19 insertions(+), 19 deletions(-)
diff --git a/bin/catalyst b/bin/catalyst
index 72a4cb4..a64cfce 100755
--- a/bin/catalyst
+++ b/bin/catalyst
@@ -12,25 +12,6 @@ from __future__ import print_function
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)
- print()
- sys.exit(1)
-
- signal.signal(signal.SIGINT, exithandler)
- signal.signal(signal.SIGTERM, exithandler)
- signal.signal(signal.SIGPIPE, signal.SIG_DFL)
-
-except KeyboardInterrupt:
- print()
- sys.exit(1)
-
-
from catalyst.main import main
try:
diff --git a/catalyst/base/stagebase.py b/catalyst/base/stagebase.py
index b857a64..eed1458 100644
--- a/catalyst/base/stagebase.py
+++ b/catalyst/base/stagebase.py
@@ -2,6 +2,7 @@
import os
import imp
import shutil
+import signal
import sys
from snakeoil import fileutils
@@ -206,6 +207,17 @@ class StageBase(TargetBase, ClearBase, GenBase):
if "portage_confdir" in self.settings:
file_locate(self.settings, ["portage_confdir"], expand = 0)
+
+ # This block ensures that ^C interrupts are handled quietly.
+ try:
+ signal.signal(signal.SIGINT, self.exithandler)
+ signal.signal(signal.SIGTERM, self.exithandler)
+ signal.signal(signal.SIGPIPE, signal.SIG_DFL)
+
+ except KeyboardInterrupt:
+ print()
+ sys.exit(1)
+
# Setup our mount points.
# initialize our target mounts.
self.target_mounts = TARGET_MOUNT_DEFAULTS.copy()
@@ -268,6 +280,13 @@ class StageBase(TargetBase, ClearBase, GenBase):
self.env["PORT_LOGDIR"] = self.settings["port_logdir"]
self.env["PORT_LOGDIR_CLEAN"] = PORT_LOGDIR_CLEAN
+ def exithandler(self, _signum, _frame):
+ signal.signal(signal.SIGINT, signal.SIG_IGN)
+ signal.signal(signal.SIGTERM, signal.SIG_IGN)
+ self.unbind()
+ print()
+ sys.exit(1)
+
def override_cbuild(self):
if "CBUILD" in self.makeconf:
self.settings["CBUILD"] = self.makeconf["CBUILD"]
^ permalink raw reply related [flat|nested] 4+ messages in thread
* [gentoo-commits] proj/catalyst:pending commit in: bin/, catalyst/base/
@ 2017-03-11 7:07 Brian Dolbec
0 siblings, 0 replies; 4+ messages in thread
From: Brian Dolbec @ 2017-03-11 7:07 UTC (permalink / raw
To: gentoo-commits
commit: 95931a7137f5eb430b72e2502c1c9815b98cefce
Author: Brian Dolbec <dolsen <AT> gentoo <DOT> org>
AuthorDate: Tue Sep 8 06:15:25 2015 +0000
Commit: Brian Dolbec <dolsen <AT> gentoo <DOT> org>
CommitDate: Sat Mar 11 02:58:28 2017 +0000
URL: https://gitweb.gentoo.org/proj/catalyst.git/commit/?id=95931a71
Move the signal handler into the StageBase class so it can handle unbind() cleanup
Not quite complete, still errors on some unmounting
bin/catalyst | 19 -------------------
catalyst/base/stagebase.py | 19 +++++++++++++++++++
2 files changed, 19 insertions(+), 19 deletions(-)
diff --git a/bin/catalyst b/bin/catalyst
index 72a4cb4..a64cfce 100755
--- a/bin/catalyst
+++ b/bin/catalyst
@@ -12,25 +12,6 @@ from __future__ import print_function
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)
- print()
- sys.exit(1)
-
- signal.signal(signal.SIGINT, exithandler)
- signal.signal(signal.SIGTERM, exithandler)
- signal.signal(signal.SIGPIPE, signal.SIG_DFL)
-
-except KeyboardInterrupt:
- print()
- sys.exit(1)
-
-
from catalyst.main import main
try:
diff --git a/catalyst/base/stagebase.py b/catalyst/base/stagebase.py
index b857a64..eed1458 100644
--- a/catalyst/base/stagebase.py
+++ b/catalyst/base/stagebase.py
@@ -2,6 +2,7 @@
import os
import imp
import shutil
+import signal
import sys
from snakeoil import fileutils
@@ -206,6 +207,17 @@ class StageBase(TargetBase, ClearBase, GenBase):
if "portage_confdir" in self.settings:
file_locate(self.settings, ["portage_confdir"], expand = 0)
+
+ # This block ensures that ^C interrupts are handled quietly.
+ try:
+ signal.signal(signal.SIGINT, self.exithandler)
+ signal.signal(signal.SIGTERM, self.exithandler)
+ signal.signal(signal.SIGPIPE, signal.SIG_DFL)
+
+ except KeyboardInterrupt:
+ print()
+ sys.exit(1)
+
# Setup our mount points.
# initialize our target mounts.
self.target_mounts = TARGET_MOUNT_DEFAULTS.copy()
@@ -268,6 +280,13 @@ class StageBase(TargetBase, ClearBase, GenBase):
self.env["PORT_LOGDIR"] = self.settings["port_logdir"]
self.env["PORT_LOGDIR_CLEAN"] = PORT_LOGDIR_CLEAN
+ def exithandler(self, _signum, _frame):
+ signal.signal(signal.SIGINT, signal.SIG_IGN)
+ signal.signal(signal.SIGTERM, signal.SIG_IGN)
+ self.unbind()
+ print()
+ sys.exit(1)
+
def override_cbuild(self):
if "CBUILD" in self.makeconf:
self.settings["CBUILD"] = self.makeconf["CBUILD"]
^ permalink raw reply related [flat|nested] 4+ messages in thread
* [gentoo-commits] proj/catalyst:pending commit in: bin/, catalyst/base/
@ 2017-03-09 9:39 Brian Dolbec
0 siblings, 0 replies; 4+ messages in thread
From: Brian Dolbec @ 2017-03-09 9:39 UTC (permalink / raw
To: gentoo-commits
commit: 97d01ff55ca7450a78bdb62f2dcdb17a7d8acecb
Author: Brian Dolbec <dolsen <AT> gentoo <DOT> org>
AuthorDate: Tue Sep 8 06:15:25 2015 +0000
Commit: Brian Dolbec <dolsen <AT> gentoo <DOT> org>
CommitDate: Thu Mar 9 09:34:07 2017 +0000
URL: https://gitweb.gentoo.org/proj/catalyst.git/commit/?id=97d01ff5
Move the signal handler into the StageBase class so it can handle unbind() cleanup
Not quite complete, still errors on some unmounting
bin/catalyst | 19 -------------------
catalyst/base/stagebase.py | 27 +++++++++++++++++++++++++++
2 files changed, 27 insertions(+), 19 deletions(-)
diff --git a/bin/catalyst b/bin/catalyst
index 72a4cb4..a64cfce 100755
--- a/bin/catalyst
+++ b/bin/catalyst
@@ -12,25 +12,6 @@ from __future__ import print_function
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)
- print()
- sys.exit(1)
-
- signal.signal(signal.SIGINT, exithandler)
- signal.signal(signal.SIGTERM, exithandler)
- signal.signal(signal.SIGPIPE, signal.SIG_DFL)
-
-except KeyboardInterrupt:
- print()
- sys.exit(1)
-
-
from catalyst.main import main
try:
diff --git a/catalyst/base/stagebase.py b/catalyst/base/stagebase.py
index b857a64..ef58454 100644
--- a/catalyst/base/stagebase.py
+++ b/catalyst/base/stagebase.py
@@ -2,6 +2,7 @@
import os
import imp
import shutil
+import signal
import sys
from snakeoil import fileutils
@@ -206,6 +207,17 @@ class StageBase(TargetBase, ClearBase, GenBase):
if "portage_confdir" in self.settings:
file_locate(self.settings, ["portage_confdir"], expand = 0)
+
+ # This block ensures that ^C interrupts are handled quietly.
+ try:
+ signal.signal(signal.SIGINT, self.exithandler)
+ signal.signal(signal.SIGTERM, self.exithandler)
+ signal.signal(signal.SIGPIPE, signal.SIG_DFL)
+
+ except KeyboardInterrupt:
+ print()
+ sys.exit(1)
+
# Setup our mount points.
# initialize our target mounts.
self.target_mounts = TARGET_MOUNT_DEFAULTS.copy()
@@ -268,6 +280,21 @@ class StageBase(TargetBase, ClearBase, GenBase):
self.env["PORT_LOGDIR"] = self.settings["port_logdir"]
self.env["PORT_LOGDIR_CLEAN"] = PORT_LOGDIR_CLEAN
+ # Initialize our (de)compressor's)
+ self.decompressor = CompressMap(self.settings["decompress_definitions"],
+ env=self.env,
+ search_order=self.settings["decompressor_search_order"])
+
+ # save resources, it is not always needed
+ self.compressor = None
+
+ def exithandler(self, _signum, _frame):
+ signal.signal(signal.SIGINT, signal.SIG_IGN)
+ signal.signal(signal.SIGTERM, signal.SIG_IGN)
+ self.unbind()
+ print()
+ sys.exit(1)
+
def override_cbuild(self):
if "CBUILD" in self.makeconf:
self.settings["CBUILD"] = self.makeconf["CBUILD"]
^ permalink raw reply related [flat|nested] 4+ messages in thread
* [gentoo-commits] proj/catalyst:pending commit in: bin/, catalyst/base/
@ 2015-11-21 1:33 Brian Dolbec
0 siblings, 0 replies; 4+ messages in thread
From: Brian Dolbec @ 2015-11-21 1:33 UTC (permalink / raw
To: gentoo-commits
commit: fe5ee071915d06e451cf7cc66dd40abb00c3fca6
Author: Brian Dolbec <dolsen <AT> gentoo <DOT> org>
AuthorDate: Tue Sep 8 06:15:25 2015 +0000
Commit: Brian Dolbec <dolsen <AT> gentoo <DOT> org>
CommitDate: Sat Nov 21 01:31:28 2015 +0000
URL: https://gitweb.gentoo.org/proj/catalyst.git/commit/?id=fe5ee071
Move the signal handler into the StageBase class so it can handle unbind() cleanup
Not quite complete, still errors on some unmounting
bin/catalyst | 19 -------------------
catalyst/base/stagebase.py | 19 +++++++++++++++++++
2 files changed, 19 insertions(+), 19 deletions(-)
diff --git a/bin/catalyst b/bin/catalyst
index 24122b2..8ba3348 100755
--- a/bin/catalyst
+++ b/bin/catalyst
@@ -12,25 +12,6 @@ from __future__ import print_function
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)
- print()
- sys.exit(1)
-
- signal.signal(signal.SIGINT, exithandler)
- signal.signal(signal.SIGTERM, exithandler)
- signal.signal(signal.SIGPIPE, signal.SIG_DFL)
-
-except KeyboardInterrupt:
- print()
- sys.exit(1)
-
-
from catalyst.main import main
try:
diff --git a/catalyst/base/stagebase.py b/catalyst/base/stagebase.py
index 62950b5..7e5396f 100644
--- a/catalyst/base/stagebase.py
+++ b/catalyst/base/stagebase.py
@@ -2,6 +2,7 @@
import os
import imp
import shutil
+import signal
import sys
from stat import ST_UID, ST_GID, ST_MODE
@@ -190,6 +191,17 @@ class StageBase(TargetBase, ClearBase, GenBase):
if "portage_confdir" in self.settings:
file_locate(self.settings,["portage_confdir"],expand=0)
+
+ # This block ensures that ^C interrupts are handled quietly.
+ try:
+ signal.signal(signal.SIGINT, self.exithandler)
+ signal.signal(signal.SIGTERM, self.exithandler)
+ signal.signal(signal.SIGPIPE, signal.SIG_DFL)
+
+ except KeyboardInterrupt:
+ print()
+ sys.exit(1)
+
# Setup our mount points.
# initialize our target mounts.
self.target_mounts = TARGET_MOUNT_DEFAULTS.copy()
@@ -262,6 +274,13 @@ class StageBase(TargetBase, ClearBase, GenBase):
# save resources, it is not always needed
self.compressor = None
+ def exithandler(self, _signum, _frame):
+ signal.signal(signal.SIGINT, signal.SIG_IGN)
+ signal.signal(signal.SIGTERM, signal.SIG_IGN)
+ self.unbind()
+ print()
+ sys.exit(1)
+
def override_cbuild(self):
if "CBUILD" in self.makeconf:
self.settings["CBUILD"]=self.makeconf["CBUILD"]
^ permalink raw reply related [flat|nested] 4+ messages in thread
end of thread, other threads:[~2017-03-11 7:07 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-03-09 10:02 [gentoo-commits] proj/catalyst:pending commit in: bin/, catalyst/base/ Brian Dolbec
-- strict thread matches above, loose matches on Subject: below --
2017-03-11 7:07 Brian Dolbec
2017-03-09 9:39 Brian Dolbec
2015-11-21 1:33 Brian Dolbec
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox