new minimal start script
authorBrian Dolbec <dolsen@gentoo.org>
Fri, 11 Jan 2013 03:11:47 +0000 (19:11 -0800)
committerBrian Dolbec <dolsen@gentoo.org>
Thu, 28 Feb 2013 01:38:11 +0000 (17:38 -0800)
bin/catalyst [new file with mode: 0755]
catalyst/main.py [changed mode: 0755->0644]

diff --git a/bin/catalyst b/bin/catalyst
new file mode 100755 (executable)
index 0000000..a4e55db
--- /dev/null
@@ -0,0 +1,46 @@
+#!/usr/bin/python -OO
+
+# Maintained in full by:
+# Catalyst Team <catalyst@gentoo.org>
+# Release Engineering Team <releng@gentoo.org>
+# Andrew Gaffney <agaffney@gentoo.org>
+# Chris Gianelloni <wolf31o2@wolf31o2.org>
+# $Id$
+
+
+from __future__ import print_function
+
+import sys
+
+__maintainer__="Catalyst <catalyst@gentoo.org>"
+__version__="2.0.12.2"
+
+
+# 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:
+       main()
+except KeyboardInterrupt:
+       print("Aborted.")
+       sys.exit(130)
+sys.exit(0)
+
old mode 100755 (executable)
new mode 100644 (file)
index 2a9b75c..763107b
@@ -243,7 +243,7 @@ def build_target(addlargs, targetmap):
                        addlargs["target"]
                sys.exit(1)
 
-if __name__ == "__main__":
+def main():
        targetmap={}
 
        version()