FlatImage
A configurable Linux containerization system
Loading...
Searching...
No Matches
ns_recipe Namespace Reference

Package recipe command implementation. More...

Functions

Value< ns_db::ns_recipe::Recipeload_recipe (ns_config::Distribution const &distribution, fs::path const &path_dir_download, std::string const &recipe)
 Loads a recipe from local cache.
 
Value< void > fetch_impl (ns_config::Distribution const &distribution, std::string url_remote, fs::path const &path_file_downloader, fs::path const &path_dir_download, std::string const &recipe, bool use_existing, std::unordered_set< std::string > &dependencies)
 Internal implementation that fetches a recipe and its dependencies recursively with cycle detection.
 
Value< std::vector< std::string > > fetch (ns_config::Distribution const &distribution, std::string url_remote, fs::path const &path_file_downloder, fs::path const &path_dir_download, std::string const &recipe, bool use_existing=false)
 Fetches a recipe from the remote repository along with all its dependencies recursively.
 
Value< void > info (ns_config::Distribution const &distribution, fs::path const &path_dir_download, std::string const &recipe)
 Displays information about a locally cached recipe.
 
template<typename F>
requires std::invocable<F,std::string,std::vector<std::string>&>
Value< int > install (ns_config::FlatImage const &fim, ns_config::Distribution const &distribution, fs::path const &path_dir_download, std::vector< std::string > const &recipes, F &&callback)
 Installs packages from recipes using the appropriate package manager.
 

Detailed Description

Package recipe command implementation.

Implements the fim-recipe command for installing distribution-specific package recipes. Handles recipe downloading from remote repositories, dependency resolution, package installation via distribution package managers, and recipe caching. Supports pre-configured software bundles like audio, GPU drivers, and desktop environments.

Function Documentation

◆ fetch()

Value< std::vector< std::string > > ns_recipe::fetch ( ns_config::Distribution const & distribution,
std::string url_remote,
fs::path const & path_file_downloder,
fs::path const & path_dir_download,
std::string const & recipe,
bool use_existing = false )
inlinenodiscard

Fetches a recipe from the remote repository along with all its dependencies recursively.

Parameters
distributionName of the distribution
url_remoteRemote repository URL
path_file_downloderPath to the downloader executable
path_dir_downloadDirectory where the recipe will be downloaded
recipeName of the recipe to download
use_existingIf true, use existing local file if available; if false, always download
Returns
Value<std::vector<std::string>> Vector of all fetched recipe names (including dependencies) on success, or error

Definition at line 201 of file recipe.hpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ fetch_impl()

Value< void > ns_recipe::fetch_impl ( ns_config::Distribution const & distribution,
std::string url_remote,
fs::path const & path_file_downloader,
fs::path const & path_dir_download,
std::string const & recipe,
bool use_existing,
std::unordered_set< std::string > & dependencies )
inlinenodiscard

Internal implementation that fetches a recipe and its dependencies recursively with cycle detection.

Parameters
distributionName of the distribution
url_remoteRemote repository URL
path_file_downloaderPath to the downloader executable
path_dir_downloadDirectory where the recipe will be downloaded
recipeName of the recipe to download
use_existingIf true, use existing local file if available; if false, always download
dependenciesSet of fetched recipes to track and detect cycles
Returns
Value<void> Nothing on success, or error on failure/cycle detection

Definition at line 103 of file recipe.hpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ info()

Value< void > ns_recipe::info ( ns_config::Distribution const & distribution,
fs::path const & path_dir_download,
std::string const & recipe )
inlinenodiscard

Displays information about a locally cached recipe.

Parameters
distributionName of the distribution
path_dir_downloadDirectory where recipes are cached
recipeName of the recipe to inspect
Returns
Value<void> Nothing on success, or the respective error

Definition at line 223 of file recipe.hpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ install()

template<typename F>
requires std::invocable<F,std::string,std::vector<std::string>&>
Value< int > ns_recipe::install ( ns_config::FlatImage const & fim,
ns_config::Distribution const & distribution,
fs::path const & path_dir_download,
std::vector< std::string > const & recipes,
F && callback )
inlinenodiscard

Installs packages from recipes using the appropriate package manager.

Template Parameters
FCallable type for executing commands (signature: F(std::string, std::vector<std::string>&))
Parameters
fimFlatImage configuration object
distributionName of the current linux distribution (e.g., "arch", "alpine")
path_dir_downloadDirectory where recipes are cached
recipesVector of recipe names to install packages from
callbackFunction to execute the package manager command, receives program name and arguments
Returns
Value<int> Exit code on success, or the respective error

Definition at line 275 of file recipe.hpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ load_recipe()

Value< ns_db::ns_recipe::Recipe > ns_recipe::load_recipe ( ns_config::Distribution const & distribution,
fs::path const & path_dir_download,
std::string const & recipe )
inlinenodiscard

Loads a recipe from local cache.

Parameters
distributionName of the distribution
path_dir_downloadDirectory where recipes are cached
recipeName of the recipe to load
Returns
Value<ns_db::ns_recipe::Recipe> Recipe object with contents on success, or the respective error

Definition at line 68 of file recipe.hpp.

Here is the call graph for this function:
Here is the caller graph for this function: