Joined: 20 Apr 2003
|Posted: Fri May 07, 2010 6:42 am Post subject: make portage to save used gcc-version from each package
|First, sorry for my bad english.
Current versions from portage does not safe the gcc version a package is compiled with. There is a bug about this too, but i dont found the link at the moment.
I made me a small workaround. Surely not perfect, but works fine for me to found packages by used gcc version.
Create or edit /etc/portage/bashrc and add:
|/etc/portage/bashrc wrote: |
|PORTAGE_CC_VERSION="`gcc --version | head -n1`" |
After merging new packages (or remerge existing) this information will safed in the /var/db/pkg/*/*/environment.bz2, so I can use it.
|bzcat /var/db/pkg/app-shells/bash-4.0_p37/environment.bz2 | grep PORTAGE_CC_VERSION |
|declare -- PORTAGE_CC_VERSION="gcc (Gentoo 4.4.3 p1.0) 4.4.3" |
Now I can use this information to found/check/whatever packages by gcc version. (if the packages are (re-) merged after the changes in bashrc)
Short example to check kde:
|for i in /var/db/pkg/kde-base/* ; do echo -n "`basename $i` :: " ; bzcat $i/environment.bz2 | grep PORTAGE_CC_VERSION | cut -d "\"" -f 2; done |
|akonadi-4.3.5 :: gcc (Gentoo 4.4.3 p1.0) 4.4.3
akregator-4.3.5 :: gcc (Gentoo 4.4.3 p1.0) 4.4.3
Is there a better code / solution? Please post.