## DnfContext

DnfContext

## Functions

gboolean | dnf_context_globals_init ()
DnfContext * | dnf_context_new ()
const gchar * | find_base_arch ()
const gchar * | dnf_context_get_config_file_path ()
gboolean | dnf_context_is_set_config_file_path ()
const gchar * const * | dnf_context_get_repos_dir ()
const gchar * | dnf_context_get_repo_dir ()
const gchar * const * | dnf_context_get_vars_dir ()
const gchar * | dnf_context_get_base_arch ()
const gchar * | dnf_context_get_os_info ()
const gchar * | dnf_context_get_arch_info ()
const gchar * | dnf_context_get_release_ver ()
const gchar * | dnf_context_get_platform_module ()
const gchar * | dnf_context_get_cache_dir ()
const gchar * | dnf_context_get_arch ()
const gchar * | dnf_context_get_solv_dir ()
const gchar * | dnf_context_get_lock_dir ()
const gchar * | dnf_context_get_rpm_verbosity ()
const gchar * | dnf_context_get_install_root ()
const gchar * | dnf_context_get_source_root ()
const gchar ** | dnf_context_get_native_arches ()
const gchar ** | dnf_context_get_installonly_pkgs ()
gboolean | dnf_context_get_best ()
gboolean | dnf_context_get_install_weak_deps ()
gboolean | dnf_context_get_allow_vendor_change ()
gboolean | dnf_context_get_cache_only ()
gboolean | dnf_context_get_check_disk_space ()
gboolean | dnf_context_get_check_transaction ()
gboolean | dnf_context_get_keep_cache ()
gboolean | dnf_context_get_only_trusted ()
gboolean | dnf_context_get_zchunk ()
gboolean | dnf_context_get_write_history ()
guint | dnf_context_get_cache_age ()
guint | dnf_context_get_installonly_limit ()
const gchar * | dnf_context_get_http_proxy ()
gboolean | dnf_context_get_enable_filelists ()
GPtrArray * | dnf_context_get_repos ()
DnfRepoLoader * | dnf_context_get_repo_loader ()
DnfTransaction * | dnf_context_get_transaction ()
DnfSack * | dnf_context_get_sack ()
HyGoal | dnf_context_get_goal ()
DnfState * | dnf_context_get_state ()
const char * | dnf_context_get_user_agent ()
void | dnf_context_set_config_file_path ()
void | dnf_context_set_repos_dir ()
void | dnf_context_set_repo_dir ()
void | dnf_context_set_vars_dir ()
void | dnf_context_set_release_ver ()
void | dnf_context_set_platform_module ()
void | dnf_context_set_cache_dir ()
void | dnf_context_set_arch ()
void | dnf_context_set_solv_dir ()
void | dnf_context_set_vendor_cache_dir ()
void | dnf_context_set_vendor_solv_dir ()
void | dnf_context_set_lock_dir ()
void | dnf_context_set_rpm_verbosity ()
void | dnf_context_set_install_root ()
void | dnf_context_set_source_root ()
void | dnf_context_set_best ()
void | dnf_context_set_install_weak_deps ()
void | dnf_context_set_allow_vendor_change ()
void | dnf_context_set_cache_only ()
void | dnf_context_set_check_disk_space ()
void | dnf_context_set_check_transaction ()
void | dnf_context_set_keep_cache ()
void | dnf_context_set_enable_filelists ()
void | dnf_context_set_only_trusted ()
void | dnf_context_set_zchunk ()
void | dnf_context_set_write_history ()
void | dnf_context_set_cache_age ()
void | dnf_context_set_rpm_macro ()
void | dnf_context_set_http_proxy ()
void | dnf_context_set_user_agent ()
gboolean | dnf_context_setup ()
gboolean | dnf_context_setup_enrollments ()
gboolean | dnf_context_setup_sack ()
gboolean | dnf_context_setup_sack_with_flags ()
gboolean | dnf_context_commit ()
void | dnf_context_invalidate ()
void | dnf_context_invalidate_full ()
gboolean | dnf_context_clean_cache ()
gboolean | dnf_context_install ()
gboolean | dnf_context_remove ()
gboolean | dnf_context_update ()
gboolean | dnf_context_update_all ()
gboolean | dnf_context_repo_enable ()
gboolean | dnf_context_repo_disable ()
gboolean | dnf_context_run ()
void | dnf_context_disable_plugins ()
void | dnf_context_enable_plugins ()
gchar ** | dnf_context_get_disabled_plugins ()
gchar ** | dnf_context_get_enabled_plugins ()
gboolean | dnf_context_get_plugins_all_disabled ()
void | dnf_context_set_plugins_all_disabled ()
const char * | dnf_context_get_plugins_dir ()
void | dnf_context_set_plugins_dir ()
bool | dnf_context_plugin_hook ()
gchar * | dnf_context_get_module_report ()
gboolean | dnf_context_reset_modules ()
gboolean | dnf_context_reset_all_modules ()
gboolean | dnf_context_module_enable ()
gboolean | dnf_context_module_disable ()
gboolean | dnf_context_module_reset ()
gboolean | dnf_context_module_switched_check ()

