summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2006-04-22 00:15:52 +0000
committerZac Medico <zmedico@gentoo.org>2006-04-22 00:15:52 +0000
commit9331c6ad58737f707ce7cae6f363a72dd0a898f1 (patch)
treeece0739b4390ba8956644f6c9785ef25f0f56520
parentdb24ca53e8b77dace12ea5826825db599c5604f3 (diff)
downloadportage-9331c6ad58737f707ce7cae6f363a72dd0a898f1.tar.gz
portage-9331c6ad58737f707ce7cae6f363a72dd0a898f1.tar.bz2
portage-9331c6ad58737f707ce7cae6f363a72dd0a898f1.zip
Exit with error status when the user has attempted to unmerge a package that is not installed (bug #118515).
svn path=/main/trunk/; revision=3186
-rwxr-xr-xbin/emerge11
1 files changed, 7 insertions, 4 deletions
diff --git a/bin/emerge b/bin/emerge
index 09ba5bc0f..ec4cb876c 100755
--- a/bin/emerge
+++ b/bin/emerge
@@ -2246,8 +2246,7 @@ def unmerge(unmerge_action, unmerge_files):
#add a "=" if missing
mymatch=localtree.dep_match("="+x)
if not mymatch:
- print "\n--- Couldn't find " + white(x) + " to "+unmerge_action+"."
- continue
+ raise portage_exception.PackageNotFound(x)
mykey=portage.key_expand(portage.dep_getkey(mymatch[0]),portage.db["/"]["vartree"].dbapi)
if not pkgmap.has_key(mykey):
pkgmap[mykey]={"protected":[], "selected":[], "omitted":[] }
@@ -3115,8 +3114,12 @@ elif "search"==myaction:
sys.exit(1)
searchinstance.output()
elif "unmerge"==myaction or "prune"==myaction or "clean"==myaction:
- if 1==unmerge(myaction, myfiles):
- post_emerge()
+ try:
+ if 1==unmerge(myaction, myfiles):
+ post_emerge()
+ except portage_exception.PackageNotFound, e:
+ portage.writemsg("--- Couldn't find %s to unmerge.\n" % str(e))
+ sys.exit(1)
elif "depclean"==myaction:
# Kill packages that aren't explicitly merged or are required as a