From: Zac Medico Date: Sat, 22 Apr 2006 00:15:52 +0000 (-0000) Subject: Exit with error status when the user has attempted to unmerge a package that is not... X-Git-Tag: v2.1_pre10~88 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=9331c6ad58737f707ce7cae6f363a72dd0a898f1;p=portage.git 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 --- 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