## Types and Values

#define | DNF_TYPE_CONTEXT
struct | DnfContextClass
enum | DnfContextCleanFlags
enum | DnfContextInvalidateFlags
enum | DnfContextSetupSackFlags
| DnfContext

## Description

## Functions

### dnf_context_globals_init ()

    gboolean
    dnf_context_globals_init (GError **error);

### dnf_context_new ()

    DnfContext *
    dnf_context_new (void);

### find_base_arch ()

    const gchar *
    find_base_arch (const char *native);

### dnf_context_get_config_file_path ()

    const gchar *
    dnf_context_get_config_file_path (void);

### dnf_context_is_set_config_file_path ()

    gboolean
    dnf_context_is_set_config_file_path (void);

### dnf_context_get_repos_dir ()

    const gchar * const *
    dnf_context_get_repos_dir (DnfContext *context);

### dnf_context_get_repo_dir ()

    const gchar *
    dnf_context_get_repo_dir (DnfContext *context);

### dnf_context_get_vars_dir ()

    const gchar * const *
    dnf_context_get_vars_dir (DnfContext *context);

### dnf_context_get_base_arch ()

    const gchar *
    dnf_context_get_base_arch (DnfContext *context);

### dnf_context_get_os_info ()

    const gchar *
    dnf_context_get_os_info (DnfContext *context);

### dnf_context_get_arch_info ()

    const gchar *
    dnf_context_get_arch_info (DnfContext *context);

### dnf_context_get_release_ver ()

    const gchar *
    dnf_context_get_release_ver (DnfContext *context);

### dnf_context_get_platform_module ()

    const gchar *
    dnf_context_get_platform_module (DnfContext *context);

### dnf_context_get_cache_dir ()

    const gchar *
    dnf_context_get_cache_dir (DnfContext *context);

### dnf_context_get_arch ()

    const gchar *
    dnf_context_get_arch (DnfContext *context);

### dnf_context_get_solv_dir ()

    const gchar *
    dnf_context_get_solv_dir (DnfContext *context);

### dnf_context_get_lock_dir ()

    const gchar *
    dnf_context_get_lock_dir (DnfContext *context);

### dnf_context_get_rpm_verbosity ()

    const gchar *
    dnf_context_get_rpm_verbosity (DnfContext *context);

### dnf_context_get_install_root ()

    const gchar *
    dnf_context_get_install_root (DnfContext *context);

### dnf_context_get_source_root ()

    const gchar *
    dnf_context_get_source_root (DnfContext *context);

### dnf_context_get_native_arches ()

    const gchar **
    dnf_context_get_native_arches (DnfContext *context);

### dnf_context_get_installonly_pkgs ()

    const gchar **
    dnf_context_get_installonly_pkgs (DnfContext *context);

### dnf_context_get_best ()

    gboolean
    dnf_context_get_best (void);

### dnf_context_get_install_weak_deps ()

    gboolean
    dnf_context_get_install_weak_deps (void);

### dnf_context_get_allow_vendor_change ()

    gboolean
    dnf_context_get_allow_vendor_change (void);

### dnf_context_get_cache_only ()

    gboolean
    dnf_context_get_cache_only (DnfContext *context);

### dnf_context_get_check_disk_space ()

    gboolean
    dnf_context_get_check_disk_space (DnfContext *context);

### dnf_context_get_check_transaction ()

    gboolean
    dnf_context_get_check_transaction (DnfContext *context);

### dnf_context_get_keep_cache ()

    gboolean
    dnf_context_get_keep_cache (DnfContext *context);

### dnf_context_get_only_trusted ()

    gboolean
    dnf_context_get_only_trusted (DnfContext *context);

