libalpm
Arch Linux Package Manager Library

Libalpm option getters and setters More...

Collaboration diagram for Options:

Accessors for callbacks

alpm_cb_log alpm_option_get_logcb (alpm_handle_t *handle)
 Returns the callback used for logging.
 
void * alpm_option_get_logcb_ctx (alpm_handle_t *handle)
 Returns the callback used for logging.
 
int alpm_option_set_logcb (alpm_handle_t *handle, alpm_cb_log cb, void *ctx)
 Sets the callback used for logging.
 
alpm_cb_download alpm_option_get_dlcb (alpm_handle_t *handle)
 Returns the callback used to report download progress.
 
void * alpm_option_get_dlcb_ctx (alpm_handle_t *handle)
 Returns the callback used to report download progress.
 
int alpm_option_set_dlcb (alpm_handle_t *handle, alpm_cb_download cb, void *ctx)
 Sets the callback used to report download progress.
 
alpm_cb_fetch alpm_option_get_fetchcb (alpm_handle_t *handle)
 Returns the downloading callback.
 
void * alpm_option_get_fetchcb_ctx (alpm_handle_t *handle)
 Returns the downloading callback.
 
int alpm_option_set_fetchcb (alpm_handle_t *handle, alpm_cb_fetch cb, void *ctx)
 Sets the downloading callback.
 
alpm_cb_event alpm_option_get_eventcb (alpm_handle_t *handle)
 Returns the callback used for events.
 
void * alpm_option_get_eventcb_ctx (alpm_handle_t *handle)
 Returns the callback used for events.
 
int alpm_option_set_eventcb (alpm_handle_t *handle, alpm_cb_event cb, void *ctx)
 Sets the callback used for events.
 
alpm_cb_question alpm_option_get_questioncb (alpm_handle_t *handle)
 Returns the callback used for questions.
 
void * alpm_option_get_questioncb_ctx (alpm_handle_t *handle)
 Returns the callback used for questions.
 
int alpm_option_set_questioncb (alpm_handle_t *handle, alpm_cb_question cb, void *ctx)
 Sets the callback used for questions.
 
alpm_cb_progress alpm_option_get_progresscb (alpm_handle_t *handle)
 Returns the callback used for operation progress.
 
void * alpm_option_get_progresscb_ctx (alpm_handle_t *handle)
 Returns the callback used for operation progress.
 
int alpm_option_set_progresscb (alpm_handle_t *handle, alpm_cb_progress cb, void *ctx)
 Sets the callback used for operation progress.
 

Accessors to the root directory

The root directory is the prefix to which libalpm installs packages to.

Hooks and scriptlets will also be run in a chroot to ensure they behave correctly in alternative roots.

const char * alpm_option_get_root (alpm_handle_t *handle)
 Returns the root path.
 

Accessors to the database path

The dbpath is where libalpm stores the local db and downloads sync databases.

const char * alpm_option_get_dbpath (alpm_handle_t *handle)
 Returns the path to the database directory.
 

Accessors to the lockfile

The lockfile is used to ensure two instances of libalpm can not write to the database at the same time.

The lock file is created when committing a transaction and released when the transaction completes. Or when calling alpm_unlock.

const char * alpm_option_get_lockfile (alpm_handle_t *handle)
 Get the name of the database lock file.
 

Accessors to the list of package cache directories.

This is where libalpm will store downloaded packages.

alpm_list_talpm_option_get_cachedirs (alpm_handle_t *handle)
 Gets the currently configured cachedirs,.
 
int alpm_option_set_cachedirs (alpm_handle_t *handle, alpm_list_t *cachedirs)
 Sets the cachedirs.
 
int alpm_option_add_cachedir (alpm_handle_t *handle, const char *cachedir)
 Append a cachedir to the configured cachedirs.
 
int alpm_option_remove_cachedir (alpm_handle_t *handle, const char *cachedir)
 Remove a cachedir from the configured cachedirs.
 

Accessors to the list of package hook directories.

libalpm will search these directories for hooks to run.

A hook in a later directory will override previous hooks if they have the same name.

alpm_list_talpm_option_get_hookdirs (alpm_handle_t *handle)
 Gets the currently configured hookdirs,.
 
int alpm_option_set_hookdirs (alpm_handle_t *handle, alpm_list_t *hookdirs)
 Sets the hookdirs.
 
int alpm_option_add_hookdir (alpm_handle_t *handle, const char *hookdir)
 Append a hookdir to the configured hookdirs.
 
int alpm_option_remove_hookdir (alpm_handle_t *handle, const char *hookdir)
 Remove a hookdir from the configured hookdirs.
 

Accessors to the list of overwritable files.

Normally libalpm will refuse to install a package that owns files that are already on disk and not owned by that package.

If a conflicting file matches a glob in the overwrite_files list, then no conflict will be raised and libalpm will simply overwrite the file.

alpm_list_talpm_option_get_overwrite_files (alpm_handle_t *handle)
 Gets the currently configured overwritable files,.
 
int alpm_option_set_overwrite_files (alpm_handle_t *handle, alpm_list_t *globs)
 Sets the overwritable files.
 
int alpm_option_add_overwrite_file (alpm_handle_t *handle, const char *glob)
 Append an overwritable file to the configured overwritable files.
 
int alpm_option_remove_overwrite_file (alpm_handle_t *handle, const char *glob)
 Remove a file glob from the configured overwritable files globs.
 

