I wrote this script to safely remove gnome from my system, but I think it may usefull for any list of packages. The script takes as input a file which contains list of packages to be removed - in my case: equery list | grep gnome > pkglist It removes the version number from the name and the removes duplicate names (resulting from multislot instalations). After this for every package in the list it executes "equery depends <pkgname>" For every package, that depends on <pkgname>, it chechks if it's not already added to the list for removing and if it's not - asks the user. In my case I keeped mozilla, openoffice, etc. - they can be compiled with "-gnome -gtk -gtk2" later. Addedd packages are checked also if any other packages are depending on them. If the user choose to keep the application the script remembers it and will not ask again for the same name. At the end the cript produces two files: "output" contains the package names from the input file plus the names, that the user choose during execution. They can be unmerged wint something like "emerge --unmerge `cat output`" ; and the second file produced is "pkg_to_reemerge" - contains names of packages that user choosed to keep. They should be reemerged with apropriate USE flags - in my case "-gnome -gtk -gtk2".
Created attachment 86066 [details] recursive uninstaler
Well, I'm really unsure what are you requesting here. If you want to see this in portage, you'd need to make an ebuild for this. Otherwise, forums.g.o. or http://gentooexperimental.org/script/repo/list is probably a better place for such scripts.