diff options
author | Rafael G. Martins <rafael@rafaelmartins.eng.br> | 2009-12-22 12:19:55 -0200 |
---|---|---|
committer | Rafael G. Martins <rafael@rafaelmartins.eng.br> | 2009-12-22 12:19:55 -0200 |
commit | 54aec7735dc529587a39b9b6cec69cdb976b59f2 (patch) | |
tree | a87d961855f52a8ee3a521d45e0bd86637b87275 /scripts/g-octave | |
parent | fixed latest error strings (diff) | |
download | g-octave-54aec7735dc529587a39b9b6cec69cdb976b59f2.tar.gz g-octave-54aec7735dc529587a39b9b6cec69cdb976b59f2.tar.bz2 g-octave-54aec7735dc529587a39b9b6cec69cdb976b59f2.zip |
added ^C handles and small fixes
Diffstat (limited to 'scripts/g-octave')
-rwxr-xr-x | scripts/g-octave | 20 |
1 files changed, 19 insertions, 1 deletions
diff --git a/scripts/g-octave b/scripts/g-octave index 0295522..244b5a8 100755 --- a/scripts/g-octave +++ b/scripts/g-octave @@ -1,8 +1,25 @@ #!/usr/bin/env python # -*- coding: utf-8 -*- -import os import sys + +# This block ensures that ^C interrupts are handled quietly. From Portage +try: + import signal + + def exithandler(signum,frame): + signal.signal(signal.SIGINT, signal.SIG_IGN) + signal.signal(signal.SIGTERM, signal.SIG_IGN) + sys.exit(1) + + signal.signal(signal.SIGINT, exithandler) + signal.signal(signal.SIGTERM, exithandler) + +except KeyboardInterrupt: + sys.exit(1) + + +import os import optparse import portage import subprocess @@ -177,6 +194,7 @@ can install only one package at once and his dependencies.""") print light_blue('Categories:'), white(pkg.categories) print light_blue('License:'), white(pkg.license) print light_blue('Url:'), white(pkg.url) + sys.exit(1) if options.verbose: print white('>>> Creating the ebuilds to install:'), light_blue(args[0]) |