Exit status 128 + SIGINT for --ask 'no' answer.
authorZac Medico <zmedico@gentoo.org>
Sun, 25 Mar 2012 23:20:19 +0000 (16:20 -0700)
committerZac Medico <zmedico@gentoo.org>
Sun, 25 Mar 2012 23:20:19 +0000 (16:20 -0700)
This will fix bug #409647.

bin/repoman
pym/_emerge/actions.py
pym/_emerge/main.py
pym/_emerge/userquery.py

index d393df1ba3354d733c47b30862dbb50fe9df11e6..8e19a4763027c6bed8a6e8f653ebf21097092d1f 100755 (executable)
@@ -2622,7 +2622,7 @@ else:
 
        if options.ask and userquery('Commit changes?', True) != 'Yes':
                print("* aborting commit.")
-               sys.exit(1)
+               sys.exit(128 + signal.SIGINT)
 
        # Handle the case where committed files have keywords which
        # will change and need a priming commit before the Manifest
index e9d6bd6114d44338a900441223277e94dd1fcfb4..0fb49442a5a5c646add72fbcf6933b037a2bc535 100644 (file)
@@ -367,7 +367,7 @@ def action_build(settings, trees, mtimedb,
                        print()
                        print("Quitting.")
                        print()
-                       return 1
+                       return 128 + signal.SIGINT
                # Don't ask again (e.g. when auto-cleaning packages after merge)
                myopts.pop("--ask", None)
 
@@ -487,7 +487,7 @@ def action_config(settings, trees, myopts, myfiles):
                        options.append("X")
                        idx = userquery("Selection?", enter_invalid, responses=options)
                        if idx == "X":
-                               sys.exit(0)
+                               sys.exit(128 + signal.SIGINT)
                        pkg = pkgs[int(idx)-1]
                else:
                        print("The following packages available:")
@@ -501,7 +501,7 @@ def action_config(settings, trees, myopts, myfiles):
        print()
        if "--ask" in myopts:
                if userquery("Ready to configure %s?" % pkg, enter_invalid) == "No":
-                       sys.exit(0)
+                       sys.exit(128 + signal.SIGINT)
        else:
                print("Configuring pkg...")
        print()
@@ -1300,7 +1300,7 @@ def action_deselect(settings, trees, opts, atoms):
                                prompt = "Would you like to remove these " + \
                                        "packages from your world favorites?"
                                if userquery(prompt, enter_invalid) == 'No':
-                                       return os.EX_OK
+                                       return 128 + signal.SIGINT
 
                        remaining = set(world_set)
                        remaining.difference_update(discard_atoms)
@@ -2226,7 +2226,7 @@ def action_sync(settings, trees, mtimedb, myopts, myaction):
                                                print()
                                                print("Quitting.")
                                                print()
-                                               sys.exit(0)
+                                               sys.exit(128 + signal.SIGINT)
                                emergelog(xterm_titles, ">>> Starting rsync with " + dosyncuri)
                                if "--quiet" not in myopts:
                                        print(">>> Starting rsync with "+dosyncuri+"...")
index cf5f3323a8e3b125deb1ee677eb54a635d665e47..0fbc4b7f7256e48a043e4bfd3685b7f42433651c 100644 (file)
@@ -1849,7 +1849,7 @@ def emerge_main(args=None):
                                                portage_group_warning()
                                        if userquery("Would you like to add --pretend to options?",
                                                "--ask-enter-invalid" in myopts) == "No":
-                                               return 1
+                                               return 128 + signal.SIGINT
                                        myopts["--pretend"] = True
                                        del myopts["--ask"]
                                else:
index e7ed400b14d4ee1979e2d9626c683e370419e5ed..efae80aa6221485f51804016b62c036d9b47828a 100644 (file)
@@ -1,8 +1,9 @@
-# Copyright 1999-2009 Gentoo Foundation
+# Copyright 1999-2012 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
 
 from __future__ import print_function
 
+import signal
 import sys
 
 from portage.output import bold, create_color_func
@@ -51,5 +52,4 @@ def userquery(prompt, enter_invalid, responses=None, colours=None):
                        print("Sorry, response '%s' not understood." % response, end=' ')
        except (EOFError, KeyboardInterrupt):
                print("Interrupted.")
-               sys.exit(1)
-
+               sys.exit(128 + signal.SIGINT)