Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Some way to protect packages from --depclean?
View unanswered posts
View posts from last 24 hours

Goto page 1, 2  Next  
Reply to topic    Gentoo Forums Forum Index Portage & Programming
View previous topic :: View next topic  
Author Message
mattemod
n00b
n00b


Joined: 23 Nov 2008
Posts: 19
Location: Italy

PostPosted: Wed Sep 02, 2009 3:15 pm    Post subject: Some way to protect packages from --depclean? Reply with quote

Hi all.
My problem is simple: when I launch "emerge --depclean", I don't want earlier versions of sys-kernel/gentoo-sources to be in the removal list. Is there some way to do it? maybe some way to protect packages from --depclean-ing? (if there aren't, I'll file an enhancement request in Bugzilla)
Note that sys-kernel/gentoo-sources is already in my /var/lib/portage/world file.

Code:
# emerge --version
Portage 2.2_rc40 (default/linux/amd64/2008.0, gcc-4.3.4, glibc-2.9_p20081201-r2, 2.6.28-gentoo-r6 x86_64)


Thank you so much in advance for the answers.
_________________
Matteo
Drago Bianco
Back to top
View user's profile Send private message
John R. Graham
Administrator
Administrator


Joined: 08 Mar 2005
Posts: 10655
Location: Somewhere over Atlanta, Georgia

PostPosted: Wed Sep 02, 2009 3:20 pm    Post subject: Reply with quote

Yep. Just make each version of gentoo-sources explicitly part of world:
Code:
equery -q list -i gentoo-sources | awk -- '{ print "=" $1 }' | xargs emerge --noreplace
emerge --depclean protects the latest version of everything in world that was installed without an explicit version and protects everything that was installed with an explicit version. It'll probably be instructive for you to examine your world file after running this one-liner. :)

- John
_________________
I can confirm that I have received between 0 and 499 National Security Letters.


Last edited by John R. Graham on Wed Sep 02, 2009 4:25 pm; edited 1 time in total
Back to top
View user's profile Send private message
toralf
Developer
Developer


Joined: 01 Feb 2004
Posts: 3940
Location: Hamburg

PostPosted: Wed Sep 02, 2009 4:06 pm    Post subject: Reply with quote

john_r_graham wrote:
Code:
equery -q list -i gentoo-sources | awk -- '{ print "=" $1 }' | xargs emerge --noreplace
Off topic here but anyway : is "--" really necessary ?
Back to top
View user's profile Send private message
John R. Graham
Administrator
Administrator


Joined: 08 Mar 2005
Posts: 10655
Location: Somewhere over Atlanta, Georgia

PostPosted: Wed Sep 02, 2009 4:30 pm    Post subject: Reply with quote

Good point. No it's not. :P

- John
_________________
I can confirm that I have received between 0 and 499 National Security Letters.
Back to top
View user's profile Send private message
mattemod
n00b
n00b


Joined: 23 Nov 2008
Posts: 19
Location: Italy

PostPosted: Thu Sep 03, 2009 5:49 pm    Post subject: Reply with quote

john_r_graham wrote:
Yep. Just make each version of gentoo-sources explicitly part of world.


Didn't know it, you solved all my problems! :)
It's a bit annoying to add all versions in world file, in fact I think a global protection for a package would be useful, but it's acceptable.
Thank you so much! :)
_________________
Matteo
Drago Bianco
Back to top
View user's profile Send private message
azp
Guru
Guru


Joined: 16 Nov 2003
Posts: 456
Location: Sweden

PostPosted: Sun Nov 15, 2009 7:48 pm    Post subject: Reply with quote

I agree, I've hade the same issue for a long time. It would be good to have a package.keep file in etc/portage/profile/ so you could protect files (with versions perhaps) from depclean. Then you would have all that stuff in one place, instead of having to edit the world file.

Btw, why are there so many people in the forums using portage 2.2? It seems like everybody in the forums are running it, even though it is hard masked in package.mask. I do think I was actually running 2.2 about a year ago (or so) since I used to run emerge -uDatvN @world, which is a feature from 2.2, right? The "sets" i mean. But for some reason I'm back on 2.1.7.4 now.

