portmod
CLI Package manager designed for packaging game mods
usage: portmod [-h] [-q] [-v] [--no-confirm] [--version]
{<example>,mirror,init,sync} ...
Positional Arguments
- subcommand_name
Possible choices: <example>, mirror, init, sync
Named Arguments
- -q, --quiet
Don’t display anything but the most important information.
- -v, --verbose
Increase verbosity of output.
- --no-confirm
Don’t prompt for confirmation and always select the default option instead.
- --version
Displays the version number of Portmod.
Sub-commands
<example>
Interact with the <example> prefix
portmod <example> [-h]
{merge,search,select,query,use,info,validate,destroy,run,cfg-update,module-update}
...
Positional Arguments
- prefix_subcommand_name
Possible choices: merge, search, select, query, use, info, validate, destroy, run, cfg-update, module-update
Sub-commands
merge
Install or remove packages
Packages passed as arguments will always be installed (or re-installed) unless the --update
flag is used, and will be selected (tracked as explicitly installed and not removed unless explicitly removed) unless the --oneshot
flag is used.
Package changes are displayed using a transaction list of the following form:
[XX] category/package-name USE="flag -disabled-flag"
- X is a placeholder for one of the following:
f fetch-restricted, but already available in the download cache
F fetch-restricted, but unavailable in the download cache (must be downloaded manually)
N (new) indicates the package was not previously installed
R (reinstall) indicates that the same version of the package is being re-installed.
U (update) indicates that the package is being updated to new version
D (downgrade) indicates that the package is being downgraded to an older version
d (delete) indicates that the package is being removed
- USE flags:
Enabled flags are displayed bold red.
Disabled flags are displayed blue.
Flags which have changed since the last time the package was installed are displayed bold green.
Flags in use expand categories are displayed in the form CATEGORY=”flag” (for the flag ‘category_flag’)
portmod <example> merge [-h] [--ignore-default-opts] [-c] [-x] [-C] [-1] [-O]
[-u] [-n] [-N] [-e] [-D] [-w [Yes/No]]
[--deselect [Yes/No]] [--debug]
[ATOM | ARCHIVE | @SET ...]
Positional Arguments
- ATOM | ARCHIVE | @SET
Packages to install. Can be either a package atom (“category/name”) set (“@set_name”) or source archive path (“path/to/archive.ext”). If an archive path is passed as an argument, portmod will search for matching archives used by packages it is aware of. Portmod cannot install from arbitrary archives.
Named Arguments
- --ignore-default-opts
Causes the OMWMERGE_DEFAULT_OPTS environment variable to be ignored
- -c, --depclean
Removes packages and their dependencies. Packages dependent on the given packages will also be removed. If no arguments are given, this will remove packages that aren’t needed by other packages and aren’t in the world file or system set.
- -x, --auto-depclean
Automatically remove unneeded dependencies before finishing. Equivalent to running portmod <prefix> merge –depclean after other operations.
- -C, --unmerge
Removes the given packages without checking dependencies.
- -1, --oneshot
Do not make any changes to the world set when installing or removing packages
- -O, --nodeps
Ignore dependencies when installing specified packages. Note: This may cause packages to fail to install if their build dependencies aren’t satisfied, and fail to work if their runtime dependencies aren’t satisfied.
- -u, --update
Updates packages to the best version available and excludes packages if they are already up to date.
- -n, --noreplace
This option has been merged into –update and is now deprecated.
- -N, --newuse
This option has been merged into –update and is now deprecated.
- -e, --emptytree
Reinstalls target packages and their entire deep dependency tree, as if no packages are currently installed.
- -D, --deep
Consider the entire dependency tree when doing updates instead of just the packages specified on the command line.
- -w, --select
Adds specified packages to the world set (unused. This is the default if deselect is not provided).
- --deselect
Removes specified packages from the world set. This is implied by uninstall actions such as –depclean and –unmerge. Use –deselect=n to prevent uninstalls from removing packages from the world set.
- --debug
Skips the cleanup stage after installation so that the contents of temporary directories can be inspected. Note that you will need to clean up leftover files manually.
search
Searches the repository for packages with a name or atom matching the given search terms
portmod <example> search [-h] QUERY [QUERY ...]
Positional Arguments
- QUERY
Search query phrases to match against
select
Select between configuration options
portmod <example> select [-h] {profile,news,repo} ...
Sub-commands
profile
Manage the profile symlink
portmod <example> select profile [-h] {list,set,show,debug} ...
Sub-commands
list
List available profiles
portmod <example> select profile list [-h]
set
Set a new profile symlink target
portmod <example> select profile set [-h] NUMBER
Positional Arguments
- NUMBER
Profile number
show
Show the current profile symlink target
portmod <example> select profile show [-h]
debug
Show debug information about the current profile
portmod <example> select profile debug [-h]
news
Manage news
portmod <example> select news [-h] {list,read,unread} ...
Sub-commands
list
List all news articles
portmod <example> select news list [-h]
read
Displays news article and marks as read
portmod <example> select news read [-h] [<item>]
Positional Arguments
- <item>
new (default) all or item number
Default: “new”
unread
Marks news article as unread
portmod <example> select news unread [-h] <item>
Positional Arguments
- <item>
all or item number
repo
Configure the repositories associated with this prefix
portmod <example> select repo [-h] {list,add,remove} ...
Sub-commands
list
List available package repositories
portmod <example> select repo list [-h]
add
Add a package repository to this prefix
portmod <example> select repo add [-h] REPO
Positional Arguments
- REPO
Identifier for the repository. Either the repository name, or its index in the list.
remove
Remove a package repository from this prefix
portmod <example> select repo remove [-h] REPO
Positional Arguments
- REPO
Identifier for the repository. Either the repository name, or its index in the list.
query
Query information about packages
portmod <example> query [-h] [-a]
{list,depends,has,hasuse,uses,meta,depgraph,vfsfind,vfslist}
...
Named Arguments
- -a, --all
Also query packages which are not installed
Sub-commands
list
List all packages matching ATOM.
By default only lists installed packages.
Produces output in the form of:
[IR] category/package-version
The Presence of the I flag indicates that the package is installed The Presence of the R flag indicates that the package is available in a repository
portmod <example> query list [-h] [-r] ATOM | @SET [ATOM | @SET ...]
Positional Arguments
- ATOM | @SET
Atoms specifying the packages to list
Named Arguments
- -r, --remote
If specified, also list packages in the remote repositories
depends
List all packages directly depending on ATOM
portmod <example> query depends [-h] ATOM
Positional Arguments
- ATOM
Package atom to query
has
List all packages matching variable.
This can only be used to scan variables in the base Pybuild spec, not custom fields declared by specific Pybuilds or their superclasses.
portmod <example> query has [-h] [--invert] FIELD [VALUE]
Positional Arguments
- FIELD
Pybuild field to search
- VALUE
Value to match in field
Default: “”
Named Arguments
- --invert
If set, returns packages which do not match the query
hasuse
List all packages that declare the given use flag.
Note that this only includes those with the flag in their IUSE field and inherited flags through IUSE_EFFECTIVE will not be counted
portmod <example> query hasuse [-h] FLAG
Positional Arguments
- FLAG
Use flag to match against
uses
Display use flags and their descriptions
portmod <example> query uses [-h] ATOM
Positional Arguments
- ATOM
Atom specifying the package whose flags are to be displayed
meta
Display metadata for a package
portmod <example> query meta [-h] ATOM
Positional Arguments
- ATOM
Atom specifying the package whose metadata is to be displayed
depgraph
Display dependency graph for package
portmod <example> query depgraph [-h] [--depth DEPTH] ATOM
Positional Arguments
- ATOM
Atom specifying package whose dependency graph is to be displayed
Named Arguments
- --depth
Maximum depth of the tree to be displayed. Default is 10
vfsfind
Display the full path of the given file/directory in the VFS
portmod <example> query vfsfind [-h] name
Positional Arguments
- name
Display the full path of the given file/directory in the VFS
vfslist
Display the contents of the given directory in the VFS
portmod <example> query vfslist [-h] [directory_path]
Positional Arguments
- directory_path
Display the contents of the given directory in the VFS
use
Enable and disable use flags
portmod <example> use [-h] [-E FLAG] [-D FLAG] [-R FLAG] [-p ATOM]
Named Arguments
- -E
Enable use flag
- -D
Explicitly disable use flag
- -R
Remove references to the given use flag (enabled or disabled)
- -p
Package atom for setting local use flag. If not set, enables/disables global use flags.
info
Displays the values of several global variables for debugging purposes.
portmod <example> info [-h]
validate
Check if the packages in the package directory are installed, and that the directories in the config all exist.
portmod <example> validate [-h]
destroy
Destroy this prefix
portmod <example> destroy [-h] [--preserve-root] [--remove-config]
Named Arguments
- --preserve-root
Don’t remove the prefix ROOT when destroyign the prefix (removed by default)
- --remove-config
Remove the prefix config directory when destroyign the prefix (not removed by default)
run
Run commands within the sandbox for the prefix
portmod <example> run [-h] COMMAND [COMMAND ...]
Positional Arguments
- COMMAND
Command to execute. If the command contains arguments beginning with “-“, then it must be prefixed with – to separate it from the arguments to portmod.
cfg-update
Interactively applies pending updates to protected config files.
portmod <example> cfg-update [-h]
module-update
Runs module updates.
portmod <example> module-update [-h]
mirror
Update a local mirror
portmod mirror [-h] DIRECTORY REPO
Positional Arguments
- DIRECTORY
Directory to mirror into
- REPO
Repository with the files to mirror. Mirroring will be limited to this repository and its masters.
init
Create a new prefix
portmod init [-h] PREFIX arch [DIRECTORY]
Positional Arguments
- PREFIX
Prefix name which will be used in commands that interact with the prefix
- arch
Game engine Architecture of the prefix
- DIRECTORY
Directory in which to create the prefix. If omitted, portmod will create the prefix within a new directory in /tmp/portmod.test/local.
If files already exist in the directory, they will be left alone to allow portmod to work with existing game data. Portmod may install over top of these files, however the original versions will be preserved and restored if the package overwriting those files is removed, or the prefix is removed.
sync
Fetch and update remote package repositories
portmod sync [-h] [repository ...]
Positional Arguments
- repository
Repositories to sync. If omitted, all repositories in repos.cfg will be synched.