Accessors to the log file

This controls where libalpm will save log output to.

const char * alpm_option_get_logfile (alpm_handle_t *handle)
 Gets the filepath to the currently set logfile.
 
int alpm_option_set_logfile (alpm_handle_t *handle, const char *logfile)
 Sets the logfile path.
 

Accessors to the GPG directory

This controls where libalpm will store GnuPG's files.

const char * alpm_option_get_gpgdir (alpm_handle_t *handle)
 Returns the path to libalpm's GnuPG home directory.
 
int alpm_option_set_gpgdir (alpm_handle_t *handle, const char *gpgdir)
 Sets the path to libalpm's GnuPG home directory.
 

Accessors for use sandboxuser

This controls the user that libalpm will use for sensitive operations like downloading files.

const char * alpm_option_get_sandboxuser (alpm_handle_t *handle)
 Returns the user to switch to for sensitive operations.
 
int alpm_option_set_sandboxuser (alpm_handle_t *handle, const char *sandboxuser)
 Sets the user to switch to for sensitive operations.
 

Accessors for use syslog

This controls whether libalpm will also use the syslog.

Even if this option is enabled, libalpm will still try to log to its log file.

int alpm_option_get_usesyslog (alpm_handle_t *handle)
 Returns whether to use syslog (0 is FALSE, TRUE otherwise).
 
int alpm_option_set_usesyslog (alpm_handle_t *handle, int usesyslog)
 Sets whether to use syslog (0 is FALSE, TRUE otherwise).
 

Accessors to the list of no-upgrade files.

These functions modify the list of files which should not be updated by package installation.

alpm_list_talpm_option_get_noupgrades (alpm_handle_t *handle)
 Get the list of no-upgrade files.
 
int alpm_option_add_noupgrade (alpm_handle_t *handle, const char *path)
 Add a file to the no-upgrade list.
 
int alpm_option_set_noupgrades (alpm_handle_t *handle, alpm_list_t *noupgrade)
 Sets the list of no-upgrade files.
 
int alpm_option_remove_noupgrade (alpm_handle_t *handle, const char *path)
 Remove an entry from the no-upgrade list.
 
int alpm_option_match_noupgrade (alpm_handle_t *handle, const char *path)
 Test if a path matches any of the globs in the no-upgrade list.
 

Accessors to the list of no-extract files.

These functions modify the list of filenames which should be skipped packages which should not be upgraded by a sysupgrade operation.

alpm_list_talpm_option_get_noextracts (alpm_handle_t *handle)
 Get the list of no-extract files.
 
int alpm_option_add_noextract (alpm_handle_t *handle, const char *path)
 Add a file to the no-extract list.
 
int alpm_option_set_noextracts (alpm_handle_t *handle, alpm_list_t *noextract)
 Sets the list of no-extract files.
 
int alpm_option_remove_noextract (alpm_handle_t *handle, const char *path)
 Remove an entry from the no-extract list.
 
int alpm_option_match_noextract (alpm_handle_t *handle, const char *path)
 Test if a path matches any of the globs in the no-extract list.
 

Accessors to the list of ignored packages.

These functions modify the list of packages that should be ignored by a sysupgrade.

Entries in this list may be globs and only match the package's name. Providers are not taken into account.

alpm_list_talpm_option_get_ignorepkgs (alpm_handle_t *handle)
 Get the list of ignored packages.
 
int alpm_option_add_ignorepkg (alpm_handle_t *handle, const char *pkg)
 Add a file to the ignored package list.
 
int alpm_option_set_ignorepkgs (alpm_handle_t *handle, alpm_list_t *ignorepkgs)
 Sets the list of packages to ignore.
 
int alpm_option_remove_ignorepkg (alpm_handle_t *handle, const char *pkg)
 Remove an entry from the ignorepkg list.
 

Accessors to the list of ignored groups.

These functions modify the list of groups whose packages should be ignored by a sysupgrade.

Entries in this list may be globs.

alpm_list_talpm_option_get_ignoregroups (alpm_handle_t *handle)
 Get the list of ignored groups.
 
int alpm_option_add_ignoregroup (alpm_handle_t *handle, const char *grp)
 Add a file to the ignored group list.
 
int alpm_option_set_ignoregroups (alpm_handle_t *handle, alpm_list_t *ignoregrps)
 Sets the list of groups to ignore.
 
int alpm_option_remove_ignoregroup (alpm_handle_t *handle, const char *grp)
 Remove an entry from the ignoregroup list.
 

Accessors to the list of ignored dependencies.

These functions modify the list of dependencies that should be ignored by a sysupgrade.

This is effectively a list of virtual providers that packages can use to satisfy their dependencies.

alpm_list_talpm_option_get_assumeinstalled (alpm_handle_t *handle)
 Gets the list of dependencies that are assumed to be met.
 
int alpm_option_add_assumeinstalled (alpm_handle_t *handle, const alpm_depend_t *dep)
 Add a depend to the assumed installed list.
 
int alpm_option_set_assumeinstalled (alpm_handle_t *handle, alpm_list_t *deps)
 Sets the list of dependencies that are assumed to be met.
 
int alpm_option_remove_assumeinstalled (alpm_handle_t *handle, const alpm_depend_t *dep)
 Remove an entry from the assume installed list.
 

Accessors to the list of allowed architectures.