Why is it so common for people to unmask 2.2?
_________________
Weeks of coding can save you hours of planning.
Back to top
View user's profile Send private message
cyrillic
Watchman
Watchman


Joined: 19 Feb 2003
Posts: 7313
Location: Groton, Massachusetts USA

PostPosted: Tue Nov 17, 2009 1:36 am    Post subject: Reply with quote

azp wrote:
Why is it so common for people to unmask 2.2?

The real question is :
Why is portage-2.2 still (since January) hardmasked when it works fine for many people ?
Back to top
View user's profile Send private message
John R. Graham
Administrator
Administrator


Joined: 08 Mar 2005
Posts: 10655
Location: Somewhere over Atlanta, Georgia

PostPosted: Tue Nov 17, 2009 2:59 am    Post subject: Reply with quote

azp wrote:
...It would be good to have a package.keep file in etc/portage/profile/ so you could protect files (with versions perhaps) from depclean. Then you would have all that stuff in one place, instead of having to edit the world file.
Actually, the world file is exactly that:
  • It's in one place.
  • You don't have to edit it. Just use emerge:
    Code:
    emerge --noreplace =packagename-packageversion
  • It saves you from having to edit another file in /etc/portage. :P
- John
_________________
I can confirm that I have received between 0 and 499 National Security Letters.
Back to top
View user's profile Send private message
John R. Graham
Administrator
Administrator


Joined: 08 Mar 2005
Posts: 10655
Location: Somewhere over Atlanta, Georgia

PostPosted: Tue Nov 17, 2009 3:05 am    Post subject: Reply with quote

cyrillic wrote:
The real question is :
Why is portage-2.2 still (since January) hardmasked when it works fine for many people ?
Policy, perhaps? It hasn't yet met the "30 days without a bug" criterion. There are still bugs being opened and closed against it every week. That said, I use it and find it very stable. I think Zac is doing a fabulous job. :D

- John
_________________
I can confirm that I have received between 0 and 499 National Security Letters.
Back to top
View user's profile Send private message
mv
Watchman
Watchman


Joined: 20 Apr 2005
Posts: 6780

PostPosted: Tue Nov 17, 2009 9:02 am    Post subject: Reply with quote

john_r_graham wrote:
cyrillic wrote:
The real question is :
Why is portage-2.2 still (since January) hardmasked when it works fine for many people ?
Policy, perhaps? It hasn't yet met the "30 days without a bug" criterion.

This criterion (being a guideline anyway and no strict rule) applies only for stabilizing packages, it does not concern hardmasked things. Concerning hardmasks there is almost an opposite rule: This should only be used if it is really known to break some things. Originally, the intention of the hardmask was to force people to test portage-2.1.* for stabilization (although I consider also this reason also questionable). AFAIK know the official reason now is that some things concerning @preserve-libs are known to fail in certain cases. IMHO the better way would be to drop the hardmask and make FEATURES=-preserve-libs the default and to document that this FEATURE is not yet production ready and should be used at most for testing (if this is really the case and the real reason why portage-2.2 is not stable yet): IMHO they are a bit too "over-careful" to keep a mask for a practically working package for almost a year. But of course, the decision is up to the maintainers... similar strange things happen also with baselayout-2 which probably is never going to be stable.
Back to top
View user's profile Send private message
azp
Guru
Guru


Joined: 16 Nov 2003
Posts: 456
Location: Sweden

PostPosted: Wed Nov 18, 2009 11:55 am    Post subject: Reply with quote

I do trust the maintainers, so I'm not going to immediately say "I agree fully", I assume there is a reason for it being masked. But you do have some points, and I can't wait for it to me unmasked. Maybe I'll do it soon myself, how about tomorrow? :wink:
It really speeds up the builds to run --jobs when I have an i7. I was amazed when I tried it earlier this year. --keep-going is also kick-ass!

Is it possible to get a maintainer to comment on this? The unmasked/hardmasked thing I mean? Preeetty pleaaaaseee...
_________________
Weeks of coding can save you hours of planning.
Back to top
View user's profile Send private message
azp
Guru
Guru


