Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
gentoo-sources and depclean
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Portage & Programming
View previous topic :: View next topic  
Author Message
mathfeel
l33t
l33t


Joined: 03 Aug 2004
Posts: 700

PostPosted: Sat May 21, 2011 11:35 pm    Post subject: gentoo-sources and depclean Reply with quote

Is it possible to get emerge --depclean to, besides keeping only the latest version of gentoo-sources, but also the current running version, by perhaps checking with uname -r or something? This way, when I DO upgrade the kernel and the newer version is up and running, running depclean will then clean the older version.

Thanks.
_________________
-----------------------------------------------------------
"In heaven all the interesting people are missing"
-- Friedrich Nietzsche
Back to top
View user's profile Send private message
platojones
Veteran
Veteran


Joined: 23 Oct 2002
Posts: 1597
Location: Just over the horizon

PostPosted: Sat May 21, 2011 11:45 pm    Post subject: Reply with quote

depclean doesn't actually remove the kernel sources. They are still left there, in tact. It just removes them from the list of installed packages.
Back to top
View user's profile Send private message
krinn
Watchman
Watchman


Joined: 02 May 2003
Posts: 7412

PostPosted: Sat May 21, 2011 11:46 pm    Post subject: Reply with quote

emerge the specific package version, this way emerge add it to world and it will be protect from depclean

edit: -> better cmdline: emerge --noreplace =gentoo-sources-versiontoprotect
Back to top
View user's profile Send private message
Jaglover
Watchman
Watchman


Joined: 29 May 2005
Posts: 7711
Location: Saint Amant, Acadiana

PostPosted: Sun May 22, 2011 12:07 am    Post subject: Reply with quote

I'm with mathfeel, it would be nice if sources of running kernel were left intact - without having to put them into world file. Maybe we should file a bug.
_________________
Please learn how to denote units correctly!
Back to top
View user's profile Send private message
Hu
Moderator
Moderator


Joined: 06 Mar 2007
Posts: 15460

PostPosted: Sun May 22, 2011 12:55 am    Post subject: Reply with quote

platojones wrote:
depclean doesn't actually remove the kernel sources. They are still left there, in tact. It just removes them from the list of installed packages.
On what do you base this comment? The behavior you suggest directly contradicts the point of unmerging package files.
Back to top
View user's profile Send private message
platojones
Veteran
Veteran


Joined: 23 Oct 2002
Posts: 1597
Location: Just over the horizon

PostPosted: Sun May 22, 2011 1:03 am    Post subject: Reply with quote

Hu wrote:
platojones wrote:
depclean doesn't actually remove the kernel sources. They are still left there, in tact. It just removes them from the list of installed packages.
On what do you base this comment? The behavior you suggest directly contradicts the point of unmerging package files.


I base that comment on years of experience and there are several (old) threads here about it. I've been depcleaning/unmerging them for years and the sources have never been actually removed. I have to do it manually (rm -rf) if I actually want to get rid of the sources. Kernel sources are handled differently...at least they always have been on my system. Maybe my system is different.
Back to top
View user's profile Send private message
Hu
Moderator
Moderator


Joined: 06 Mar 2007
Posts: 15460

PostPosted: Sun May 22, 2011 2:53 am    Post subject: Reply with quote

You might have your sources protected from unmerge by CONFIG_PROTECT. Alternatively, you might be completely mistaken. Many people choose to build their kernel in-tree, which pollutes /usr/src/linux-version with uncontrolled files. Portage will only remove controlled files and empty directories. If you pollute your kernel source tree, then emerge --depclean will not remove the directory structure.
Back to top
View user's profile Send private message
platojones
Veteran
Veteran


Joined: 23 Oct 2002
Posts: 1597
Location: Just over the horizon

PostPosted: Sun May 22, 2011 2:58 am    Post subject: Reply with quote

Hu wrote:
You might have your sources protected from unmerge by CONFIG_PROTECT. Alternatively, you might be completely mistaken. Many people choose to build their kernel in-tree, which pollutes /usr/src/linux-version with uncontrolled files. Portage will only remove controlled files and empty directories. If you pollute your kernel source tree, then emerge --depclean will not remove the directory structure.


Actually, I don't have my sources protected by CONFIG_PROTECT.

And yes, I do build my sources 'in-tree'. How do you build them? Copy them somewhere else then build them? I wasn't aware anybody did this and I can't imagine why they would...and then, even if you did and avoided 'polluting your sources with uncontrolled files'...depclean still wouldn't touch those copies either.

