GLEP:69

Abstract
This GLEP describes a configuration file format that can be used to construct named INSTALL_MASK entries. Those entries can be used to allow users to easily filter out files installed by packages without forcing them to get into implementation details, alike USE flags.

Motivation
Currently there are two major ways of filtering files installed by packages: USE flags and INSTALL_MASK.

The advantage of USE flags is that they are cleanly supported, and therefore provide an elegant way of providing choice. However, they require each ebuild to provide a specific code path to handle them, and each value change requires rebuilding the whole package — which often comes with a greater cost than the cost of installing the file unnecessarily. It also causes USE flag differences in binary packages, making them less reusable.

INSTALL_MASK is implemented purely at Package Manager (Portage) level, and therefore requires no specific ebuild support. Instead, it assumes that offending files are installed in specific locations, and therefore they can be filtered out uniformly. The files are still included in binary packages (and filtered out during install), so the same binary package can be used both on systems using the files and filtering them out. However, the major disadvantage of INSTALL_MASK is that it's rather low-level by design, requesting user to explicitly name paths to be wiped.

This GLEP aims to enhance the INSTALL_MASK support to solve the shortcomings of INSTALL_MASK by providing a clear and transparent way of filtering out files by their function without having to explicitly type the paths. Moreover, it makes it possible to update the filtered out paths without having to update the ebuilds or user systems.

Specification
Each repository can specify zero or more INSTALL_MASK names. The names are defined in metadata/install-mask.conf file which has sectioned, key-value format (alike .ini files).

Each section is started by [name], with name specifying the defined entry name, and must have:
 * one or more path keys, each one specifying a single path to be filtered. The path is specified as a wildcard, and all paths matching it are filtered. If the path matches a directory, the directory is filtered recursively. Enabling the entry causes all listed paths to be filtered;
 * exactly one description key, specifying human-readable description of the mask.

When a particular named INSTALL_MASK is enabled, the Package Manager must prevent the paths named in path keys from being installed to the system (recursively). However, it is recommended for INSTALL_MASK not to apply to binary packages for better interoperability. It is also recommended for Package Manager to support negating and stacking different entries.

For example, the following configuration can be used in make.conf:

This would specifically:
 * 1) blacklist all files in /etc/my-custom-folder,
 * 2) blacklist all localizations,
 * 3) whitelist polish localizations.

With the last entry matching path deciding on the final action.

Rationale
TODO.

Backwards Compatibility
Current INSTALL_MASK entries (using absolute paths) will still be supported.

The additional configuration file will have no effect (be ignored) on non-compliant Package Managers.

Reference implementation
TODO.

Copyright
This work is licensed under the Creative Commons Attribution-ShareAlike 3.0 Unported License. To view a copy of this license, visit http://creativecommons.org/licenses/by-sa/3.0/.