| libalpm
    Arch Linux Package Manager Library | 
#include <sys/types.h>#include <stdbool.h>#include <stdlib.h>#include <stdio.h>#include <string.h>#include <stdint.h>#include <unistd.h>#include <limits.h>#include "sync.h"#include "alpm_list.h"#include "log.h"#include "package.h"#include "db.h"#include "deps.h"#include "conflict.h"#include "trans.h"#include "add.h"#include "util.h"#include "handle.h"#include "alpm.h"#include "dload.h"#include "remove.h"#include "diskspace.h"#include "signing.h"
| Data Structures | |
| struct | keyinfo_t | 
| Macros | |
| #define | CHECK_FIELD(STR, FIELD, CMP) | 
| Functions | |
| alpm_pkg_t * | alpm_sync_get_new_version (alpm_pkg_t *pkg, alpm_list_t *dbs_sync) | 
| Check for new version of pkg in syncdbs. | |
| static int | check_literal (alpm_handle_t *handle, alpm_pkg_t *lpkg, alpm_pkg_t *spkg, int enable_downgrade) | 
| static alpm_list_t * | check_replacers (alpm_handle_t *handle, alpm_pkg_t *lpkg, alpm_db_t *sdb) | 
| int | alpm_sync_sysupgrade (alpm_handle_t *handle, int enable_downgrade) | 
| Search for packages to upgrade and add them to the transaction. | |
| alpm_list_t * | alpm_find_group_pkgs (alpm_list_t *dbs, const char *name) | 
| Find group members across a list of databases. | |
| static int | compute_download_size (alpm_pkg_t *newpkg) | 
| Compute the size of the files that will be downloaded to install a package. | |
| off_t | alpm_pkg_download_size (alpm_pkg_t *newpkg) | 
| Returns the size of the files that will be downloaded to install a package. | |
| static int | prompt_to_delete (alpm_handle_t *handle, const char *filepath, alpm_errno_t reason) | 
| Prompts to delete the file now that we know it is invalid. | |
| static int | find_dl_candidates (alpm_handle_t *handle, alpm_list_t **files) | 
| static int | download_files (alpm_handle_t *handle) | 
| static int | key_cmp (const void *k1, const void *k2) | 
| static int | check_keyring (alpm_handle_t *handle) | 
| static int | check_validity (alpm_handle_t *handle, size_t total, uint64_t total_bytes) | 
| static int | dep_not_equal (const alpm_depend_t *left, const alpm_depend_t *right) | 
| static int | check_pkg_field_matches_db (alpm_handle_t *handle, const char *field, alpm_list_t *left, alpm_list_t *right, alpm_list_fn_cmp cmp) | 
| static int | check_pkg_matches_db (alpm_pkg_t *spkg, alpm_pkg_t *pkgfile) | 
| static int | load_packages (alpm_handle_t *handle, alpm_list_t **data, size_t total, size_t total_bytes) | 
| #define CHECK_FIELD | ( | STR, | |
| FIELD, | |||
| CMP ) | 
Referenced by check_pkg_matches_db().
| 
 | static | 
References _, alpm_db_get_siglevel(), ALPM_EVENT_KEY_DOWNLOAD_DONE, ALPM_EVENT_KEY_DOWNLOAD_START, ALPM_EVENT_KEYRING_DONE, ALPM_EVENT_KEYRING_START, alpm_extract_keyid(), alpm_list_add(), alpm_list_count(), alpm_list_find(), alpm_list_free(), ALPM_LOG_DEBUG, ALPM_LOG_ERROR, ALPM_PKG_FROM_FILE, alpm_pkg_get_db(), alpm_pkg_get_sig(), ALPM_PROGRESS_KEYRING_START, ALPM_SIG_PACKAGE, alpm_list_t::data, EVENT, FREELIST, key_cmp(), keyinfo_t::keyid, level, alpm_list_t::next, PROGRESS, and keyinfo_t::uid.
| 
 | static | 
References _, ALPM_LOG_DEBUG, ALPM_LOG_WARNING, alpm_pkg_get_db(), and alpm_pkg_should_ignore().
Referenced by alpm_sync_sysupgrade().
| 
 | static | 
References ALPM_ERR_MEMORY, alpm_list_cmp_unsorted(), ALPM_LOG_DEBUG, and RET_ERR.
| 
 | static | 
References ALPM_LOG_DEBUG, CHECK_FIELD, dep_not_equal(), and error.
Referenced by load_packages().
| 
 | static | 
References _, alpm_list_add(), ALPM_LOG_DEBUG, ALPM_LOG_WARNING, alpm_pkg_find(), alpm_pkg_get_reason(), alpm_pkg_get_replaces(), ALPM_PKG_REASON_EXPLICIT, alpm_pkg_should_ignore(), ALPM_QUESTION_REPLACE_PKG, alpm_list_t::data, alpm_list_t::next, QUESTION, alpm_question_replace_t::replace, and alpm_question_replace_t::type.
Referenced by alpm_sync_sysupgrade().
| 
 | static | 
