Index: pym/portage/elog/mod_mail.py =================================================================== --- pym/portage/elog/mod_mail.py (revision 7269) +++ pym/portage/elog/mod_mail.py (working copy) @@ -16,6 +16,21 @@ mysubject = mysubject.replace("${PACKAGE}", cpv) mysubject = mysubject.replace("${HOST}", socket.getfqdn()) + # look at the phases listed in our logentries to figure out what action was performed + action = "merged" + for phase in logentries.keys(): + # if we found a *rm phase assume that the package was unmerged + if phase in ["postrm", "prerm"]: + action = "unmerged" + # if we think that the package was unmerged, make sure there was no unexpected + # phase recorded to avoid misinformation + if action == "unmerged": + for phase in logentries.keys(): + if phase != "other": + action = "unknown" + + mysubject = mysubject.replace("${ACTION}", action) + mymessage = portage_mail.create_message(myfrom, myrecipient, mysubject, fulltext) portage_mail.send_mail(mysettings, mymessage)