libalpm will only install packages that match one of the configured architectures.

The architectures do not need to match the physical architecture. They can just be treated as a label.

alpm_list_talpm_option_get_architectures (alpm_handle_t *handle)
 Returns the allowed package architecture.
 
int alpm_option_add_architecture (alpm_handle_t *handle, const char *arch)
 Adds an allowed package architecture.
 
int alpm_option_set_architectures (alpm_handle_t *handle, alpm_list_t *arches)
 Sets the allowed package architecture.
 
int alpm_option_remove_architecture (alpm_handle_t *handle, const char *arch)
 Removes an allowed package architecture.
 

Accessors for check space.

This controls whether libalpm will check if there is sufficient before installing packages.

int alpm_option_get_checkspace (alpm_handle_t *handle)
 Get whether or not checking for free space before installing packages is enabled.
 
int alpm_option_set_checkspace (alpm_handle_t *handle, int checkspace)
 Enable/disable checking free space before installing packages.
 

Accessors for the database extension

This controls the extension used for sync databases.

libalpm will use this extension to both lookup remote databses and as the name used when opening reading them.

This is useful for file databases. Seems as files can increase the size of a database by quite a lot, a server could hold a database without files under one extension, and another with files under another extension.

Which one is downloaded and used then depends on this setting.

const char * alpm_option_get_dbext (alpm_handle_t *handle)
 Gets the configured database extension.
 
int alpm_option_set_dbext (alpm_handle_t *handle, const char *dbext)
 Sets the database extension.
 

Accessors for the signature levels

int alpm_option_get_default_siglevel (alpm_handle_t *handle)
 Get the default siglevel.
 
int alpm_option_set_default_siglevel (alpm_handle_t *handle, int level)
 Set the default siglevel.
 
int alpm_option_get_local_file_siglevel (alpm_handle_t *handle)
 Get the configured local file siglevel.
 
int alpm_option_set_local_file_siglevel (alpm_handle_t *handle, int level)
 Set the local file siglevel.
 
int alpm_option_get_remote_file_siglevel (alpm_handle_t *handle)
 Get the configured remote file siglevel.
 
int alpm_option_set_remote_file_siglevel (alpm_handle_t *handle, int level)
 Set the remote file siglevel.
 

Accessors for download timeout

By default, libalpm will timeout if a download has been transferring less than 1 byte for 10 seconds.

int alpm_option_set_disable_dl_timeout (alpm_handle_t *handle, unsigned short disable_dl_timeout)
 Enables/disables the download timeout.
 

Accessors for parallel downloads

alpm_db_update, alpm_fetch_pkgurl and alpm_trans_commit can all download packages in parallel.

This setting configures how many packages can be downloaded in parallel,

By default this value is set to 1, meaning packages are downloading sequentially.

int alpm_option_get_parallel_downloads (alpm_handle_t *handle)
 Gets the number of parallel streams to download database and package files.
 
int alpm_option_set_parallel_downloads (alpm_handle_t *handle, unsigned int num_streams)
 Sets number of parallel streams to download database and package files.
 

Accessors for sandbox

By default, libalpm will sandbox the downloader process.

int alpm_option_set_disable_sandbox (alpm_handle_t *handle, unsigned short disable_sandbox)
 Enables/disables the sandbox.
 

Detailed Description

Libalpm option getters and setters

Function Documentation

◆ alpm_option_add_architecture()

int alpm_option_add_architecture ( alpm_handle_t * handle,
const char * arch )

Adds an allowed package architecture.

Parameters
handlethe context handle
archthe architecture to set

References alpm_list_add().

◆ alpm_option_add_assumeinstalled()

int alpm_option_add_assumeinstalled ( alpm_handle_t * handle,
const alpm_depend_t * dep )

Add a depend to the assumed installed list.

Parameters
handlethe context handle
depthe dependency to add
Returns
0 on success, -1 on error (pm_errno is set accordingly)

References ALPM_DEP_MOD_ANY, ALPM_DEP_MOD_EQ, ALPM_ERR_MEMORY, ALPM_ERR_WRONG_ARGS, alpm_list_add(), ASSERT, CHECK_HANDLE, alpm_depend_t::mod, alpm_depend_t::name, alpm_depend_t::name_hash, and RET_ERR.

Referenced by alpm_option_set_assumeinstalled().

◆ alpm_option_add_cachedir()

int alpm_option_add_cachedir ( alpm_handle_t * handle,
const char * cachedir )

Append a cachedir to the configured cachedirs.

Parameters
handlethe context handle
cachedirthe cachedir to add
Returns
0 on success, -1 on error (pm_errno is set accordingly)

References ALPM_ERR_MEMORY, ALPM_ERR_WRONG_ARGS, alpm_list_add(), ALPM_LOG_DEBUG, ASSERT, canonicalize_path(), CHECK_HANDLE, and RET_ERR.

Referenced by alpm_option_set_cachedirs().

◆ alpm_option_add_hookdir()

int alpm_option_add_hookdir ( alpm_handle_t * handle,
const char * hookdir )

Append a hookdir to the configured hookdirs.

Parameters
handlethe context handle
hookdirthe hookdir to add
Returns
0 on success, -1 on error (pm_errno is set accordingly)

References ALPM_ERR_MEMORY, ALPM_ERR_WRONG_ARGS, alpm_list_add(), ALPM_LOG_DEBUG, ASSERT, canonicalize_path(), CHECK_HANDLE, and RET_ERR.

