- Shell 100%
| emergenc.sh | ||
| README.md | ||
Emerge-NC
Emerge Native Configurator is a lightweight terminal program created to simplify additions to Gentoo Portage configuration files, including USE flags, package masks/unmasks, and ACCEPT_KEYWORDS.
Emerge-NC provides an interactive prompt while keeping Portage's output visible, reducing the need to remember package paths and configuration syntax.
Install
Go to the Directory where you want to download the repo:
git clone https://github.com/FMallon/Emerge-NC && cd "Emerge-NC" && chmod +x emergenc.sh && sudo ln -sf "$(pwd)/emergenc.sh" /usr/local/bin/enc
Usage
Emerge-NC (enc) helps simplify Gentoo Portage configuration changes.
When Portage reports that a package requires additional configuration, such as:
- USE flags
- ACCEPT_KEYWORDS
- Package Masks/Unmasks
Emerge-NC provides an interactive prompt to append the required configuration, keeping Portage's output visible during configuration, reducing the need to remember package names and configuration syntax.
enc <option> <package name>
-> enc --use/-u <package name> | Edit USE Flags for a package
-> enc --mask/-m <package name> | Mask a package
-> enc --unmask/-um <package name> | Unmask a package
-> enc --accept-keyword/-akw <package name> | Edit the ACCEPT_KEYWORDS for a package
Basic Workflow
First, preview the package requirements:
emerge -pv category/package_name
Example:
emerge -pv gui-apps/wev
Portage will display any required changes.
Example:
gui-apps/wev man
Use Emerge-NC to append the required configuration.
Adding USE Flags
If a package requires additional USE flags:
Example:
emerge -pv gui-apps/wev
Portage reports:
gui-apps/wev man
Run:
sudo enc --use wev
or:
sudo enc -u wev
Note: The package name is optional. Emerge-NC will use the information displayed by Portage, so you can provide either:
gui-apps
or simply:
wev
A prompt will appear:
>
Enter the required configuration:
gui-apps/wev man
Press Enter to finish entering the line.
Press:
Ctrl+D
to start the append operation.
The configuration will be appended to the appropriate /etc/portage/package.use/ file.
After adding the USE flag, rebuild the package with the new USE configuration:
sudo emerge -av --newuse gui-apps/wev
Adding ACCEPT_KEYWORDS
If a package is masked because it requires an unstable keyword:
Example:
emerge -pv gui-apps/wlogout
Portage reports:
The following package is masked:
gui-apps/wlogout (~amd64)
Run:
sudo enc --accept-keyword wlogout
or:
sudo enc -akw wlogout
A prompt will appear:
>
Enter:
gui-apps/wlogout ~amd64
Press Enter to complete the line.
Press:
Ctrl+D
to append the configuration.
Verify that the package is now available:
emerge -pv gui-apps/wlogout
The package should now be eligible for installation.
Install:
sudo emerge -av gui-apps/wlogout
Notes
Emerge-NC only appends configuration changes.
It does not overwrite existing Portage configuration files.
Information about whether a new or existing file is being appended to will appear at the beginning of the output under [INFO].
Recommended workflow:
- Preview package requirements:
emerge -pv category/package
-
Add the required configuration using Emerge-NC.
-
Re-check the package:
emerge -pv category/package
- Install or rebuild:
sudo emerge -av category/package
Return Codes
| Code | Description |
|---|---|
| 0 | Successful execution |
| 1 | Emerge/Portage not detected |
| 2 | Invalid option |
| 3 | Invalid number of args |
| 4 | Missing root privileges |
| 5 | Required Portage directory missing |
| 6 | File name does not pass the required regex |
| 7 | User cancelled input |
| 8 | File append failure |