teika Apprentice
Joined: 19 Feb 2011 Posts: 155 Location: YYYY-MM-DD, period. Have you ever used the Internet?
|
Posted: Sun Dec 29, 2013 6:01 am Post subject: [Tip] Preventing world package deletion by mistake |
|
|
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. |
|