Referenced by alpm_option_set_hookdirs().

◆ alpm_option_add_ignoregroup()

int alpm_option_add_ignoregroup ( alpm_handle_t * handle,
const char * grp )

Add a file to the ignored group list.

Parameters
handlethe context handle
grpthe group to add
Returns
0 on success, -1 on error (pm_errno is set accordingly)

◆ alpm_option_add_ignorepkg()

int alpm_option_add_ignorepkg ( alpm_handle_t * handle,
const char * pkg )

Add a file to the ignored package list.

Parameters
handlethe context handle
pkgthe package to add
Returns
0 on success, -1 on error (pm_errno is set accordingly)

◆ alpm_option_add_noextract()

int alpm_option_add_noextract ( alpm_handle_t * handle,
const char * path )

Add a file to the no-extract list.

Parameters
handlethe context handle
paththe path to add
Returns
0 on success, -1 on error (pm_errno is set accordingly)

◆ alpm_option_add_noupgrade()

int alpm_option_add_noupgrade ( alpm_handle_t * handle,
const char * path )

Add a file to the no-upgrade list.

Parameters
handlethe context handle
paththe path to add
Returns
0 on success, -1 on error (pm_errno is set accordingly)

◆ alpm_option_add_overwrite_file()

int alpm_option_add_overwrite_file ( alpm_handle_t * handle,
const char * glob )

Append an overwritable file to the configured overwritable files.

Parameters
handlethe context handle
globthe file glob to add
Returns
0 on success, -1 on error (pm_errno is set accordingly)

◆ alpm_option_get_architectures()

alpm_list_t * alpm_option_get_architectures ( alpm_handle_t * handle)

Returns the allowed package architecture.

Parameters
handlethe context handle
Returns
the configured package architectures

References CHECK_HANDLE.

◆ alpm_option_get_assumeinstalled()

alpm_list_t * alpm_option_get_assumeinstalled ( alpm_handle_t * handle)

Gets the list of dependencies that are assumed to be met.

Parameters
handlethe context handle
Returns
a list of alpm_depend_t*

References CHECK_HANDLE.

◆ alpm_option_get_cachedirs()

alpm_list_t * alpm_option_get_cachedirs ( alpm_handle_t * handle)

Gets the currently configured cachedirs,.

Parameters
handlethe context handle
Returns
a char* list of cache directories

References CHECK_HANDLE.

◆ alpm_option_get_checkspace()

int alpm_option_get_checkspace ( alpm_handle_t * handle)

Get whether or not checking for free space before installing packages is enabled.

Parameters
handlethe context handle
Returns
0 if disabled, 1 if enabled

References CHECK_HANDLE.

◆ alpm_option_get_dbext()

const char * alpm_option_get_dbext ( alpm_handle_t * handle)

Gets the configured database extension.

Parameters
handlethe context handle
Returns
the configured database extension

References CHECK_HANDLE.

Referenced by curl_check_finished_download().

◆ alpm_option_get_dbpath()

const char * alpm_option_get_dbpath ( alpm_handle_t * handle)

Returns the path to the database directory.

Read-only.

Parameters
handlethe context handle

References CHECK_HANDLE.

◆ alpm_option_get_default_siglevel()

int alpm_option_get_default_siglevel ( alpm_handle_t * handle)

Get the default siglevel.

Parameters
handlethe context handle
Returns
a alpm_siglevel_t bitfield of the siglevel

References CHECK_HANDLE.

◆ alpm_option_get_dlcb()

alpm_cb_download alpm_option_get_dlcb ( alpm_handle_t * handle)

Returns the callback used to report download progress.

Parameters
handlethe context handle
Returns
the currently set download callback

References CHECK_HANDLE.

◆ alpm_option_get_dlcb_ctx()

void * alpm_option_get_dlcb_ctx ( alpm_handle_t * handle)

Returns the callback used to report download progress.

Parameters
handlethe context handle
Returns
the currently set download callback context

References CHECK_HANDLE.

◆ alpm_option_get_eventcb()

alpm_cb_event alpm_option_get_eventcb ( alpm_handle_t * handle)

Returns the callback used for events.

Parameters
handlethe context handle
Returns
the currently set event callback

References CHECK_HANDLE.

◆ alpm_option_get_eventcb_ctx()

void * alpm_option_get_eventcb_ctx ( alpm_handle_t * handle)

Returns the callback used for events.

Parameters
handlethe context handle
Returns
the currently set event callback context

References CHECK_HANDLE.

◆ alpm_option_get_fetchcb()

alpm_cb_fetch alpm_option_get_fetchcb ( alpm_handle_t * handle)

Returns the downloading callback.

Parameters
handlethe context handle
Returns
the currently set fetch callback

References CHECK_HANDLE.

◆ alpm_option_get_fetchcb_ctx()

void * alpm_option_get_fetchcb_ctx ( alpm_handle_t * handle)

Returns the downloading callback.

Parameters
handlethe context handle
Returns
the currently set fetch callback context

References CHECK_HANDLE.

◆ alpm_option_get_gpgdir()

const char * alpm_option_get_gpgdir ( alpm_handle_t * handle)

Returns the path to libalpm's GnuPG home directory.

Parameters
handlethe context handle
Returns
the path to libalpms's GnuPG home directory