### dnf_context_get_zchunk ()

    gboolean
    dnf_context_get_zchunk (DnfContext *context);

### dnf_context_get_write_history ()

    gboolean
    dnf_context_get_write_history (DnfContext *context);

### dnf_context_get_cache_age ()

    guint
    dnf_context_get_cache_age (DnfContext *context);

### dnf_context_get_installonly_limit ()

    guint
    dnf_context_get_installonly_limit (DnfContext *context);

### dnf_context_get_http_proxy ()

    const gchar *
    dnf_context_get_http_proxy (DnfContext *context);

### dnf_context_get_enable_filelists ()

    gboolean
    dnf_context_get_enable_filelists (DnfContext *context);

### dnf_context_get_repos ()

    GPtrArray *
    dnf_context_get_repos (DnfContext *context);

### dnf_context_get_repo_loader ()

    DnfRepoLoader *
    dnf_context_get_repo_loader (DnfContext *context);

### dnf_context_get_transaction ()

    DnfTransaction *
    dnf_context_get_transaction (DnfContext *context);

### dnf_context_get_sack ()

    DnfSack *
    dnf_context_get_sack (DnfContext *context);

### dnf_context_get_goal ()

    HyGoal
    dnf_context_get_goal (DnfContext *context);

### dnf_context_get_state ()

    DnfState *
    dnf_context_get_state (DnfContext *context);

### dnf_context_get_user_agent ()

    const char *
    dnf_context_get_user_agent (DnfContext *context);

### dnf_context_set_config_file_path ()

    void
    dnf_context_set_config_file_path (const gchar *config_file_path);

### dnf_context_set_repos_dir ()

    void
    dnf_context_set_repos_dir (DnfContext *context,
                               const gchar * const *repos_dir);

### dnf_context_set_repo_dir ()

    void
    dnf_context_set_repo_dir (DnfContext *context,
                              const gchar *repo_dir);

### dnf_context_set_vars_dir ()

    void
    dnf_context_set_vars_dir (DnfContext *context,
                              const gchar * const *vars_dir);

### dnf_context_set_release_ver ()

    void
    dnf_context_set_release_ver (DnfContext *context,
                                 const gchar *release_ver);

### dnf_context_set_platform_module ()

    void
    dnf_context_set_platform_module (DnfContext *context,
                                     const gchar *platform_module);

### dnf_context_set_cache_dir ()

    void
    dnf_context_set_cache_dir (DnfContext *context,
                               const gchar *cache_dir);

### dnf_context_set_arch ()

    void
    dnf_context_set_arch (DnfContext *context,
                          const gchar *base_arch);

### dnf_context_set_solv_dir ()

    void
    dnf_context_set_solv_dir (DnfContext *context,
                              const gchar *solv_dir);

### dnf_context_set_vendor_cache_dir ()

    void
    dnf_context_set_vendor_cache_dir (DnfContext *context,
                                      const gchar *vendor_cache_dir);

### dnf_context_set_vendor_solv_dir ()

    void
    dnf_context_set_vendor_solv_dir (DnfContext *context,
                                     const gchar *vendor_solv_dir);

### dnf_context_set_lock_dir ()

    void
    dnf_context_set_lock_dir (DnfContext *context,
                              const gchar *lock_dir);

### dnf_context_set_rpm_verbosity ()

    void
    dnf_context_set_rpm_verbosity (DnfContext *context,
                                   const gchar *rpm_verbosity);

### dnf_context_set_install_root ()

    void
    dnf_context_set_install_root (DnfContext *context,
                                  const gchar *install_root);

### dnf_context_set_source_root ()

    void
    dnf_context_set_source_root (DnfContext *context,
                                 const gchar *source_root);

### dnf_context_set_best ()

    void
    dnf_context_set_best (gboolean best);

### dnf_context_set_install_weak_deps ()

    void
    dnf_context_set_install_weak_deps (gboolean enabled);

### dnf_context_set_allow_vendor_change ()

    void
    dnf_context_set_allow_vendor_change (gboolean vendorchange);

### dnf_context_set_cache_only ()

    void
    dnf_context_set_cache_only (DnfContext *context,
                                gboolean cache_only);

### dnf_context_set_check_disk_space ()

    void
    dnf_context_set_check_disk_space (DnfContext *context,
                                      gboolean check_disk_space);