I'm sorry, nothing you just wrote makes any sense to me.
Back to top
View user's profile Send private message
Etal
Veteran
Veteran


Joined: 15 Jul 2005
Posts: 1713

PostPosted: Sun May 22, 2011 3:30 am    Post subject: Reply with quote

Code:
# ls linux-2.6.39-rc7/
arch     CREDITS        drivers   include  Kbuild   lib          mm               Module.symvers  REPORTING-BUGS  security    tools  vmlinux
block    crypto         firmware  init     Kconfig  MAINTAINERS  modules.builtin  net             samples         sound       usr    vmlinux.o
COPYING  Documentation  fs        ipc      kernel   Makefile     modules.order    README          scripts         System.map  virt

# emerge -aqC vanilla-sources-2.6.39_rc7
sys-kernel/vanilla-sources: 2.6.39_rc7 none 2.6.39

All selected packages: sys-kernel/vanilla-sources-2.6.39_rc7
Would you like to unmerge these packages? [Yes/No] y
>>> Waiting 5 seconds before starting...
>>> (Control-C to abort)...
>>> Unmerging in:  5 4 3 2 1
>>> Unmerging sys-kernel/vanilla-sources-2.6.39_rc7...

# ls linux-2.6.39-rc7/
arch   crypto   firmware  include  ipc     lib  modules.builtin  Module.symvers  scripts   sound       usr   vmlinux
block  drivers  fs        init     kernel  mm   modules.order    net             security  System.map  virt  vmlinux.o


I get the same behavior as Hu describes - anything that gets installed by portage gets uninstalled by it.
_________________
“And even in authoritarian countries, information networks are helping people discover new facts and making governments more accountable.”– Hillary Clinton, Jan. 21, 2010
Back to top
View user's profile Send private message
Hu
Moderator
Moderator


Joined: 06 Mar 2007
Posts: 15460

PostPosted: Sun May 22, 2011 3:45 am    Post subject: Reply with quote

I use the out-of-tree build support via $KBUILD_OUTPUT, which I have described and advocated many times on these forums. It allows me to build multiple kernels with different configurations, all from a single source tree with no extra copies created anywhere.
Back to top
View user's profile Send private message
platojones
Veteran
Veteran


Joined: 23 Oct 2002
Posts: 1597
Location: Just over the horizon

PostPosted: Sun May 22, 2011 3:48 am    Post subject: Reply with quote

Apologies to all...it removes some of the tree, but leaves some files in place.

Jaglover, Hu, Etal...I'm wrong. I thought the tree was in tact all these years.

Sorry for the confusion I caused.
Back to top
View user's profile Send private message
mathfeel
l33t
l33t


Joined: 03 Aug 2004
Posts: 700

PostPosted: Sun May 22, 2011 4:01 am    Post subject: Reply with quote

platojones wrote:
Apologies to all...it removes some of the tree, but leaves some files in place.

Jaglover, Hu, Etal...I'm wrong. I thought the tree was in tact all these years.

Sorry for the confusion I caused.


It behaves like this: if you have run make under the tree, it produces a lot of new files (object file etc), which are not unmerged. If you want them gone by unmerge, you do:
Code:
make distclean

which restore the tree to post-merge states. Then emerge -C gentoo-sources:{version} would remove the tree completely.

krinn wrote:
emerge the specific package version, this way emerge add it to world and it will be protect from depclean

edit: -> better cmdline: emerge --noreplace =gentoo-sources-versiontoprotect


It is of course possible to run emerge --noreplace gentoo-sources:{desired version} to keep depclean from removing it. But one would have to remember to do this every time compiling a new kernel to keep it explicitly in @world. And when a newer kernel comes along that one wants to use, one would have to emerge -C gentoo-sources:{old marked version} also explicitly, remembering which versions in @world that one do not wants.

I think the behavior should be (to suit my own taste, not speaking for anyone else here):
  • If {any version} is explicitly in @world, then it should be unmerged explicitly. As it is now.
  • If {old version} is emerge implicit via update and is currently in used, depclean shouldn't unmerge it.
  • If an implicit {old version} is not in use, depclean should then clean it.

I think kernel sources is pretty unique in the sense that one often need to keep the tree of the in-use version even when a newer version is emerged because some packages check it and would failed if the tree is unmerged.
_________________
-----------------------------------------------------------
"In heaven all the interesting people are missing"
-- Friedrich Nietzsche
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Portage & Programming All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum