Bug 212573 - app-portage/gentoolkit - euse patch to display additional information for installed packages
Bug#: 212573 Product:  Portage Development Version: unspecified Platform: All
OS/Version: Linux Status: RESOLVED Severity: enhancement Priority: P2
Resolution: FIXED Assigned To: tools-portage@gentoo.org Reported By: arandes@programmers.at
Component: Tools
URL: 
Summary: app-portage/gentoolkit - euse patch to display additional information for installed packages
Keywords:  InSVN
Status Whiteboard: 
Opened: 2008-03-07 10:59 0000
Description:   Opened: 2008-03-07 10:59 0000
I wrote a patch for euse (current revision from SVN (398)).

The patch adds an option (-I/--info-installed) which is similar to --info/-i
but gives some information about the installed packages matching the passed
USE flag(s).

On global USE flags all packages matching the USE flag that are printed will be
displayed additionally. The USE flag is even displayed if there was no
installed package found. On local USE flags only descriptions for installed
packages will be printed.

I think this option is very useful if one wants to check the impact of some USE
flags on the current system, i.e. if they could be enabled or disabled
globally.


Example:

arandes@T22 ~ $ euse -i gnutls nodrm
global use flags (searching: gnutls nodrm)
************************************************************
[-    ] gnutls - Adds support for net-libs/gnutls (TLS 1.0 and SSL 3.0 support)

local use flags (searching: gnutls nodrm)
************************************************************
[-    ] nodrm (app-text/pdftk):
Decrypt a document with the user_pw even if it has an owner_pw set

[-    ] nodrm (app-text/xpdf):
Disable the drm feature decoder.


arandes@T22 ~ $ euse-modified -I gnutls nodrm
global use flags (searching: gnutls nodrm)
************************************************************
[-    ] gnutls - Adds support for net-libs/gnutls (TLS 1.0 and SSL 3.0 support)
Installed packages matching this USE flag:
net-libs/libetpan
net-wireless/wpa_supplicant
mail-mta/msmtp
net-misc/curl

local use flags (searching: gnutls nodrm)
************************************************************
[-    ] nodrm (app-text/xpdf):
Disable the drm feature decoder.

Reproducible: Always

Steps to Reproduce:

------- Comment #1 From Andreas Waidler 2008-03-07 11:01:44 0000 -------
Created an attachment (id=145472) [details]
The patch described.

------- Comment #2 From Michael A. Smith 2008-03-07 18:43:45 0000 -------
Created an attachment (id=145496) [details]
euse-info-installed-2.patch

Altogether attachment #145472 [details] is good work in keeping with the style of euse.
Nevertheless, here are some improvements:

1) Use equery list instead of eix so as not to draw in unnecessary
dependencies.
2) Replaced some bare word loops with whitespace-friendly list handling
mechanisms.
3) Replaced a lot of subshells and pipes with more terse/lower overhead
options.

Trivial changes:
 - Added the -I option to --help and made some whitespace changes for
readability (please confirm whether or not I described the new option
adequately).
 - Changed the copyright date.

TODO:
 - Do we want to increase the version number?
 - Update the man page

------- Comment #3 From Paul Varner 2008-03-13 22:41:18 0000 -------
Thanks Andreas and Micheal.  I have added the patch and updated the man page.

$ svn commit -m "Add --info-installed flag to euse. Thanks to Andreas Waidler
for providing the patch" ChangeLog src/euse/euse src/euse/euse.1
Sending        ChangeLog
Sending        src/euse/euse
Sending        src/euse/euse.1
Transmitting file data ...
Committed revision 480.

------- Comment #4 From Paul Varner 2008-04-24 02:32:52 0000 -------
Released in gentoolkit-0.2.4_rc4