The following patch adds an optional package argument(s) to emerge info. emerge will then search for the specified packages. If they are installed and any of the settings for these packages are different than what the current system has, those differences are displayed. For instance, if you have package 'foo' that was installed. After you installed foo, you changed your CFLAGS. When you do 'emerge info', all you get is what the current settings are (not what you emerged foo as). Thus 'emerge info foo' provides both current system settings and the old CFLAGS for foo.
Created attachment 61034 [details, diff] patch to add the feature
You should use portage.db[portage.root]["vartree"].dbapi.aux_get(pkg, mydesiredvars) instead of reading the files directly. Other than that, it looks fine.
Created attachment 61036 [details, diff] Updated patch Yes sir ;)
I ended up making a few small changes. In particular, I got rid of the mysettings temporary and compared directly to portage.settings. There were also two small bugs: 1) diff_found was in the wrong place which would cause the per-package header to be printed for all packages after the first differing package. 2) Using None when a variable is not set globally would cause that variable to always be printed for every package. ("" != None)
Fixed on or before 2.0.51.22-r1
Looking through the batch of bugs, I'm not sure that some of these are actually fixed in stable. Others, the requirements have possibly changed after the initial fix was committed. If you think this bug has been closed incorrectly, please reopen or ask that it be reopened.
Doesn't look like it to me.
This feature would be really useful. It shouldn't be much work to sync it up with trunk, so I'll go ahead and do that...
An updated version of this patch is in svn r3834.
This has been released in 2.1.1_pre2-r7.