From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from pigeon.gentoo.org ([208.92.234.80] helo=lists.gentoo.org) by finch.gentoo.org with esmtp (Exim 4.60) (envelope-from ) id 1SC10u-0007RN-85 for garchives@archives.gentoo.org; Mon, 26 Mar 2012 03:54:36 +0000 Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id D7E52E0531; Mon, 26 Mar 2012 03:54:21 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) by pigeon.gentoo.org (Postfix) with ESMTP id 90F37E0531 for ; Mon, 26 Mar 2012 03:54:21 +0000 (UTC) Received: from hornbill.gentoo.org (hornbill.gentoo.org [94.100.119.163]) (using TLSv1 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id CD0B31B404F for ; Mon, 26 Mar 2012 03:54:20 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by hornbill.gentoo.org (Postfix) with ESMTP id 97C33E5402 for ; Mon, 26 Mar 2012 03:54:19 +0000 (UTC) From: "Zac Medico" To: gentoo-commits@lists.gentoo.org Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Zac Medico" Message-ID: <1332734020.4e2abb474f0fc624c51948f0939e3123f6382992.zmedico@gentoo> Subject: [gentoo-commits] proj/portage:master commit in: pym/_emerge/ X-VCS-Repository: proj/portage X-VCS-Files: pym/_emerge/actions.py pym/_emerge/unmerge.py X-VCS-Directories: pym/_emerge/ X-VCS-Committer: zmedico X-VCS-Committer-Name: Zac Medico X-VCS-Revision: 4e2abb474f0fc624c51948f0939e3123f6382992 X-VCS-Branch: master Date: Mon, 26 Mar 2012 03:54:19 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: quoted-printable X-Archives-Salt: 96fa886e-dc6d-4f7c-8f7c-b7bc4d7bcab1 X-Archives-Hash: 9d5b330b1bdfd280adf187989f16d5de commit: 4e2abb474f0fc624c51948f0939e3123f6382992 Author: Zac Medico gentoo org> AuthorDate: Mon Mar 26 03:49:47 2012 +0000 Commit: Zac Medico gentoo org> CommitDate: Mon Mar 26 03:53:40 2012 +0000 URL: http://git.overlays.gentoo.org/gitweb/?p=3Dproj/portage.git;a= =3Dcommit;h=3D4e2abb47 unmerge: fix return code for bug #409647 --- pym/_emerge/actions.py | 10 +++------- pym/_emerge/unmerge.py | 14 ++++++++------ 2 files changed, 11 insertions(+), 13 deletions(-) diff --git a/pym/_emerge/actions.py b/pym/_emerge/actions.py index 0fb4944..afb62bb 100644 --- a/pym/_emerge/actions.py +++ b/pym/_emerge/actions.py @@ -586,12 +586,9 @@ def action_depclean(settings, trees, ldpath_mtimes, return rval =20 if cleanlist: - if unmerge(root_config, myopts, "unmerge", + rval =3D unmerge(root_config, myopts, "unmerge", cleanlist, ldpath_mtimes, ordered=3Dordered, - scheduler=3Dscheduler): - rval =3D os.EX_OK - else: - rval =3D 1 + scheduler=3Dscheduler) =20 if action =3D=3D "prune": return rval @@ -2674,10 +2671,9 @@ def action_uninstall(settings, trees, ldpath_mtime= s, (action =3D=3D 'prune' and "--nodeps" in opts): # When given a list of atoms, unmerge them in the order given. ordered =3D action =3D=3D 'unmerge' - unmerge(trees[settings['EROOT']]['root_config'], opts, action, + rval =3D unmerge(trees[settings['EROOT']]['root_config'], opts, action= , valid_atoms, ldpath_mtimes, ordered=3Dordered, scheduler=3Dsched._sched_iface) - rval =3D os.EX_OK else: rval =3D action_depclean(settings, trees, ldpath_mtimes, opts, action, valid_atoms, spinner, scheduler=3Dsched._sched_iface) diff --git a/pym/_emerge/unmerge.py b/pym/_emerge/unmerge.py index c76afdf..0acdf99 100644 --- a/pym/_emerge/unmerge.py +++ b/pym/_emerge/unmerge.py @@ -1,9 +1,10 @@ -# Copyright 1999-2011 Gentoo Foundation +# Copyright 1999-2012 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 =20 from __future__ import print_function =20 import logging +import signal import sys import textwrap import portage @@ -503,7 +504,8 @@ def unmerge(root_config, myopts, unmerge_action, clean_world=3D1, clean_delay=3D1, ordered=3D0, raise_on_error=3D0, scheduler=3DNone, writemsg_level=3Dportage.util.writemsg_level): """ - Returns 1 if successful, otherwise 0. + Returns os.EX_OK if no errors occur, 1 if an error occurs, and + 130 if interrupted due to a 'no' answer for --ask. """ =20 if clean_world: @@ -515,7 +517,7 @@ def unmerge(root_config, myopts, unmerge_action, writemsg_level=3Dwritemsg_level) =20 if rval !=3D os.EX_OK: - return 0 + return rval =20 enter_invalid =3D '--ask-enter-invalid' in myopts vartree =3D root_config.trees["vartree"] @@ -526,7 +528,7 @@ def unmerge(root_config, myopts, unmerge_action, =20 if "--pretend" in myopts: #we're done... return - return 1 + return os.EX_OK if "--ask" in myopts: if userquery("Would you like to unmerge these packages?", enter_invalid) =3D=3D "No": @@ -535,7 +537,7 @@ def unmerge(root_config, myopts, unmerge_action, print() print("Quitting.") print() - return 0 + return 128 + signal.SIGINT #the real unmerging begins, after a short delay.... if clean_delay and not autoclean: countdown(int(settings["CLEAN_DELAY"]), ">>> Unmerging") @@ -574,5 +576,5 @@ def unmerge(root_config, myopts, unmerge_action, sets["selected"].remove(SETPREFIX + s) sets["selected"].unlock() =20 - return 1 + return os.EX_OK =20