Skip to main content

Module profile

Module profile 

Source
Expand description

r2modman-compatible profile management. Profile installs on top of crate::install: five high-level operations (install an extracted package, uninstall, enable, disable, and the full download-resolve-install pipeline) that work against an arbitrary target directory. mods.yml (modlist) is the authoritative install record in every mode.

Two layers share the same primitives:

A caller-supplied target_dir is caller-owned and expected to already be absolute; unlike a layout profile name it is not name-validated here — there is no layout::validate_name-equivalent check on it, the caller is trusted to pass a real directory. Package contents are still traversal-guarded regardless of mode: crate::install’s ensure_safe_relative rejects any archive entry or computed destination that would escape target_dir.

install_mod_in/install_mod additionally take a cache_base independent of the install target: extracted packages land under cache::ensure_extracted(cache_base, ...), never under target_dir. cache_base must persist across installs — it is also the restore source crate::install::enable_mod copies from when re-enabling a State- tracked mod — and in server mode it must not be target_dir itself, or cache contents would sit inside the installed mod tree.

Modules§

cache
Extract packages into the per-game package cache. Extract packages into the per-game package cache.
launch
Compute a launch invocation and stage loader files. Compute how to launch a game with a target directory’s mods applied.
layout
Directory layout and profile lifecycle (named r2modman profiles; client mode). Directory layout and profile lifecycle.
modlist
The mods.yml model and its read/write. The mods.yml model and its read/write.
portability
.r2z export/import and Thunderstore profile codes. r2modman-compatible profile portability: .r2z export/import and shareable Thunderstore profile codes.
target
Where an install goes: a named profile, or the game directory itself. Where an install goes.

Structs§

BatchOutcome
The per-item result of a batch operation.
InstallBatch
What an install batch will install, and whose disabled state it must restore afterwards.
ToggleBatch
What a bulk enable or disable will do.
UninstallBatch
What an uninstall batch will remove.

Enums§

NotRemovable
Why a recorded mod’s files cannot be removed exactly.

Functions§

check_removable_batch
Every one of names that cannot be removed exactly, with the reason.
disable_mod
Disables an installed mod. See set_enabled.
disable_mod_in
Disables an installed mod in target_dir. See set_enabled_in.
enable_mod
Enables an installed mod. See set_enabled.
enable_mod_in
Enables an installed mod in target_dir. See set_enabled_in.
ensure_removable
Whether full_name’s files can be removed exactly, reporting the reason when they cannot.
install_batch
Installs every identifier in batch, restoring protected disabled state afterwards, and reports per-item outcomes.
install_extracted
Installs an already-extracted package into an r2modman-layout profile (<base>/<game>/profiles/<profile_name>). See install_extracted_in.
install_extracted_in
Installs an already-extracted package into target_dir: plans the file copy, removes any copy already installed (its namespaced <route>/<ident>/ folders and State-tracked files, as r2modman uninstalls before installing), applies the copy, writes the _state tracker for any State-tracked files, and upserts the mods.yml entry.
install_mod
Installs a mod and its full dependency closure into an r2modman-layout profile, using base as both the profile base and the package cache base (matching this pipeline’s pre-existing behavior). See install_mod_in.
install_mod_in
Installs one mod and its dependency closure, protecting the disabled state of every recorded mod it did not name. See install_batch.
mod_entry_from_version
Builds a ProfileMod from a Thunderstore Version, applying the same defaults r2modman uses for a Thunderstore install (fromThunderstoreCombo): manifestVersion=1, gameVersion="0", networkMode="both", packageType="other", installMode="managed".
plan_install_batch
Plans an install batch against target_dir’s current record.
plan_set_enabled_batch
Plans a bulk enable or disable. names of None means every recorded mod.
plan_uninstall_batch
Plans an uninstall, refusing before anything is mutated.
reapply_batch_disabled
Re-disables everything batch protects, after the installs have run.
set_enabled
Enables or disables an installed mod in an r2modman-layout profile. See set_enabled_in.
set_enabled_batch
Applies batch, reporting per-item outcomes.
set_enabled_in
Enables or disables an installed mod in target_dir: applies the on-disk file toggle through the install layer, then flips enabled in mods.yml. Errors if the mod is not present in target_dir.
uninstall_batch
Removes everything batch names, loaders last, reporting per-item outcomes.
uninstall_mod
Uninstalls a mod from an r2modman-layout profile. See uninstall_mod_in.
uninstall_mod_in
Uninstalls a mod from target_dir: removes its mods.yml entry, reconciles the on-disk namespaced folders against the remaining set (so only this mod’s folders are removed), and removes its State-tracked payload files along with its _state file.