References CHECK_HANDLE.

◆ alpm_option_get_hookdirs()

alpm_list_t * alpm_option_get_hookdirs ( alpm_handle_t * handle)

Gets the currently configured hookdirs,.

Parameters
handlethe context handle
Returns
a char* list of hook directories

References CHECK_HANDLE.

◆ alpm_option_get_ignoregroups()

alpm_list_t * alpm_option_get_ignoregroups ( alpm_handle_t * handle)

Get the list of ignored groups.

Parameters
handlethe context handle
Returns
the char* list of ignored groups

References CHECK_HANDLE.

◆ alpm_option_get_ignorepkgs()

alpm_list_t * alpm_option_get_ignorepkgs ( alpm_handle_t * handle)

Get the list of ignored packages.

Parameters
handlethe context handle
Returns
the char* list of ignored packages

References CHECK_HANDLE.

◆ alpm_option_get_local_file_siglevel()

int alpm_option_get_local_file_siglevel ( alpm_handle_t * handle)

Get the configured local file siglevel.

Parameters
handlethe context handle
Returns
a alpm_siglevel_t bitfield of the siglevel

References ALPM_SIG_USE_DEFAULT, and CHECK_HANDLE.

◆ alpm_option_get_lockfile()

const char * alpm_option_get_lockfile ( alpm_handle_t * handle)

Get the name of the database lock file.

Read-only. This is the name that the lockfile would have. It does not matter if the lockfile actually exists on disk.

Parameters
handlethe context handle

References CHECK_HANDLE.

◆ alpm_option_get_logcb()

alpm_cb_log alpm_option_get_logcb ( alpm_handle_t * handle)

Returns the callback used for logging.

Parameters
handlethe context handle
Returns
the currently set log callback

References CHECK_HANDLE.

◆ alpm_option_get_logcb_ctx()

void * alpm_option_get_logcb_ctx ( alpm_handle_t * handle)

Returns the callback used for logging.

Parameters
handlethe context handle
Returns
the currently set log callback context

References CHECK_HANDLE.

◆ alpm_option_get_logfile()

const char * alpm_option_get_logfile ( alpm_handle_t * handle)

Gets the filepath to the currently set logfile.

Parameters
handlethe context handle
Returns
the path to the logfile

References CHECK_HANDLE.

◆ alpm_option_get_noextracts()

alpm_list_t * alpm_option_get_noextracts ( alpm_handle_t * handle)

Get the list of no-extract files.

Parameters
handlethe context handle
Returns
the char* list of no-extract files

References CHECK_HANDLE.

◆ alpm_option_get_noupgrades()

alpm_list_t * alpm_option_get_noupgrades ( alpm_handle_t * handle)

Get the list of no-upgrade files.

Parameters
handlethe context handle
Returns
the char* list of no-upgrade files

References CHECK_HANDLE.

◆ alpm_option_get_overwrite_files()

alpm_list_t * alpm_option_get_overwrite_files ( alpm_handle_t * handle)

Gets the currently configured overwritable files,.

Parameters
handlethe context handle
Returns
a char* list of overwritable file globs

References CHECK_HANDLE.

◆ alpm_option_get_parallel_downloads()

int alpm_option_get_parallel_downloads ( alpm_handle_t * handle)

Gets the number of parallel streams to download database and package files.

Parameters
handlethe context handle
Returns
the number of parallel streams to download database and package files

References CHECK_HANDLE.

◆ alpm_option_get_progresscb()

alpm_cb_progress alpm_option_get_progresscb ( alpm_handle_t * handle)

Returns the callback used for operation progress.

Parameters
handlethe context handle
Returns
the currently set progress callback

References CHECK_HANDLE.

◆ alpm_option_get_progresscb_ctx()

void * alpm_option_get_progresscb_ctx ( alpm_handle_t * handle)

Returns the callback used for operation progress.

Parameters
handlethe context handle
Returns
the currently set progress callback context

References CHECK_HANDLE.

◆ alpm_option_get_questioncb()

alpm_cb_question alpm_option_get_questioncb ( alpm_handle_t * handle)

Returns the callback used for questions.

Parameters
handlethe context handle
Returns
the currently set question callback

References CHECK_HANDLE.

◆ alpm_option_get_questioncb_ctx()

void * alpm_option_get_questioncb_ctx ( alpm_handle_t * handle)

Returns the callback used for questions.

Parameters
handlethe context handle
Returns
the currently set question callback context

References CHECK_HANDLE.

◆ alpm_option_get_remote_file_siglevel()

int alpm_option_get_remote_file_siglevel ( alpm_handle_t * handle)

Get the configured remote file siglevel.

Parameters
handlethe context handle
Returns
a alpm_siglevel_t bitfield of the siglevel

References ALPM_SIG_USE_DEFAULT, and CHECK_HANDLE.

◆ alpm_option_get_root()

const char * alpm_option_get_root ( alpm_handle_t * handle)

Returns the root path.

Read-only.

Parameters
handlethe context handle

References CHECK_HANDLE.

◆ alpm_option_get_sandboxuser()

const char * alpm_option_get_sandboxuser ( alpm_handle_t * handle)

Returns the user to switch to for sensitive operations.

Returns
the user name

References CHECK_HANDLE.

◆ alpm_option_get_usesyslog()

int alpm_option_get_usesyslog ( alpm_handle_t * handle)