Joined: 16 Nov 2003
Posts: 456
Location: Sweden

PostPosted: Wed Nov 18, 2009 11:59 am    Post subject: Reply with quote

john_r_graham wrote:
azp wrote:
...It would be good to have a package.keep file in etc/portage/profile/ so you could protect files (with versions perhaps) from depclean. Then you would have all that stuff in one place, instead of having to edit the world file.
Actually, the world file is exactly that:
  • It's in one place.
  • You don't have to edit it. Just use emerge:
    Code:
    emerge --noreplace =packagename-packageversion
  • It saves you from having to edit another file in /etc/portage. :P
- John


While that is true, I just feel that "maintaining" the world file (which is huge) is much more work than maintaining a small file with three lines in /etc/portage. If I forget that I did the --noreplace =package-version it's going to be there forever, right? While that is not a huge issue, it's still a factor I'm taking into account. Oh, and by "in one place" I meant "all the user based/edited configuration files in the same directory", I'm sorry if I was a bit unclear.
_________________
Weeks of coding can save you hours of planning.
Back to top
View user's profile Send private message
cwr
Veteran
Veteran


Joined: 17 Dec 2005
Posts: 1969

PostPosted: Wed Nov 18, 2009 12:07 pm    Post subject: Reply with quote

I haven't tried it, but won't package.provided do what you want? Or will the
package still be removed, just not replaced?

Will
Back to top
View user's profile Send private message
azp
Guru
Guru


Joined: 16 Nov 2003
Posts: 456
Location: Sweden

PostPosted: Sat Nov 21, 2009 11:33 am    Post subject: Reply with quote

I'm now updating to portage 2.2-*, let's keep our fingers crossed and hope it works out for the best!
_________________
Weeks of coding can save you hours of planning.
Back to top
View user's profile Send private message
Mike Hunt
Watchman
Watchman


Joined: 19 Jul 2009
Posts: 5287

PostPosted: Sat Nov 21, 2009 3:48 pm    Post subject: Reply with quote

azp,

If your world file is "huge", then that may mean that it contains some unnecessary entries. Whatever package that is a dependency on any other package or set is not needed in the world file.

Most of the time the world file becomes cluttered as a result of not using the --oneshot option, when re-emerging something that is a dependency.

For example; nowadays, I suspect that many users have x11-drivers/ stuff in their world files, which is of course totally unnecessary.

But, even a clean world file can grow rather large. So your point is valid. :)
Back to top
View user's profile Send private message
azp
Guru
Guru


Joined: 16 Nov 2003
Posts: 456
Location: Sweden

PostPosted: Sun Nov 22, 2009 6:18 pm    Post subject: Reply with quote

Mike Hunt wrote:
azp,

If your world file is "huge", then that may mean that it contains some unnecessary entries. Whatever package that is a dependency on any other package or set is not needed in the world file.

Most of the time the world file becomes cluttered as a result of not using the --oneshot option, when re-emerging something that is a dependency.

For example; nowadays, I suspect that many users have x11-drivers/ stuff in their world files, which is of course totally unnecessary.

But, even a clean world file can grow rather large. So your point is valid. :)