### dnf_context_set_check_transaction ()

    void
    dnf_context_set_check_transaction (DnfContext *context,
                                       gboolean check_transaction);

### dnf_context_set_keep_cache ()

    void
    dnf_context_set_keep_cache (DnfContext *context,
                                gboolean keep_cache);

### dnf_context_set_enable_filelists ()

    void
    dnf_context_set_enable_filelists (DnfContext *context,
                                      gboolean enable_filelists);

### dnf_context_set_only_trusted ()

    void
    dnf_context_set_only_trusted (DnfContext *context,
                                  gboolean only_trusted);

### dnf_context_set_zchunk ()

    void
    dnf_context_set_zchunk (DnfContext *context,
                            gboolean only_trusted);

### dnf_context_set_write_history ()

    void
    dnf_context_set_write_history (DnfContext *context,
                                   gboolean value);

### dnf_context_set_cache_age ()

    void
    dnf_context_set_cache_age (DnfContext *context,
                               guint cache_age);

### dnf_context_set_rpm_macro ()

    void
    dnf_context_set_rpm_macro (DnfContext *context,
                               const gchar *key,
                               const gchar *value);

### dnf_context_set_http_proxy ()

    void
    dnf_context_set_http_proxy (DnfContext *context,
                                const gchar *proxyurl);

### dnf_context_set_user_agent ()

    void
    dnf_context_set_user_agent (DnfContext *context,
                                const gchar *user_agent);

### dnf_context_setup ()

    gboolean
    dnf_context_setup (DnfContext *context,
                       GCancellable *cancellable,
                       GError **error);

### dnf_context_setup_enrollments ()

    gboolean
    dnf_context_setup_enrollments (DnfContext *context,
                                   GError **error);

### dnf_context_setup_sack ()

    gboolean
    dnf_context_setup_sack (DnfContext *context,
                            DnfState *state,
                            GError **error);

### dnf_context_setup_sack_with_flags ()

    gboolean
    dnf_context_setup_sack_with_flags (DnfContext *context,
                                       DnfState *state,
                                       DnfContextSetupSackFlags flags,
                                       GError **error);

### dnf_context_commit ()

    gboolean
    dnf_context_commit (DnfContext *context,
                        DnfState *state,
                        GError **error);

### dnf_context_invalidate ()

    void
    dnf_context_invalidate (DnfContext *context,
                            const gchar *message);

### dnf_context_invalidate_full ()

    void
    dnf_context_invalidate_full (DnfContext *context,
                                 const gchar *message,
                                 DnfContextInvalidateFlags flags);

### dnf_context_clean_cache ()

    gboolean
    dnf_context_clean_cache (DnfContext *context,
                             DnfContextCleanFlags flags,
                             GError **error);

### dnf_context_install ()

    gboolean
    dnf_context_install (DnfContext *context,
                         const gchar *name,
                         GError **error);

### dnf_context_remove ()

    gboolean
    dnf_context_remove (DnfContext *context,
                        const gchar *name,
                        GError **error);

### dnf_context_update ()

    gboolean
    dnf_context_update (DnfContext *context,
                        const gchar *name,
                        GError **error);

### dnf_context_update_all ()

    gboolean
    dnf_context_update_all (DnfContext *context,
                            GError **error);

### dnf_context_repo_enable ()

    gboolean
    dnf_context_repo_enable (DnfContext *context,
                             const gchar *repo_id,
                             GError **error);

### dnf_context_repo_disable ()

    gboolean
    dnf_context_repo_disable (DnfContext *context,
                              const gchar *repo_id,
                              GError **error);

### dnf_context_run ()

    gboolean
    dnf_context_run (DnfContext *context,
                     GCancellable *cancellable,
                     GError **error);

### dnf_context_disable_plugins ()

    void
    dnf_context_disable_plugins (const gchar *plugin_name_pattern);

### dnf_context_enable_plugins ()

    void
    dnf_context_enable_plugins (const gchar *plugin_name_pattern);

### dnf_context_get_disabled_plugins ()

    gchar **
    dnf_context_get_disabled_plugins (void);

### dnf_context_get_enabled_plugins ()

    gchar **
    dnf_context_get_enabled_plugins (void);

### dnf_context_get_plugins_all_disabled ()

    gboolean
    dnf_context_get_plugins_all_disabled (void);

### dnf_context_set_plugins_all_disabled ()

    void
    dnf_context_set_plugins_all_disabled (gboolean disabled);