Returns whether to use syslog (0 is FALSE, TRUE otherwise).

Parameters
handlethe context handle
Returns
0 on success, -1 on error (pm_errno is set accordingly)

References CHECK_HANDLE.

◆ alpm_option_match_noextract()

int alpm_option_match_noextract ( alpm_handle_t * handle,
const char * path )

Test if a path matches any of the globs in the no-extract list.

Parameters
handlethe context handle
paththe path to test
Returns
0 is the path matches a glob, negative if there is no match and positive is the match was inverted

Referenced by calculate_removed_size().

◆ alpm_option_match_noupgrade()

int alpm_option_match_noupgrade ( alpm_handle_t * handle,
const char * path )

Test if a path matches any of the globs in the no-upgrade list.

Parameters
handlethe context handle
paththe path to test
Returns
0 is the path matches a glob, negative if there is no match and positive is the match was inverted

◆ alpm_option_remove_architecture()

int alpm_option_remove_architecture ( alpm_handle_t * handle,
const char * arch )

Removes an allowed package architecture.

Parameters
handlethe context handle
archthe architecture to remove

References alpm_list_remove_str(), CHECK_HANDLE, and FREE.

◆ alpm_option_remove_assumeinstalled()

int alpm_option_remove_assumeinstalled ( alpm_handle_t * handle,
const alpm_depend_t * dep )

Remove an entry from the assume installed list.

Parameters
handlethe context handle
depthe dep to remove
Returns
0 on success, -1 on error (pm_errno is set accordingly)

References alpm_dep_free(), alpm_list_remove(), assumeinstalled_cmp(), and CHECK_HANDLE.

◆ alpm_option_remove_cachedir()

int alpm_option_remove_cachedir ( alpm_handle_t * handle,
const char * cachedir )

Remove a cachedir from the configured cachedirs.

Parameters
handlethe context handle
cachedirthe cachedir to remove
Returns
0 on success, -1 on error (pm_errno is set accordingly)

References ALPM_ERR_MEMORY, ALPM_ERR_WRONG_ARGS, alpm_list_remove_str(), ASSERT, canonicalize_path(), CHECK_HANDLE, FREE, and RET_ERR.

◆ alpm_option_remove_hookdir()

int alpm_option_remove_hookdir ( alpm_handle_t * handle,
const char * hookdir )

Remove a hookdir from the configured hookdirs.

Parameters
handlethe context handle
hookdirthe hookdir to remove
Returns
0 on success, -1 on error (pm_errno is set accordingly)

References ALPM_ERR_MEMORY, ALPM_ERR_WRONG_ARGS, alpm_list_remove_str(), ASSERT, canonicalize_path(), CHECK_HANDLE, FREE, and RET_ERR.

◆ alpm_option_remove_ignoregroup()

int alpm_option_remove_ignoregroup ( alpm_handle_t * handle,
const char * grp )

Remove an entry from the ignoregroup list.

Parameters
handlethe context handle
grpthe group to remove
Returns
0 on success, -1 on error (pm_errno is set accordingly)

◆ alpm_option_remove_ignorepkg()

int alpm_option_remove_ignorepkg ( alpm_handle_t * handle,
const char * pkg )

Remove an entry from the ignorepkg list.

Parameters
handlethe context handle
pkgthe package to remove
Returns
0 on success, -1 on error (pm_errno is set accordingly)

◆ alpm_option_remove_noextract()

int alpm_option_remove_noextract ( alpm_handle_t * handle,
const char * path )

Remove an entry from the no-extract list.

Parameters
handlethe context handle
paththe path to remove
Returns
0 on success, -1 on error (pm_errno is set accordingly)

◆ alpm_option_remove_noupgrade()

int alpm_option_remove_noupgrade ( alpm_handle_t * handle,
const char * path )

Remove an entry from the no-upgrade list.

Parameters
handlethe context handle
paththe path to remove
Returns
0 on success, -1 on error (pm_errno is set accordingly)

◆ alpm_option_remove_overwrite_file()

int alpm_option_remove_overwrite_file ( alpm_handle_t * handle,
const char * glob )

Remove a file glob from the configured overwritable files globs.

Note
The overwritable file list contains a list of globs. The glob to remove must exactly match the entry to remove. There is no glob expansion.
Parameters
handlethe context handle
globthe file glob to remove
Returns
0 on success, -1 on error (pm_errno is set accordingly)

◆ alpm_option_set_architectures()

int alpm_option_set_architectures ( alpm_handle_t * handle,
alpm_list_t * arches )

Sets the allowed package architecture.

Parameters
handlethe context handle
archesthe architecture to set

References alpm_list_strdup(), CHECK_HANDLE, and FREELIST.

◆ alpm_option_set_assumeinstalled()

int alpm_option_set_assumeinstalled ( alpm_handle_t * handle,
alpm_list_t * deps )

Sets the list of dependencies that are assumed to be met.

Parameters
handlethe context handle
depsa list of *alpm_depend_t The list will be duped and the original will still need to be freed by the caller.
Returns
0 on success, -1 on error (pm_errno is set accordingly)

References alpm_dep_free(), alpm_list_free(), alpm_list_free_inner(), alpm_option_add_assumeinstalled(), CHECK_HANDLE, alpm_list_t::data, and alpm_list_t::next.

◆ alpm_option_set_cachedirs()