Aha, that is true. I did not think of that. My system has been around since 2004, so of course the world file has grown quite a bit since I installed it. It is now at 243 lines, so it is definitely larger that my /etc/portage/* files though, hehe.

I run the --depclean every now and then, but I guess that it never cleans out stuff in the world file though. Is there any tool to clean the world file except that?
_________________
Weeks of coding can save you hours of planning.
Back to top
View user's profile Send private message
John R. Graham
Administrator
Administrator


Joined: 08 Mar 2005
Posts: 10655
Location: Somewhere over Atlanta, Georgia

PostPosted: Mon Nov 23, 2009 2:30 am    Post subject: Reply with quote

Vim? Emacs? Nano?? What text editor do you like? One of the regular maintenance activities with Gentoo is to look through the world file to delete entries you didn't mean to end up there. In fact, Portage has been criticized because the default action when you run emerge is "install" as opposed to "update". Many think that's backwards.

- John
_________________
I can confirm that I have received between 0 and 499 National Security Letters.
Back to top
View user's profile Send private message
ferreirafm
Guru
Guru


Joined: 28 Jul 2005
Posts: 487
Location: Sao Paulo, Brazil

PostPosted: Wed Jun 20, 2012 8:03 pm    Post subject: Reply with quote

John R. Graham wrote:
Just use emerge:
Code:
emerge --noreplace =packagename-packageversion
[*]It saves you from having to edit another file in /etc/portage.

Is there any way to revert this? I mean, I don't want to protect such package anymore...
Best,
fred
Back to top
View user's profile Send private message
jburns
Veteran
Veteran


Joined: 18 Jan 2007
Posts: 1217
Location: Massachusetts USA

PostPosted: Wed Jun 20, 2012 8:43 pm    Post subject: Reply with quote

Try
Code:
emerge --deselect=y =packagename-packageversion
Back to top
View user's profile Send private message
jdhore
Retired Dev
Retired Dev


Joined: 13 Apr 2007
Posts: 106

PostPosted: Wed Jun 20, 2012 9:17 pm    Post subject: Reply with quote

I believe the reason portage 2.2 is still without keywords is because there are still many bugs against the 2 big features it adds (sets and preserve-libs) (bug 144480 and bug 240323, respectively). A lot of these issues will probably be resolved by EAPI-4-slot-abi, but who knows. Also, part of the reason most of these bugs still exist is portage 2.1 still needs updates to support new stuff so it's not like 2.2 is the only branch where development is happening...
Back to top
View user's profile Send private message
Jaglover
Watchman
Watchman


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

PostPosted: Wed Jun 20, 2012 10:30 pm    Post subject: Reply with quote

I've been tempted to manage kernel sources by hand, probably less trouble than managing it via portage, ebuild can fetch the tarball.
_________________
My Gentoo installation notes.
Please learn how to denote units correctly!
Back to top
View user's profile Send private message
khayyam
Watchman
Watchman


Joined: 07 Jun 2012
Posts: 6227
Location: Room 101

PostPosted: Wed Jun 20, 2012 11:06 pm    Post subject: Reply with quote

toralf wrote:
john_r_graham wrote:
Code:
equery -q list -i gentoo-sources | awk -- '{ print "=" $1 }' | xargs emerge --noreplace

Off topic here but anyway : is "--" really necessary ?

stricktly speaking neither is/are the xargs, or pipes ...

Code:
emerge --noreplace $(awk '{print "=" $1}' <(equery -q list -i gentoo-sources))


best ... khay
Back to top
View user's profile Send private message
Genone
Retired Dev
Retired Dev


Joined: 14 Mar 2003
Posts: 9611
Location: beyond the rim

PostPosted: Thu Jun 21, 2012 7:32 am    Post subject: Reply with quote

I've been out of the loop for quite some time now, so this is just an educated guess, but it used to be that Zac considered sets not ready for prime time without dependency based set operators (rather than the string based operators I implemented back then). And preserve-libs has another set of issues causing hard-to-figure-out problems annoying users that expect a silver bullet solution to the linking problem (which IMO will never exist).
Back to top
View user's profile Send private message
ferreirafm
Guru
Guru


Joined: 28 Jul 2005
Posts: 487
Location: Sao Paulo, Brazil

PostPosted: Thu Aug 30, 2012 3:53 pm    Post subject: Reply with quote

Hi there,
I've set the "--noreplace"option to some world packages, however, can remember their names anymore.
Is the anyway portage command or emerge option to recover them?
Thanks in advance
Back to top
View user's profile Send private message
John R. Graham
Administrator
Administrator


Joined: 08 Mar 2005
Posts: 10655
Location: Somewhere over Atlanta, Georgia

PostPosted: Thu Aug 30, 2012 4:34 pm    Post subject: Reply with quote

--noreplace isn't an option that is set on a package. It's just an ephemeral instruction to the package manager not to build the package if it's already installed. Other actions still occur, namely, adding the package to the world set if it isn't already.

- John
_________________
I can confirm that I have received between 0 and 499 National Security Letters.
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
Goto page 1, 2  Next
Page 1 of 2

 
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