libalpm
Arch Linux Package Manager Library
|
The libalpm Public API. More...
The libalpm Public API.
typedef struct _alpm_backup_t alpm_backup_t |
Local package or package file backup entry.
typedef void(* alpm_cb_download)(const char *filename, off_t xfered, off_t total) |
typedef void(* alpm_cb_event)(alpm_event_t, void *, void *) |
typedef int(* alpm_cb_fetch)(const char *url, const char *localpath, int force) |
A callback for downloading files.
url | the URL of the file to be downloaded |
localpath | the directory to which the file should be downloaded |
force | whether to force an update, even if the file is the same |
typedef void(* alpm_cb_log)(alpm_loglevel_t, const char *, va_list) |
typedef void(* alpm_cb_progress)(alpm_progress_t, const char *, int, size_t, size_t) |
typedef void(* alpm_cb_question)(alpm_question_t, void *, void *, void *, int *) |
typedef void(* alpm_cb_totaldl)(off_t total) |
typedef struct _alpm_conflict_t alpm_conflict_t |
Conflict.
typedef struct __alpm_db_t alpm_db_t |
typedef struct _alpm_delta_t alpm_delta_t |
Package upgrade delta.
typedef struct _alpm_depend_t alpm_depend_t |
Dependency.
typedef struct _alpm_depmissing_t alpm_depmissing_t |
Missing dependency.
typedef enum _alpm_depmod_t alpm_depmod_t |
Types of version constraints in dependency specs.
typedef enum _alpm_event_t alpm_event_t |
Events.
NULL parameters are passed to in all events unless specified otherwise.
typedef struct _alpm_file_t alpm_file_t |
File in a package.
typedef struct _alpm_fileconflict_t alpm_fileconflict_t |
File conflict.
typedef enum _alpm_fileconflicttype_t alpm_fileconflicttype_t |
File conflict type.
Whether the conflict results from a file existing on the filesystem, or with another target in the transaction.
typedef struct _alpm_filelist_t alpm_filelist_t |
Package filelist container.
typedef struct _alpm_group_t alpm_group_t |
Package group.
typedef struct __alpm_handle_t alpm_handle_t |
typedef enum _alpm_loglevel_t alpm_loglevel_t |
Logging Levels.
typedef struct _alpm_pgpkey_t alpm_pgpkey_t |
typedef struct __alpm_pkg_t alpm_pkg_t |
typedef enum _alpm_pkgfrom_t alpm_pkgfrom_t |
typedef enum _alpm_pkgreason_t alpm_pkgreason_t |
Install reasons.
Why the package was installed.
typedef enum _alpm_progress_t alpm_progress_t |
Progress.
typedef enum _alpm_question_t alpm_question_t |
Questions.
typedef enum _alpm_siglevel_t alpm_siglevel_t |
PGP signature verification options.
typedef struct _alpm_siglist_t alpm_siglist_t |
Signature list.
Contains the number of signatures found and a pointer to an array of results. The array is of size count.
typedef struct _alpm_sigresult_t alpm_sigresult_t |
Signature result.
Contains the key, status, and validity of a given signature.
typedef enum _alpm_sigstatus_t alpm_sigstatus_t |
PGP signature verification status return codes.
typedef enum _alpm_sigvalidity_t alpm_sigvalidity_t |
PGP signature verification status return codes.
typedef int64_t alpm_time_t |
typedef struct __alpm_trans_t alpm_trans_t |
enum _alpm_depmod_t |
Types of version constraints in dependency specs.
enum _alpm_event_t |
Events.
NULL parameters are passed to in all events unless specified otherwise.
enum _alpm_loglevel_t |
enum _alpm_pkgfrom_t |
enum _alpm_pkgreason_t |
enum _alpm_progress_t |
enum _alpm_question_t |
enum _alpm_siglevel_t |
enum _alpm_sigstatus_t |
enum _alpm_sigvalidity_t |
int alpm_add_pkg | ( | alpm_handle_t * | handle, |
alpm_pkg_t * | pkg | ||
) |
Add a package to the transaction.
If the package was loaded by alpm_pkg_load(), it will be freed upon alpm_trans_release() invocation.
handle | the context handle |
pkg | the package to add |
Definition at line 50 of file add.c.
References _, _alpm_db_get_pkgfromcache(), _alpm_log(), _alpm_pkg_compare_versions(), _alpm_pkg_find(), __alpm_trans_t::add, ALPM_ERR_TRANS_DUP_TARGET, ALPM_ERR_TRANS_NOT_INITIALIZED, ALPM_ERR_TRANS_NULL, ALPM_ERR_WRONG_ARGS, alpm_list_add(), ALPM_LOG_DEBUG, ALPM_LOG_WARNING, ALPM_PKG_REASON_EXPLICIT, ALPM_TRANS_FLAG_DOWNLOADONLY, ALPM_TRANS_FLAG_NEEDED, ASSERT, CHECK_HANDLE, __alpm_handle_t::db_local, __alpm_trans_t::flags, __alpm_pkg_t::handle, __alpm_pkg_t::name, __alpm_pkg_t::reason, RET_ERR, __alpm_trans_t::state, STATE_INITIALIZED, __alpm_handle_t::trans, and __alpm_pkg_t::version.
Referenced by pacman_upgrade().
int alpm_db_check_pgp_signature | ( | alpm_db_t * | db, |
alpm_siglist_t * | siglist | ||
) |
Check the PGP signature for the given database.
db | the database to check |
siglist | a pointer to storage for signature results |
Definition at line 886 of file signing.c.
References _alpm_db_path(), _alpm_gpgme_checksig(), ALPM_ERR_WRONG_ARGS, ASSERT, __alpm_db_t::handle, __alpm_handle_t::pm_errno, and RET_ERR.
char* alpm_fetch_pkgurl | ( | alpm_handle_t * | handle, |
const char * | url | ||
) |
Fetch a remote pkg.
handle | the context handle |
url | URL of the package to download |
Definition at line 562 of file dload.c.
References _, _alpm_dload_payload_reset(), _alpm_download(), _alpm_filecache_find(), _alpm_filecache_setup(), _alpm_log(), dload_payload::allow_resume, ALPM_ERR_MEMORY, ALPM_ERR_WRONG_ARGS, ALPM_LOG_DEBUG, ALPM_LOG_WARNING, ALPM_SIG_PACKAGE, ALPM_SIG_PACKAGE_OPTIONAL, ASSERT, CHECK_HANDLE, dload_payload::errors_ok, dload_payload::fileurl, dload_payload::force, FREE, dload_payload::handle, handle, MALLOC, dload_payload::max_size, RET_ERR, __alpm_handle_t::siglevel, and STRDUP.
Referenced by pacman_upgrade().
alpm_list_t* alpm_find_group_pkgs | ( | alpm_list_t * | dbs, |
const char * | name | ||
) |
Find group members across a list of databases.
If a member exists in several databases, only the first database is used. IgnorePkg is also handled.
dbs | the list of alpm_db_t * |
name | the name of the group |
Definition at line 244 of file lib/libalpm/sync.c.
References _alpm_pkg_find(), _alpm_pkg_should_ignore(), alpm_db_readgroup(), alpm_list_add(), alpm_list_free(), ALPM_QUESTION_INSTALL_IGNOREPKG, __alpm_list_t::data, __alpm_db_t::handle, __alpm_pkg_t::name, __alpm_list_t::next, _alpm_group_t::packages, and QUESTION.
int alpm_logaction | ( | alpm_handle_t * | handle, |
const char * | fmt, | ||
... | |||
) |
A printf-like function for logging.
handle | the context handle |
fmt | output format |
Definition at line 41 of file log.c.
References _alpm_logaction(), ALPM_ERR_BADPERMS, ALPM_ERR_NOT_A_DIR, ALPM_ERR_SYSTEM, ASSERT, __alpm_handle_t::logfile, __alpm_handle_t::logstream, and __alpm_handle_t::pm_errno.
Referenced by _alpm_run_chroot(), alpm_trans_release(), cb_event(), and pacman_sync().
int alpm_pkg_check_pgp_signature | ( | alpm_pkg_t * | pkg, |
alpm_siglist_t * | siglist | ||
) |
Check the PGP signature for the given package file.
pkg | the package to check |
siglist | a pointer to storage for signature results |
Definition at line 869 of file signing.c.
References _alpm_gpgme_checksig(), ALPM_ERR_WRONG_ARGS, ASSERT, __alpm_pkg_t::base64_sig, __alpm_pkg_t::filename, __alpm_pkg_t::handle, __alpm_handle_t::pm_errno, and RET_ERR.
Referenced by dump_pkg_full().
int alpm_remove_pkg | ( | alpm_handle_t * | handle, |
alpm_pkg_t * | pkg | ||
) |
Add a package removal action to the transaction.
handle | the context handle |
pkg | the package to uninstall |
Definition at line 46 of file lib/libalpm/remove.c.
References _alpm_log(), _alpm_pkg_dup(), _alpm_pkg_find(), ALPM_ERR_TRANS_DUP_TARGET, ALPM_ERR_TRANS_NOT_INITIALIZED, ALPM_ERR_TRANS_NULL, ALPM_ERR_WRONG_ARGS, alpm_list_add(), ALPM_LOG_DEBUG, ASSERT, CHECK_HANDLE, __alpm_pkg_t::handle, __alpm_pkg_t::name, __alpm_trans_t::remove, RET_ERR, __alpm_trans_t::state, STATE_INITIALIZED, and __alpm_handle_t::trans.
int alpm_siglist_cleanup | ( | alpm_siglist_t * | siglist | ) |
Clean up and free a signature result list.
Note that this does not free the siglist object itself in case that was allocated on the stack; this is the responsibility of the caller.
siglist | a pointer to storage for signature results |
Definition at line 903 of file signing.c.
References ASSERT, _alpm_siglist_t::count, _alpm_pgpkey_t::data, _alpm_pgpkey_t::fingerprint, _alpm_sigresult_t::key, and _alpm_siglist_t::results.
Referenced by _alpm_check_pgp_helper(), and dump_pkg_full().
alpm_pkg_t* alpm_sync_newversion | ( | alpm_pkg_t * | pkg, |
alpm_list_t * | dbs_sync | ||
) |
Check for new version of pkg in sync repos (only the first occurrence is considered in sync)
Definition at line 54 of file lib/libalpm/sync.c.
References _alpm_db_get_pkgfromcache(), _alpm_log(), _alpm_pkg_compare_versions(), ALPM_LOG_DEBUG, ASSERT, __alpm_pkg_t::handle, __alpm_pkg_t::name, __alpm_list_t::next, __alpm_handle_t::pm_errno, and __alpm_pkg_t::version.
int alpm_sync_sysupgrade | ( | alpm_handle_t * | handle, |
int | enable_downgrade | ||
) |
Search for packages to upgrade and add them to the transaction.
handle | the context handle |
enable_downgrade | allow downgrading of packages if the remote version is lower |
Definition at line 192 of file lib/libalpm/sync.c.
References _alpm_db_get_pkgcache(), _alpm_db_get_pkgfromcache(), _alpm_log(), _alpm_pkg_find(), __alpm_trans_t::add, ALPM_ERR_TRANS_NOT_INITIALIZED, ALPM_ERR_TRANS_NULL, alpm_list_add(), alpm_list_join(), ALPM_LOG_DEBUG, ASSERT, CHECK_HANDLE, __alpm_list_t::data, __alpm_handle_t::db_local, __alpm_handle_t::dbs_sync, __alpm_pkg_t::name, __alpm_list_t::next, RET_ERR, __alpm_trans_t::state, STATE_INITIALIZED, and __alpm_handle_t::trans.