### dnf_context_get_plugins_dir ()

    const char *
    dnf_context_get_plugins_dir (DnfContext *context);

### dnf_context_set_plugins_dir ()

    void
    dnf_context_set_plugins_dir (DnfContext *context,
                                 const char *plugins_dir);

### dnf_context_plugin_hook ()

    bool
    dnf_context_plugin_hook (DnfContext *context,
                             PluginHookId id,
                             DnfPluginHookData *hookData,
                             DnfPluginError *error);

### dnf_context_get_module_report ()

    gchar *
    dnf_context_get_module_report (DnfContext *context);

### dnf_context_reset_modules ()

    gboolean
    dnf_context_reset_modules (DnfContext *context,
                               DnfSack *sack,
                               const char **module_names,
                               GError **error);

### dnf_context_reset_all_modules ()

    gboolean
    dnf_context_reset_all_modules (DnfContext *context,
                                   DnfSack *sack,
                                   GError **error);

### dnf_context_module_enable ()

    gboolean
    dnf_context_module_enable (DnfContext *context,
                               const char **module_specs,
                               GError **error);

Enable mudules, recalculate module filtration, but do not commit modular changes. To commit modular changes it requires to call `dnf_context_run()` Returns FALSE when an error is set.

#### Parameters

context | DnfContext |
module_specs | Module specs that should be enabled |
error | Error |

Since: 0.55.0

### dnf_context_module_disable ()

    gboolean
    dnf_context_module_disable (DnfContext *context,
                                const char **module_specs,
                                GError **error);

Disable mudules, recalculate module filtration, but do not commit modular changes. To commit modular changes it requires to call `dnf_context_run()` Returns FALSE when an error is set.

#### Parameters

context | DnfContext |
module_specs | Module specs that should be enabled |
error | Error |

Since: 0.55.0

### dnf_context_module_reset ()

    gboolean
    dnf_context_module_reset (DnfContext *context,
                              const char **module_specs,
                              GError **error);

Reset modules, recalculate module filtration, but do not commit modular changes. To commit modular changes it requires to call `dnf_context_run()` Returns FALSE when an error is set.

#### Parameters

context | DnfContext |
module_specs | Module specs that should be enabled |
error | Error |

Since: 0.55.0

### dnf_context_module_switched_check ()

    gboolean
    dnf_context_module_switched_check (DnfContext *context,
                                       GError **error);

Ceck if any module is switched and return FALSE and sets an error Returns FALSE when an error is set.

#### Parameters

context | DnfContext |
error | Error |

Since: 0.55.0

## Types and Values

### DNF_TYPE_CONTEXT

    #define DNF_TYPE_CONTEXT (dnf_context_get_type ())

### struct DnfContextClass

    struct DnfContextClass {
            GObjectClass            parent_class;
            void                    (*invalidate)           (DnfContext     *context,
                                                             const gchar    *message);
    };

### enum DnfContextCleanFlags

The clean flags for cache directories cleaning.

#### Members

DNF_CONTEXT_CLEAN_EXPIRE_CACHE | Clean the indicator file for cache directories' age |
DNF_CONTEXT_CLEAN_PACKAGES | Clean the packages section for cache |
DNF_CONTEXT_CLEAN_METADATA | Clean the metadata section for cache directories |
DNF_CONTEXT_CLEAN_ALL | Clean out all of the cache directories |

### enum DnfContextInvalidateFlags

The update flags.

#### Members

DNF_CONTEXT_INVALIDATE_FLAG_NONE | No caches are invalid |
DNF_CONTEXT_INVALIDATE_FLAG_RPMDB | The rpmdb cache is invalid |
DNF_CONTEXT_INVALIDATE_FLAG_ENROLLMENT | Any enrollment may be invalid |

### enum DnfContextSetupSackFlags

The sack setup flags.

#### Members

DNF_CONTEXT_SETUP_SACK_FLAG_NONE | No special behaviours |
DNF_CONTEXT_SETUP_SACK_FLAG_SKIP_RPMDB | Don't load system's rpmdb |
DNF_CONTEXT_SETUP_SACK_FLAG_SKIP_FILELISTS | Don't load filelists |
DNF_CONTEXT_SETUP_SACK_FLAG_LOAD_UPDATEINFO | Load updateinfo if available |

Since: 0.13.0

### DnfContext

    typedef struct _DnfContext DnfContext;