int alpm_option_set_cachedirs ( alpm_handle_t * handle,
alpm_list_t * cachedirs )

Sets the cachedirs.

Parameters
handlethe context handle
cachedirsa char* list of cachdirs. The list will be duped and the original will still need to be freed by the caller.
Returns
0 on success, -1 on error (pm_errno is set accordingly)

References alpm_option_add_cachedir(), CHECK_HANDLE, alpm_list_t::data, FREELIST, and alpm_list_t::next.

◆ alpm_option_set_checkspace()

int alpm_option_set_checkspace ( alpm_handle_t * handle,
int checkspace )

Enable/disable checking free space before installing packages.

Parameters
handlethe context handle
checkspace0 for disabled, 1 for enabled

References CHECK_HANDLE.

◆ alpm_option_set_dbext()

int alpm_option_set_dbext ( alpm_handle_t * handle,
const char * dbext )

Sets the database extension.

Parameters
handlethe context handle
dbextthe database extension to use
Returns
0 on success, -1 on error (pm_errno is set accordingly)

References ALPM_ERR_MEMORY, ALPM_ERR_WRONG_ARGS, ALPM_LOG_DEBUG, ASSERT, CHECK_HANDLE, FREE, RET_ERR, and STRDUP.

◆ alpm_option_set_default_siglevel()

int alpm_option_set_default_siglevel ( alpm_handle_t * handle,
int level )

Set the default siglevel.

Parameters
handlethe context handle
levela alpm_siglevel_t bitfield of the level to set
Returns
0 on success, -1 on error (pm_errno is set accordingly)

References ALPM_ERR_MISSING_CAPABILITY_SIGNATURES, ALPM_ERR_WRONG_ARGS, ALPM_SIG_USE_DEFAULT, CHECK_HANDLE, level, and RET_ERR.

◆ alpm_option_set_disable_dl_timeout()

int alpm_option_set_disable_dl_timeout ( alpm_handle_t * handle,
unsigned short disable_dl_timeout )

Enables/disables the download timeout.

Parameters
handlethe context handle
disable_dl_timeout0 for enabled, 1 for disabled
Returns
0 on success, -1 on error (pm_errno is set accordingly)

References CHECK_HANDLE.

◆ alpm_option_set_disable_sandbox()

int alpm_option_set_disable_sandbox ( alpm_handle_t * handle,
unsigned short disable_sandbox )

Enables/disables the sandbox.

Parameters
handlethe context handle
disable_sandbox0 for enabled, 1 for disabled
Returns
0 on success, -1 on error (pm_errno is set accordingly)

References CHECK_HANDLE.

◆ alpm_option_set_dlcb()

int alpm_option_set_dlcb ( alpm_handle_t * handle,
alpm_cb_download cb,
void * ctx )

Sets the callback used to report download progress.

Parameters
handlethe context handle
cbthe cb to use
ctxuser-provided context to pass to cb
Returns
0 on success, -1 on error (pm_errno is set accordingly)

References CHECK_HANDLE.

Referenced by curl_download_internal_sandboxed().

◆ alpm_option_set_eventcb()

int alpm_option_set_eventcb ( alpm_handle_t * handle,
alpm_cb_event cb,
void * ctx )

Sets the callback used for events.

Parameters
handlethe context handle
cbthe cb to use
ctxuser-provided context to pass to cb
Returns
0 on success, -1 on error (pm_errno is set accordingly)

References CHECK_HANDLE.

Referenced by curl_download_internal_sandboxed().

◆ alpm_option_set_fetchcb()

int alpm_option_set_fetchcb ( alpm_handle_t * handle,
alpm_cb_fetch cb,
void * ctx )

Sets the downloading callback.

Parameters
handlethe context handle
cbthe cb to use
ctxuser-provided context to pass to cb
Returns
0 on success, -1 on error (pm_errno is set accordingly)

References CHECK_HANDLE.

Referenced by curl_download_internal_sandboxed().

◆ alpm_option_set_gpgdir()

int alpm_option_set_gpgdir ( alpm_handle_t * handle,
const char * gpgdir )

Sets the path to libalpm's GnuPG home directory.

Parameters
handlethe context handle
gpgdirthe gpgdir to set

References ALPM_LOG_DEBUG, CHECK_HANDLE, and RET_ERR.

◆ alpm_option_set_hookdirs()

int alpm_option_set_hookdirs ( alpm_handle_t * handle,
alpm_list_t * hookdirs )

Sets the hookdirs.

Parameters
handlethe context handle
hookdirsa char* list of hookdirs. The list will be duped and the original will still need to be freed by the caller.
Returns
0 on success, -1 on error (pm_errno is set accordingly)

References alpm_option_add_hookdir(), CHECK_HANDLE, alpm_list_t::data, FREELIST, and alpm_list_t::next.

◆ alpm_option_set_ignoregroups()

int alpm_option_set_ignoregroups ( alpm_handle_t * handle,
alpm_list_t * ignoregrps )

Sets the list of groups to ignore.

Parameters
handlethe context handle
ignoregrpsa char* list of groups to ignore The list will be duped and the original will still need to be freed by the caller.
Returns
0 on success, -1 on error (pm_errno is set accordingly)

◆ alpm_option_set_ignorepkgs()

int alpm_option_set_ignorepkgs ( alpm_handle_t * handle,
alpm_list_t * ignorepkgs )

Sets the list of packages to ignore.

