Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
[Tip] Preventing world package deletion by mistake
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Documentation, Tips & Tricks
View previous topic :: View next topic  
Author Message
teika
Apprentice
Apprentice


Joined: 19 Feb 2011
Posts: 155
Location: YYYY-MM-DD, period. Have you ever used the Internet?

PostPosted: Sun Dec 29, 2013 6:01 am    Post subject: [Tip] Preventing world package deletion by mistake Reply with quote

If you have an experience of deleting packages in "world" by forgetting you need them, and by guessing they may be unnecessary, then this tip is for you. Here're described ways to both:
* make "emerge --depclean <package>" refuse to unmerge, and to
* note down why you need these packages.

This can be achieved at least by two methods, (1) by putting these packages into "system" set or (2) by emerging a virtual package that depends them.

Method 1: Put'em into "system" set (Pointed out by szatox in this post.)

Description: You can register packages into "system" set by using /etc/portage/profile/packages file. Comment lines should begin with # (but inline comments are not allowed.) Put one atom (≅ package names) per a line, prefixed by *. No space between * and the atom.

Pros: straightforward. Cons: even if you need them, system may be excessive.

Example /etc/portage/profile/packages:
# My custom udev script needs this:
*dev-util/foo
# Fixes historical encodings in my custom script bar.sh
*app-i18n/baz


Method 2: Let a virtual package depend them.

Description: Prepare a package in your portage overlay, e.g. "virtual/my-world", and enumerate the packages you want to keep in "DEPEND" (or "RDEPEND".)

Pros: Not system. Cons: A portage overlay is necessary. In future you may need to update EAPI.

Example virtual/my-world-20131221.ebuild:
EAPI=5

DESCRIPTION="my-world pins down some packages with reasons"
HOMEPAGE=""
SRC_URI=""

LICENSE=""
SLOT="0"
KEYWORDS="amd64 <or your platform>"
IUSE=""

# My custom udev script needs this:
DEPEND="dev-util/foo"

# Fixes historical encodings in my custom script bar.sh
DEPEND="${DEPEND} app-i18n/baz"

# Don't forget you can't use # inside of DEPEND


Question: Can I insert comments to /var/lib/portage/world?
Answer: Don't do that, even though you can. Each time that file is updated, as far as I observed, comments are deleted.

Best regards.
_________________
Hack of easy Shift / Ctrl / AltGr etc; save your pinkies, type without drudgery: topic 865313

XPAT - Xi, Putin, Abe and Trump - are security holes of their own nations.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Documentation, Tips & Tricks 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