I've cleaned up the eselect-opengl script a little and I'm attaching a patch here. Mostly these are cosmetic changes and small fixes. The patch also includes changes related to bug #315347 (adding the GL/ include subdirectory support). One thing I'm not really not sure about is the ${ROOT} modification. This is because I am unable to get the idea of replacing all of its' occurences in path — I assumed that was only a mistake.
Created attachment 228541 [details, diff] The mentioned patch
after reading it multiple times only one thing i dont like on current patch: local var var2 var3 should be: local var local var2 local var3 :P good work :]
Created attachment 228963 [details, diff] Mangled 'locals' Hope you'll like this one more.
Added to svn. Will be part of next release.