i recently setup portage ELOG to email me emerge logs, and I'm using the MAILSUBJECT option to indicate what the message was per package and i noticed that it sends logs for both emerges and unmerge process, in the documentation there doesn't seem to be a "portage process" variable to indicate if it was a unmerge or merge, so if i use the suggested PORTAGE_ELOG_MAILSUBJECT="package \${PACKAGE} merged on \${HOST} with notice" i get told package A was merged on HostA with notices, when it was realy unmerged so extra variables such as one to indicate if it was merged or not would make the elog mail messages less confusing. Reproducible: Always i do not be leave that there is any further information that would explain the feature i am suggesting.
Created attachment 124990 [details, diff] Patch to export a ${ACTION} variable in MAILSUBJECT Please try the attached patch. It adds support for a ${ACTION} variable in PORTAGE_ELOG_MAILSUBJECT that contains either "merged", "unmerged" or "unknown" (though the last case shouldn't happen AFAICT). You can apply it with patch /usr/lib/portage/pym/elog_modules/mod_mail.py < /path/to/elog-mail-action.diff
applied the patch as instructed how ever on testing i got merged for package merges but unkownen for unmerges im not sure if it matters that the unmerge came from an update ie i updated sys-apps/file which put it from sys-apps/file-4.21 to sys-apps/file-4.21-r1 so portage usual it installs the 4.21-r1 copy and when finishes it runs an unmerge on the remaining 4.21 install and this is a case this patch gave unknown possibly the test to test to see if it was not an unmerge and unknown instead, its seeing all unmerges as unknown, at least thats my guess cause i don't know the inner workings of portage and i don't know python so i cant really fix or debug it that well. thanks for the patch and quick response with a fix!! Kevin (In reply to comment #1) > Created an attachment (id=124990) [edit] > Patch to export a ${ACTION} variable in MAILSUBJECT > > Please try the attached patch. It adds support for a ${ACTION} variable in > PORTAGE_ELOG_MAILSUBJECT that contains either "merged", "unmerged" or "unknown" > (though the last case shouldn't happen AFAICT). > You can apply it with > patch /usr/lib/portage/pym/elog_modules/mod_mail.py < > /path/to/elog-mail-action.diff >
Created attachment 125002 [details, diff] Patch that correctly sets ACTION=unmerged Oops, had a stupid bug in the patch, here is a fixed version. And don't thank me yet, I haven't decided if I like this or not.
did same test, patch worked as expected, you may say not to thank you but i am anyway because i can use this even if it isn't "officially" implemented in portage, i have 5 systems soon to be 6 to monitor available updates(with a bash script i built) and using this with elog its less confusing when there is 50-100 some e-mails to go through(and i can sort out the unmerges if necessary). so thank you very much, and if you create new versions of the patch ill apply and test them asap. Kevin (In reply to comment #3) > Created an attachment (id=125002) [edit] > Patch that correctly sets ACTION=unmerged > > Oops, had a stupid bug in the patch, here is a fixed version. > And don't thank me yet, I haven't decided if I like this or not. > (In reply to comment #3) > Created an attachment (id=125002) [edit] > Patch that correctly sets ACTION=unmerged > > Oops, had a stupid bug in the patch, here is a fixed version. > And don't thank me yet, I haven't decided if I like this or not. >
Looks like I've commited this already.
This is supposed to be fixed in portage-2.2_pre5 or earlier.