When a user opts to make /etc/portage/package.use a directory, the idea is generally to reduce the complexity of a given file, and make the contents of a given file more uniform. By default, portage doesn't know what the user wants in each file, but we can employ a little structure to make things easier. The proposal here is that when portage automatically writes to a file in the package.use directory, it follows a set of rules to choose which file to write to. The primary rule that I am proposing at this point in time is that if the USE flag is a USE_EXPAND, that the particular entry be added to the associated file. Generally speaking this would be to write an entry using the $USE_EXPAND category to /etc/portage/package.use/$USE_EXPAND e.g. cat-egory/pkgname abi_x86_32 would be written to /etc/portage/package.use/abi_x86 cat-egory/pkgname python_targets_python2_7 would be written to /etc/portage/package.use/python_targets. cat-egory/pkgname linguas_en_GB would be written to /etc/portage/package.use/linguas An additional rule/feature that would be nice to include with this functionality would be some variable to define the default file to write to. The current behavior is handle only in alphabetical order. The proposal for this rule would be to write to the default file when not fulfilling another rule, and this file is read last when portage reads the files in the package.use directory (to maintain the current behavior that the default file (alphabetically last) is read last.
Current behavior has a rationale: `man emerge`: "--autounmask-write [ y | n ] If --autounmask is enabled, changes are written to config files, respecting CONFIG_PROTECT and --ask. If the corresponding package.* is a file, the changes are appended to it, if it is a directory, changes are written to the lexicographically last file. This way it is always ensured that the new changes take precedence over existing changes." I suggest that you manually edit /etc/portage/package.use in a way preferred by you.
(In reply to Arfrever Frehtes Taifersar Arahesis from comment #1) > Current behavior has a rationale: > `man emerge`: > "--autounmask-write [ y | n ] > If --autounmask is enabled, changes are written to config files, respecting > CONFIG_PROTECT and --ask. If the corresponding package.* is a file, the > changes are appended to it, if it is a directory, changes are written to > the lexicographically last file. This way it is always ensured that the > new changes take precedence over existing changes." > > I suggest that you manually edit /etc/portage/package.use in a way preferred > by you. Right, so in this case (just considering the USE_EXPAND case), let's consider two classes of changes, USE_EXPAND related ones, and non-USE_EXPAND related ones: USE_EXPAND: These would be written to their USE_EXPAND file, so the concern of another file overriding it only happens if the user manually adds a USE_EXPAND entry to another file that is lexographically after the name of the USE_EXPAND non-USE_EXPAND: These would be written to the lexographically last file, ensuring the current behavior persists. Now, let's look at the additional rule that I proposed (which isn't necessary, but makes the USE_EXPAND situation a little cleaner), this basically would do the following: for writing, would be modified to: if [ -z "${DEFAULT_PKG_USE_FILE}" ] ; then write to ${DEFAULT_PKG_USE_FILE} else write to lexographically last file fi and parsing, would be modified to: parse lexographically if [ -z "${DEFAULT_PKG_USE_FILE}" ] ; then parse ${DEFAULT_PKG_USE_FILE} fi
s/lexographically/lexicographically/g