I did emerge -u world. It included new kernel sources as well. Now I didn't want to update my kernel just yet since I felt no need to do so. Anyway I decided to do emerge clean and I soon found out that just wiped clean all the previous kernel sources apart from the one just got emerged (the new one which is not in use). Yes, it wiped clean also the kernel sources of the currently used kernel and they are kind of useful. If you got an easy way around this, I would appreciate it as would some people in #gentoo it seems.
Well, I did "emerge -u -p world", it listed flex, so I went ahead and did an "emerge -u world" and then fetched a cup of coffee. When I returned to the PC (just a matter of seconds), it was cleaning away to its hearts content, kernel source, ncurses, it rendered bash unusable, so there I am. A BIG FAT WARNING is appropriate.
Comment #1 about 'emerge -u word' is fixed in portage-2.0.43 Just 'ldconfig', and upgrade to portage-2.0.43 What use is keeping the old source tree? The headers are a different package. What is the issue? Portage is not going to make special exceptions for things like this. You _can_ leave the kernel sources out of your world file if you do not wish for it to be upgraded in a '-u world.'
Actually I'll take this one and deal with it, I have to discuss with the other kernel people and the maintainers of lm_sensors and other kernel module ebuild, but chances are what I need is more information about slotting (for instance can a package be installed with multiple different SLOTs but 1 version?) What probably needs to be done is that all packages that have the potential to install kernel modules will need to be explicitely separated such that they have one package in portage which installs NOTHING but the kernel modules and 1 package that installs everything else. For em8300-modules (which I maintain) this is already done because it is easy, for some other packages it is much more difficult. Additionally, to prevent the unmerging of kernel source trees by portage, we will probably be making all kernel sources 'SLOT="${KV}"', the only problem with this is the eventual clutter of the /usr/src dir, and of the /var/db/pkg/sys-kernel subdir...