References _, __attribute__(), alpm_db_get_siglevel(), ALPM_ERR_BADPERMS, ALPM_ERR_OK, ALPM_ERR_PKG_INVALID, ALPM_ERR_PKG_INVALID_CHECKSUM, ALPM_ERR_PKG_INVALID_SIG, ALPM_ERR_PKG_MISSING_SIG, ALPM_ERR_PKG_NOT_FOUND, ALPM_ERR_PKG_OPEN, ALPM_EVENT_INTEGRITY_DONE, ALPM_EVENT_INTEGRITY_START, alpm_list_add(), alpm_list_free(), ALPM_LOG_ERROR, ALPM_PKG_FROM_FILE, alpm_pkg_get_db(), ALPM_PROGRESS_INTEGRITY_START, ALPM_SIG_PACKAGE_MARGINAL_OK, ALPM_SIG_PACKAGE_OPTIONAL, ALPM_SIG_PACKAGE_UNKNOWN_OK, alpm_siglist_cleanup(), alpm_strerror(), alpm_list_t::data, error, EVENT, MALLOC, alpm_list_t::next, PROGRESS, prompt_to_delete(), RET_ERR, and alpm_event_t::type.
| 
 | static | 
Compute the size of the files that will be downloaded to install a package.
| newpkg | the new package to upgrade to | 
References ALPM_ERR_PKG_INVALID_NAME, ALPM_LOG_DEBUG, ALPM_PKG_FROM_SYNCDB, ASSERT, CALLOC, FREE, INFRQ_DSIZE, and RET_ERR.
Referenced by alpm_pkg_download_size().
| 
 | static | 
References alpm_depend_t::mod, alpm_depend_t::name, alpm_depend_t::name_hash, and alpm_depend_t::version.
Referenced by check_pkg_matches_db().
| 
 | static | 
References _, dload_payload::allow_resume, alpm_db_get_siglevel(), ALPM_ERR_MEMORY, ALPM_EVENT_PKG_RETRIEVE_DONE, ALPM_EVENT_PKG_RETRIEVE_FAILED, ALPM_EVENT_PKG_RETRIEVE_START, alpm_list_add(), alpm_list_count(), alpm_list_free(), alpm_list_free_inner(), ALPM_LOG_DEBUG, ALPM_LOG_WARNING, alpm_pkg_get_db(), ALPM_SIG_PACKAGE, ALPM_SIG_PACKAGE_OPTIONAL, dload_payload::cache_servers, CALLOC, alpm_list_t::data, dload_payload::destfile_name, dload_payload::download_signature, EVENT, dload_payload::filepath, find_dl_candidates(), FREE, FREELIST, GOTO_ERR, dload_payload::handle, dload_payload::max_size, alpm_list_t::next, dload_payload::remote_name, dload_payload::servers, dload_payload::signature_optional, STATE_DOWNLOADING, STRDUP, and dload_payload::tempfile_name.
| 
 | static | 
References alpm_db_get_siglevel(), ALPM_ERR_MEMORY, ALPM_ERR_PKG_INVALID_NAME, ALPM_ERR_SERVER_NONE, alpm_list_add(), ALPM_LOG_ERROR, ALPM_PKG_FROM_FILE, alpm_pkg_get_db(), ALPM_SIG_PACKAGE, alpm_strerror(), ASSERT, alpm_list_t::data, FREE, MALLOC, alpm_list_t::next, and RET_ERR.
Referenced by download_files().
| 
 | static | 
References keyinfo_t::keyid.
Referenced by check_keyring().
| 
 | static | 
References _, ALPM_ERR_OK, ALPM_ERR_PKG_INVALID, ALPM_ERR_PKG_NOT_FOUND, ALPM_EVENT_LOAD_DONE, ALPM_EVENT_LOAD_START, alpm_list_add(), ALPM_LOG_DEBUG, ALPM_LOG_ERROR, ALPM_PKG_FROM_FILE, ALPM_PROGRESS_LOAD_START, check_pkg_matches_db(), alpm_list_t::data, error, EVENT, FREELIST, alpm_list_t::next, PROGRESS, prompt_to_delete(), RET_ERR, and alpm_event_t::type.
| 
 | static | 
Prompts to delete the file now that we know it is invalid.
| handle | the context handle | 
| filename | the absolute path of the file to test | 
| reason | an error code indicating the reason for package invalidity | 
References ALPM_QUESTION_CORRUPTED_PKG, FREE, QUESTION, alpm_question_corrupted_t::remove, and alpm_question_conflict_t::type.
Referenced by check_validity(), and load_packages().