libalpm
Arch Linux Package Manager Library
handle.c File Reference
#include <errno.h>
#include <stdlib.h>
#include <string.h>
#include <limits.h>
#include <sys/types.h>
#include <syslog.h>
#include <sys/stat.h>
#include <fcntl.h>
#include "handle.h"
#include "alpm_list.h"
#include "util.h"
#include "log.h"
#include "trans.h"
#include "alpm.h"
#include "deps.h"
Include dependency graph for handle.c:

Functions

int alpm_unlock (alpm_handle_t *handle)
 Remove the database lock file.
 
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.
 
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.
 
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.
 
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.
 
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.
 
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.
 
const char * alpm_option_get_root (alpm_handle_t *handle)
 Returns the root path.
 
const char * alpm_option_get_dbpath (alpm_handle_t *handle)
 Returns the path to the database directory.
 
alpm_list_talpm_option_get_hookdirs (alpm_handle_t *handle)
 Gets the currently configured hookdirs,.
 
alpm_list_talpm_option_get_cachedirs (alpm_handle_t *handle)
 Gets the currently configured cachedirs,.
 
const char * alpm_option_get_logfile (alpm_handle_t *handle)
 Gets the filepath to the currently set logfile.
 
const char * alpm_option_get_lockfile (alpm_handle_t *handle)
 Get the name of the database lock file.
 
const char * alpm_option_get_gpgdir (alpm_handle_t *handle)
 Returns the path to libalpm's GnuPG home directory.
 
const char * alpm_option_get_sandboxuser (alpm_handle_t *handle)
 Returns the user to switch to for sensitive operations.
 
int alpm_option_get_usesyslog (alpm_handle_t *handle)
 Returns whether to use syslog (0 is FALSE, TRUE otherwise).
 
alpm_list_talpm_option_get_noupgrades (alpm_handle_t *handle)
 Get the list of no-upgrade files.
 
alpm_list_talpm_option_get_noextracts (alpm_handle_t *handle)
 Get the list of no-extract files.
 
alpm_list_talpm_option_get_ignorepkgs (alpm_handle_t *handle)
 Get the list of ignored packages.
 
alpm_list_talpm_option_get_ignoregroups (alpm_handle_t *handle)
 Get the list of ignored groups.
 
alpm_list_talpm_option_get_overwrite_files (alpm_handle_t *handle)
 Gets the currently configured overwritable files,.
 
alpm_list_talpm_option_get_assumeinstalled (alpm_handle_t *handle)
 Gets the list of dependencies that are assumed to be met.
 
alpm_list_talpm_option_get_architectures (alpm_handle_t *handle)
 Returns the allowed package architecture.
 
int alpm_option_get_checkspace (alpm_handle_t *handle)
 Get whether or not checking for free space before installing packages is enabled.
 
const char * alpm_option_get_dbext (alpm_handle_t *handle)
 Gets the configured database extension.
 
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_logcb (alpm_handle_t *handle, alpm_cb_log cb, void *ctx)
 Sets the callback used for logging.
 
int alpm_option_set_dlcb (alpm_handle_t *handle, alpm_cb_download cb, void *ctx)
 Sets the callback used to report download progress.
 
int alpm_option_set_fetchcb (alpm_handle_t *handle, alpm_cb_fetch cb, void *ctx)
 Sets the downloading callback.
 
int alpm_option_set_eventcb (alpm_handle_t *handle, alpm_cb_event cb, void *ctx)
 Sets the callback used for events.
 
int alpm_option_set_questioncb (alpm_handle_t *handle, alpm_cb_question cb, void *ctx)
 Sets the callback used for questions.
 
int alpm_option_set_progresscb (alpm_handle_t *handle, alpm_cb_progress cb, void *ctx)
 Sets the callback used for operation progress.
 
static char * canonicalize_path (const char *path)
 
int alpm_option_add_hookdir (alpm_handle_t *handle, const char *hookdir)
 Append a hookdir to the configured hookdirs.
 
int alpm_option_set_hookdirs (alpm_handle_t *handle, alpm_list_t *hookdirs)
 Sets the hookdirs.
 
int alpm_option_remove_hookdir (alpm_handle_t *handle, const char *hookdir)
 Remove a hookdir from the configured hookdirs.
 
int alpm_option_add_cachedir (alpm_handle_t *handle, const char *cachedir)
 Append a cachedir to the configured cachedirs.
 
int alpm_option_set_cachedirs (alpm_handle_t *handle, alpm_list_t *cachedirs)
 Sets the cachedirs.
 
int alpm_option_remove_cachedir (alpm_handle_t *handle, const char *cachedir)
 Remove a cachedir from the configured cachedirs.
 
int alpm_option_set_logfile (alpm_handle_t *handle, const char *logfile)
 Sets the logfile path.
 
int alpm_option_set_gpgdir (alpm_handle_t *handle, const char *gpgdir)
 Sets the path to libalpm's GnuPG home directory.
 
int alpm_option_set_sandboxuser (alpm_handle_t *handle, const char *sandboxuser)
 Sets the user to switch to for sensitive operations.
 
int alpm_option_set_usesyslog (alpm_handle_t *handle, int usesyslog)
 Sets whether to use syslog (0 is FALSE, TRUE otherwise).
 
int alpm_option_add_noupgrade (alpm_handle_t *handle, const char *pkg)
 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 *pkg)
 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.
 
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.
 
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.
 
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.
 
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_set_overwrite_files (alpm_handle_t *handle, alpm_list_t *globs)
 Sets the 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.
 
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.
 
static int assumeinstalled_cmp (const void *d1, const void *d2)
 
int alpm_option_remove_assumeinstalled (alpm_handle_t *handle, const alpm_depend_t *dep)
 Remove an entry from the assume installed list.
 
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.
 
alpm_db_t * alpm_get_localdb (alpm_handle_t *handle)
 Get the database of locally installed packages.
 
alpm_list_talpm_get_syncdbs (alpm_handle_t *handle)
 Get the list of sync databases.
 
int alpm_option_set_checkspace (alpm_handle_t *handle, int checkspace)
 Enable/disable checking free space before installing packages.
 
int alpm_option_set_dbext (alpm_handle_t *handle, const char *dbext)
 Sets the database extension.
 
int alpm_option_set_default_siglevel (alpm_handle_t *handle, int level)
 Set the default siglevel.
 
int alpm_option_get_default_siglevel (alpm_handle_t *handle)
 Get the default siglevel.
 
int alpm_option_set_local_file_siglevel (alpm_handle_t *handle, int level)
 Set the local file siglevel.
 
int alpm_option_get_local_file_siglevel (alpm_handle_t *handle)
 Get the configured local file siglevel.
 
int alpm_option_set_remote_file_siglevel (alpm_handle_t *handle, int level)
 Set the remote file siglevel.
 
int alpm_option_get_remote_file_siglevel (alpm_handle_t *handle)
 Get the configured remote file siglevel.
 
int alpm_option_set_disable_dl_timeout (alpm_handle_t *handle, unsigned short disable_dl_timeout)
 Enables/disables the download timeout.
 
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.
 
int alpm_option_set_disable_sandbox (alpm_handle_t *handle, unsigned short disable_sandbox)
 Enables/disables the sandbox.
 

Function Documentation

◆ assumeinstalled_cmp()

static int assumeinstalled_cmp ( const void * d1,
const void * d2 )
static

◆ canonicalize_path()

static char * canonicalize_path ( const char * path)
static