Parameters
handlethe context handle
ignorepkgsa char* list of packages to ignore The list will be duped and the original will still need to be freed by the caller.
Returns
0 on success, -1 on error (pm_errno is set accordingly)

◆ alpm_option_set_local_file_siglevel()

int alpm_option_set_local_file_siglevel ( alpm_handle_t * handle,
int level )

Set the local file siglevel.

Parameters
handlethe context handle
levela alpm_siglevel_t bitfield of the level to set
Returns
0 on success, -1 on error (pm_errno is set accordingly)

References ALPM_ERR_MISSING_CAPABILITY_SIGNATURES, ALPM_SIG_USE_DEFAULT, CHECK_HANDLE, level, and RET_ERR.

◆ alpm_option_set_logcb()

int alpm_option_set_logcb ( alpm_handle_t * handle,
alpm_cb_log cb,
void * ctx )

Sets the callback used for logging.

Parameters
handlethe context handle
cbthe cb to use
ctxuser-provided context to pass to cb
Returns
0 on success, -1 on error (pm_errno is set accordingly)

References CHECK_HANDLE.

Referenced by curl_download_internal_sandboxed().

◆ alpm_option_set_logfile()

int alpm_option_set_logfile ( alpm_handle_t * handle,
const char * logfile )

Sets the logfile path.

Parameters
handlethe context handle
logfilepath to the new location of the logfile
Returns
0 on success, -1 on error (pm_errno is set accordingly)

References ALPM_ERR_MEMORY, ALPM_ERR_WRONG_ARGS, ALPM_LOG_DEBUG, CHECK_HANDLE, FREE, RET_ERR, and STRDUP.

◆ alpm_option_set_noextracts()

int alpm_option_set_noextracts ( alpm_handle_t * handle,
alpm_list_t * noextract )

Sets the list of no-extract files.

Parameters
handlethe context handle
noextracta char* list of file to not extract. The list will be duped and the original will still need to be freed by the caller.
Returns
0 on success, -1 on error (pm_errno is set accordingly)

◆ alpm_option_set_noupgrades()

int alpm_option_set_noupgrades ( alpm_handle_t * handle,
alpm_list_t * noupgrade )

Sets the list of no-upgrade files.

Parameters
handlethe context handle
noupgradea char* list of file to not upgrade. The list will be duped and the original will still need to be freed by the caller.
Returns
0 on success, -1 on error (pm_errno is set accordingly)

◆ alpm_option_set_overwrite_files()

int alpm_option_set_overwrite_files ( alpm_handle_t * handle,
alpm_list_t * globs )

Sets the overwritable files.

Parameters
handlethe context handle
globsa char* list of overwritable file globs. The list will be duped and the original will still need to be freed by the caller.
Returns
0 on success, -1 on error (pm_errno is set accordingly)

◆ alpm_option_set_parallel_downloads()

int alpm_option_set_parallel_downloads ( alpm_handle_t * handle,
unsigned int num_streams )

Sets number of parallel streams to download database and package files.

Parameters
handlethe context handle
num_streamsnumber of parallel download streams
Returns
0 on success, -1 on error

References ALPM_ERR_WRONG_ARGS, ASSERT, CHECK_HANDLE, and RET_ERR.

◆ alpm_option_set_progresscb()

int alpm_option_set_progresscb ( alpm_handle_t * handle,
alpm_cb_progress cb,
void * ctx )

Sets the callback used for operation progress.

Parameters
handlethe context handle
cbthe cb to use
ctxuser-provided context to pass to cb
Returns
0 on success, -1 on error (pm_errno is set accordingly)

References CHECK_HANDLE.

Referenced by curl_download_internal_sandboxed().

◆ alpm_option_set_questioncb()

int alpm_option_set_questioncb ( alpm_handle_t * handle,
alpm_cb_question cb,
void * ctx )

Sets the callback used for questions.

Parameters
handlethe context handle
cbthe cb to use
ctxuser-provided context to pass to cb
Returns
0 on success, -1 on error (pm_errno is set accordingly)

References CHECK_HANDLE.

Referenced by curl_download_internal_sandboxed().

◆ alpm_option_set_remote_file_siglevel()

int alpm_option_set_remote_file_siglevel ( alpm_handle_t * handle,
int level )

Set the remote file siglevel.

Parameters
handlethe context handle
levela alpm_siglevel_t bitfield of the level to set
Returns
0 on success, -1 on error (pm_errno is set accordingly)

References ALPM_ERR_MISSING_CAPABILITY_SIGNATURES, ALPM_SIG_USE_DEFAULT, CHECK_HANDLE, level, and RET_ERR.

◆ alpm_option_set_sandboxuser()

int alpm_option_set_sandboxuser ( alpm_handle_t * handle,
const char * sandboxuser )

Sets the user to switch to for sensitive operations.

Parameters
handlethe context handle
sandboxuserthe user to set

References ALPM_ERR_MEMORY, ALPM_LOG_DEBUG, CHECK_HANDLE, FREE, RET_ERR, and STRDUP.

◆ alpm_option_set_usesyslog()

int alpm_option_set_usesyslog ( alpm_handle_t * handle,
int usesyslog )

Sets whether to use syslog (0 is FALSE, TRUE otherwise).

Parameters
handlethe context handle
usesyslogwhether to use the syslog (0 is FALSE, TRUE otherwise)

References CHECK_HANDLE.