libalpm
Arch Linux Package Manager Library
|
#include <unistd.h>
#include <stdio.h>
#include <stdlib.h>
#include <errno.h>
#include <string.h>
#include <stdint.h>
#include <sys/stat.h>
#include <dirent.h>
#include <limits.h>
#include <archive.h>
#include <archive_entry.h>
#include "db.h"
#include "alpm_list.h"
#include "libarchive-compat.h"
#include "log.h"
#include "util.h"
#include "alpm.h"
#include "handle.h"
#include "package.h"
#include "deps.h"
#include "filelist.h"
Macros | |
#define | LAZY_LOAD(info) |
#define | READ_NEXT() |
#define | READ_AND_STORE(f) |
#define | READ_AND_STORE_ALL(f) |
#define | READ_AND_SPLITDEP(f) |
Functions | |
static int | local_db_read (alpm_pkg_t *info, int inforeq) |
static const char * | _cache_get_base (alpm_pkg_t *pkg) |
static const char * | _cache_get_desc (alpm_pkg_t *pkg) |
static const char * | _cache_get_url (alpm_pkg_t *pkg) |
static alpm_time_t | _cache_get_builddate (alpm_pkg_t *pkg) |
static alpm_time_t | _cache_get_installdate (alpm_pkg_t *pkg) |
static const char * | _cache_get_packager (alpm_pkg_t *pkg) |
static const char * | _cache_get_arch (alpm_pkg_t *pkg) |
static off_t | _cache_get_isize (alpm_pkg_t *pkg) |
static alpm_pkgreason_t | _cache_get_reason (alpm_pkg_t *pkg) |
static int | _cache_get_validation (alpm_pkg_t *pkg) |
static alpm_list_t * | _cache_get_licenses (alpm_pkg_t *pkg) |
static alpm_list_t * | _cache_get_groups (alpm_pkg_t *pkg) |
static int | _cache_has_scriptlet (alpm_pkg_t *pkg) |
static alpm_list_t * | _cache_get_depends (alpm_pkg_t *pkg) |
static alpm_list_t * | _cache_get_optdepends (alpm_pkg_t *pkg) |
static alpm_list_t * | _cache_get_makedepends (alpm_pkg_t *pkg) |
static alpm_list_t * | _cache_get_checkdepends (alpm_pkg_t *pkg) |
static alpm_list_t * | _cache_get_conflicts (alpm_pkg_t *pkg) |
static alpm_list_t * | _cache_get_provides (alpm_pkg_t *pkg) |
static alpm_list_t * | _cache_get_replaces (alpm_pkg_t *pkg) |
static alpm_filelist_t * | _cache_get_files (alpm_pkg_t *pkg) |
static alpm_list_t * | _cache_get_backup (alpm_pkg_t *pkg) |
static alpm_list_t * | _cache_get_xdata (alpm_pkg_t *pkg) |
static void * | _cache_changelog_open (alpm_pkg_t *pkg) |
Open a package changelog for reading. | |
static size_t | _cache_changelog_read (void *ptr, size_t size, const alpm_pkg_t UNUSED *pkg, void *fp) |
Read data from an open changelog 'file stream'. | |
static int | _cache_changelog_close (const alpm_pkg_t UNUSED *pkg, void *fp) |
Close a package changelog for reading. | |
static struct archive * | _cache_mtree_open (alpm_pkg_t *pkg) |
Open a package mtree file for reading. | |
static int | _cache_mtree_next (const alpm_pkg_t UNUSED *pkg, struct archive *mtree, struct archive_entry **entry) |
Read next entry from a package mtree file. | |
static int | _cache_mtree_close (const alpm_pkg_t UNUSED *pkg, struct archive *mtree) |
Close a package mtree file for reading. | |
static int | _cache_force_load (alpm_pkg_t *pkg) |
static int | checkdbdir (alpm_db_t *db) |
static int | is_dir (const char *path, struct dirent *entry) |
static int | local_db_add_version (alpm_db_t UNUSED *db, const char *dbpath) |
static int | local_db_create (alpm_db_t *db, const char *dbpath) |
static int | local_db_validate (alpm_db_t *db) |
static int | local_db_populate (alpm_db_t *db) |
static alpm_pkgreason_t | _read_pkgreason (alpm_handle_t *handle, const char *pkgname, const char *line) |
static void | write_deps (FILE *fp, const char *header, alpm_list_t *deplist) |
int | alpm_pkg_set_reason (alpm_pkg_t *pkg, alpm_pkgreason_t reason) |
Set install reason for a package in the local database. | |
Variables | |
size_t | ALPM_LOCAL_DB_VERSION = 9 |
static const struct pkg_operations | local_pkg_ops |
The local database operations struct. | |
static const struct db_operations | local_db_ops |
#define LAZY_LOAD | ( | info | ) |
Referenced by _cache_get_arch(), _cache_get_backup(), _cache_get_base(), _cache_get_builddate(), _cache_get_checkdepends(), _cache_get_conflicts(), _cache_get_depends(), _cache_get_desc(), _cache_get_files(), _cache_get_groups(), _cache_get_installdate(), _cache_get_isize(), _cache_get_licenses(), _cache_get_makedepends(), _cache_get_optdepends(), _cache_get_packager(), _cache_get_provides(), _cache_get_reason(), _cache_get_replaces(), _cache_get_url(), _cache_get_validation(), _cache_get_xdata(), and _cache_has_scriptlet().
#define READ_AND_SPLITDEP | ( | f | ) |
Referenced by local_db_read().
#define READ_AND_STORE | ( | f | ) |
Referenced by local_db_read().
#define READ_AND_STORE_ALL | ( | f | ) |
Referenced by local_db_read().
#define READ_NEXT | ( | ) |
Referenced by local_db_read().
|
static |
Close a package changelog for reading.
Similar to fclose in functionality, except that the 'file stream' is from the database.
pkg | the package that the changelog was read from |
fp | a 'file stream' to the package changelog |
|
static |
Open a package changelog for reading.
Similar to fopen in functionality, except that the returned 'file stream' is from the database.
pkg | the package (from db) to read the changelog |
References alpm_pkg_get_db().
|
static |
Read data from an open changelog 'file stream'.
Similar to fread in functionality, this function takes a buffer and amount of data to read.
ptr | a buffer to fill with raw changelog data |
size | the size of the buffer |
pkg | the package that the changelog is being read from |
fp | a 'file stream' to the package changelog |
|
static |
References INFRQ_ALL, and local_db_read().
|
static |
References INFRQ_DESC, and LAZY_LOAD.
|
static |
References INFRQ_FILES, and LAZY_LOAD.
|
static |
References INFRQ_DESC, and LAZY_LOAD.
|
static |
References INFRQ_DESC, and LAZY_LOAD.
|
static |
References INFRQ_DESC, and LAZY_LOAD.
|
static |
References INFRQ_DESC, and LAZY_LOAD.
|
static |
References INFRQ_DESC, and LAZY_LOAD.
|
static |
References INFRQ_DESC, and LAZY_LOAD.
|
static |
References INFRQ_FILES, and LAZY_LOAD.
|
static |
References INFRQ_DESC, and LAZY_LOAD.
|
static |
References INFRQ_DESC, and LAZY_LOAD.
|
static |
References INFRQ_DESC, and LAZY_LOAD.
|
static |
References INFRQ_DESC, and LAZY_LOAD.
|
static |
References INFRQ_DESC, and LAZY_LOAD.
|
static |
References INFRQ_DESC, and LAZY_LOAD.
|
static |
References INFRQ_DESC, and LAZY_LOAD.
|
static |
References INFRQ_DESC, and LAZY_LOAD.
|
static |
References INFRQ_DESC, and LAZY_LOAD.
|
static |
References INFRQ_DESC, and LAZY_LOAD.
|
static |
References INFRQ_DESC, and LAZY_LOAD.
|
static |
References INFRQ_DESC, and LAZY_LOAD.
|
static |
References INFRQ_DESC, and LAZY_LOAD.
|
static |
References INFRQ_SCRIPTLET, and LAZY_LOAD.
|
static |
Close a package mtree file for reading.
pkg | the package that the mtree file was read from |
mtree | the archive structure use for reading from the mtree file |
|
static |
Read next entry from a package mtree file.
pkg | the package that the mtree file is being read from |
archive | the archive structure reading from the mtree file |
entry | an archive_entry to store the entry header information |
|
static |
Open a package mtree file for reading.
pkg | the local package to read the changelog of |
References _, ALPM_BUFFER_SIZE, ALPM_ERR_LIBARCHIVE, ALPM_LOG_ERROR, alpm_pkg_get_db(), error, and GOTO_ERR.
|
static |
References _, ALPM_LOG_ERROR, ALPM_PKG_REASON_DEPEND, ALPM_PKG_REASON_EXPLICIT, and ALPM_PKG_REASON_UNKNOWN.
Referenced by local_db_read().
|
static |
References _, ALPM_ERR_SYSTEM, ALPM_LOG_DEBUG, ALPM_LOG_WARNING, and RET_ERR.
|
static |
Referenced by dir_belongsto_pkgs(), and local_db_populate().
|
static |
References ALPM_LOCAL_DB_VERSION.
Referenced by local_db_create(), and local_db_validate().
|
static |
References _, ALPM_ERR_DB_CREATE, ALPM_LOG_ERROR, local_db_add_version(), and RET_ERR.
Referenced by local_db_validate().
|
static |
References _, ALPM_ERR_DB_INVALID, ALPM_ERR_DB_NOT_FOUND, ALPM_ERR_DB_OPEN, ALPM_ERR_MEMORY, alpm_list_msort(), ALPM_LOG_DEBUG, ALPM_LOG_ERROR, ALPM_LOG_FUNCTION, ALPM_PKG_FROM_LOCALDB, DB_STATUS_EXISTS, DB_STATUS_INVALID, DB_STATUS_MISSING, INFRQ_BASE, is_dir(), local_db_read(), local_pkg_ops, and RET_ERR.
|
static |
References _, _read_pkgreason(), alpm_list_add(), alpm_list_append(), alpm_list_next(), ALPM_LOG_ERROR, ALPM_LOG_FUNCTION, ALPM_LOG_WARNING, ALPM_PKG_VALIDATION_MD5SUM, ALPM_PKG_VALIDATION_NONE, ALPM_PKG_VALIDATION_SHA256SUM, ALPM_PKG_VALIDATION_SIGNATURE, CALLOC, alpm_list_t::data, error, FREE, FREELIST, INFRQ_DESC, INFRQ_ERROR, INFRQ_FILES, INFRQ_SCRIPTLET, MALLOC, alpm_list_t::next, READ_AND_SPLITDEP, READ_AND_STORE, READ_AND_STORE_ALL, READ_NEXT, and REALLOC.
Referenced by _cache_force_load(), and local_db_populate().
|
static |
|
static |
References alpm_dep_compute_string(), alpm_list_t::data, and alpm_list_t::next.
size_t ALPM_LOCAL_DB_VERSION = 9 |
Referenced by local_db_add_version(), and local_db_validate().
|
static |
|
static |
The local database operations struct.
Get package fields through lazy accessor methods that handle any backend loading and caching logic.
Referenced by local_db_populate().