Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 185231 - Elog MailSubject Extra Variables
Summary: Elog MailSubject Extra Variables
Status: RESOLVED FIXED
Alias: None
Product: Portage Development
Classification: Unclassified
Component: Enhancement/Feature Requests (show other bugs)
Hardware: All Linux
: High enhancement (vote)
Assignee: Portage team
URL:
Whiteboard:
Keywords: InVCS
Depends on:
Blocks: 216231
  Show dependency tree
 
Reported: 2007-07-13 20:14 UTC by Kevin Blair
Modified: 2010-09-22 03:53 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments
Patch to export a ${ACTION} variable in MAILSUBJECT (elog-mail-action.diff,1.00 KB, patch)
2007-07-16 04:59 UTC, Marius Mauch (RETIRED)
Details | Diff
Patch that correctly sets ACTION=unmerged (elog-mail-action.diff,1002 bytes, patch)
2007-07-16 09:43 UTC, Marius Mauch (RETIRED)
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Kevin Blair 2007-07-13 20:14:45 UTC
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.
Comment 1 Marius Mauch (RETIRED) gentoo-dev 2007-07-16 04:59:01 UTC
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
Comment 2 Kevin Blair 2007-07-16 07:19:29 UTC
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
> 

Comment 3 Marius Mauch (RETIRED) gentoo-dev 2007-07-16 09:43:36 UTC
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.
Comment 4 Kevin Blair 2007-07-16 10:17:16 UTC
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.
> 

Comment 5 Marius Mauch (RETIRED) gentoo-dev 2007-10-06 16:37:00 UTC
Looks like I've commited this already.
Comment 6 Marius Mauch (RETIRED) gentoo-dev 2008-03-20 18:14:52 UTC
This is supposed to be fixed in portage-2.2_pre5 or earlier.
Comment 7 Marius Mauch (RETIRED) gentoo-dev 2008-03-20 18:15:30 UTC
This is supposed to be fixed in portage-2.2_pre5 or earlier.