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 1SC0wd-0006fk-R4 for garchives@archives.gentoo.org; Mon, 26 Mar 2012 03:50:12 +0000 Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 39A9CE051E; Mon, 26 Mar 2012 03:50:02 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) by pigeon.gentoo.org (Postfix) with ESMTP id E65A5E051E for ; Mon, 26 Mar 2012 03:50:01 +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 2A3BB1B405B for ; Mon, 26 Mar 2012 03:50:01 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by hornbill.gentoo.org (Postfix) with ESMTP id E23B7E5402 for ; Mon, 26 Mar 2012 03:49:59 +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: <1332733787.774f387710bfcd14ffb270375bce3b310c2609ee.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: 774f387710bfcd14ffb270375bce3b310c2609ee X-VCS-Branch: master Date: Mon, 26 Mar 2012 03:49:59 +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: 3fcb86e6-e450-44d7-9495-d23b95d0b2ba X-Archives-Hash: 128a7a5c981a99bdbc733e64bd0642bb commit: 774f387710bfcd14ffb270375bce3b310c2609ee Author: Zac Medico gentoo org> AuthorDate: Mon Mar 26 03:49:47 2012 +0000 Commit: Zac Medico gentoo org> CommitDate: Mon Mar 26 03:49:47 2012 +0000 URL: http://git.overlays.gentoo.org/gitweb/?p=3Dproj/portage.git;a= =3Dcommit;h=3D774f3877 unmerge: fix return code for bug #409647 --- pym/_emerge/actions.py | 10 +++------- pym/_emerge/unmerge.py | 11 ++++++----- 2 files changed, 9 insertions(+), 12 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..c8a7e55 100644 --- a/pym/_emerge/unmerge.py +++ b/pym/_emerge/unmerge.py @@ -503,7 +503,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 occurrs, and + 130 if interrupted due to a 'no' answer for --ask. """ =20 if clean_world: @@ -515,7 +516,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 +527,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 +536,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 +575,5 @@ def unmerge(root_config, myopts, unmerge_action, sets["selected"].remove(SETPREFIX + s) sets["selected"].unlock() =20 - return 1 + return os.EX_OK =20