I am not clear if I should be using --oneshot as the defacto way I should be emerging packages.

If I understand correctly emerging without it will add that package to my world file. With it, will keep it out of my world file. Apparently, my world file may be "polluted" because I wasn't doing this.

So is there a simple rule? When do I use --oneshot and when do I want to avoid it? What kind of package exactly do I want to populate my world file?

Thanks as usual everyone.

Quote:

--oneshot, -1
Emerge as normal, but do not add the packages to the world file for later updating.
WARNING: This option should only be used for packages that are reachable from the @world package set (those that would not be removed by --depclean), since dependencies of unreachable packages are allowed to be broken when satisfying dependencies of other packages. Broken dependencies of this sort will invalidate assumptions that make it possible for --deep to be disabled by default.

If you're emerging something that you don't want to keep, you can use --oneshot to make it eligible for --depclean in the future. That means if you forget to unmerge something you were just checking out, Portage will clean up the mess.

If you're emerging something that you definitely want to keep, don't use --oneshot.

Also, as a corollary to #2 above, if you later decide that you want to keep the package, re-emerge it with --noreplace, which will avoid the actual build but otherwise add it to the @world set so that it will be protected from --depclean. --noreplace is really quick for already installed packages.

Edit: Corrected a bad typo.

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

Last edited by John R. Graham on Sun Apr 15, 2018 4:50 pm; edited 2 times in total

If you're emerging something that you don't want to keep, you can use --oneshot to make it eligible for --depclean in the future. That means if you forget to unmerge something you were just checking out, Portage will clean up the mess.

If you're emerging something that you definitely want to keep, don't use --depclean.

- John

Thank you, everyone. I think I understand.

So basically if I don't want something removed from my system by --depclean or otherwise, I should allow it to be added to my world file?

I'm a little foggy on this bit...

Quote:

If you're emerging something that you definitely want to keep, don't use --depclean.

Right! That's a part of regular Gentoo hygiene, like brushing & flossing regularly. You can look at it directly, you know: just edit /var/lib/portage/world.

There's a nuance that I should probably explain. For abstruse historical reasons, the contents of the /var/lib/portage/world file actually describes the members of the @selected set. The @world set actually consists of the union of (i.e., all members of) the @profile, @system, and @selected sets. This is why "emerge -u @world" will update your whole system. Thus you can individually update:

@selected: Just the packages you've explicitly installed (and their dependencies).

@system: Just the underlying basic Gentoo system packages (and their dependencies).

@world: All of the above.

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

Mr. T., this is almost wholly incorrect. The @world set has never been defined that way, even back before sets were formalized in Portage. See my explanation above. However, there are some confusing historical artifacts, namely that the world file, which does contain explicitly emerged packages, is not what defines the members of the @world set.

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

John R. Graham, I should have been more explicit! Foremost, this is @selected-packages that matches packages specified in /var/lib/portage/world [man emerge].
Finally, several indications confirm that @world does not include dependencies.

"A set is a convenient shorthand for a large group of packages."

emerge doesn't indicate dependencies of installed packages.

The @installed set includes all installed packages unlike the @world set.

emerge "displays" a computedtree: a set of packages and their dependencies.

A set is a convenient shorthand for a large group of packages. Six sets are currently always available: selected-packages, selected-sets, selected, system, profile, and world. selected-packages contains the user-selected "world" packages that are listed in /var/lib/portage/world, while selected-sets contains the nested sets that may be listed in /var/lib/portage/world_sets. system and profile both refer to sets of packages deemed necessary for your system to run properly (the differences between these two sets are documented in portage(5)). selected encompasses both the selected-packages and selected-sets sets, while world encompasses the selected, system and profile sets. (See FILES below for more information.) Other sets can exist depending on the current configuration. The default set configuration is located in the /usr/share/portage/config/sets directory. User sets may be created by placing files in the /etc/portage/sets/ directory (see portage(5)). Note that a set is generally used in conjunction with --update. When used as arguments to emerge sets have to be prefixed with @ to be recognized. Use the --list-sets action to display a list of available package sets.

/usr/share/portage/config/sets/portage.conf wrote:

Code:

# Not much that could be changed for world, so better leave it alone
[world]
class = portage.sets.base.DummyPackageSet
packages = @profile @selected @system

# Same as for world, though later portage versions might use a different class
[system]
class = portage.sets.profiles.PackagesSystemSet

While @installed is special :

/usr/share/portage/config/sets/portage.conf wrote:

Code:

# A superset of the classic <parameter>world</parameter> target, a set created
# by this class contains SLOT atoms to match all installed packages. Note that
# use of this set makes it impossible for emerge to solve blockers by automatic
# uninstallation of blocked packages.
[installed]
class = portage.sets.dbapi.EverythingSet

_________________"The only difference between me and a madman is that I am not MAD" (SALVATOR DALI)

So basically if I don't want something removed from my system by --depclean or otherwise, I should allow it to be added to my world file?

Keep in mind : this is only true strictly to the package you have add to world
if you put gentoo-sources in world, gentoo-sources will be protected ; but this should be read as "only latest gentoo-sources" or "only one version because as long as one version remains, gentoo-sources remains"

That's the classic misunderstanding from users that get their kernel source removed.
If you install and use "gentoo-sources-1", but protect "gentoo-sources", then as soon as a "gentoo-sources-2" appears:
1/ it is an update, so it will be install
2/ gentoo-sources-2 is also "gentoo-sources", and portage will protect gentoo-sources "latest" version, and latest one is now -2
3/ because gentoo-sources-1 is not protect, and "seems" unused (even user use them, portage or any packages install is not using them): removed.

how could you protect gentoo-sources-1?
* by adding gentoo-sources-1 in world instead of gentoo-sources
how could you still get gentoo-sources latest version?
* by adding gentoo-sources in world

Adding gentoo-sources-1 in world protect gentoo-sources-1, but only allow upgrade to gentoo-sources-1*
Adding gentoo-sources in world protect gentoo-sources, but allow upgrade to any gentoo-sources (which mean always latest available)
And because both are protect, portage will continue to install latest gentoo-sources, while gentoo-sources-1 will never get removed until you decide to remove it from world or remove the package yourself.

John R. Graham, I should have been more explicit! Foremost, this is @selected-packages that matches packages specified in /var/lib/portage/world [man emerge].
Finally, several indications confirm that @world does not include dependencies.

"A set is a convenient shorthand for a large group of packages."

emerge doesn't indicate dependencies of installed packages.

The @installed set includes all installed packages unlike the @world set.

emerge "displays" a computedtree: a set of packages and their dependencies.

Mr. T,

It's good that youre reading and trying to learn but I'm not sure what we're arguing about. I didn't say that the @world set contained dependencies. What I said was that updating @world (emerge --update) would also update the dependencies of @world. But since this is all sort of drive by / off topic for this thread, let's leave it at that, okay?

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