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 "db.h"
#include "alpm_list.h"
#include "log.h"
#include "util.h"
#include "alpm.h"
#include "handle.h"
#include "package.h"
#include "deps.h"
Go to the source code of this file.
Defines | |
#define | LAZY_LOAD(info, errret) |
#define | READ_NEXT() |
#define | READ_AND_STORE(f) |
#define | READ_AND_STORE_ALL(f) |
#define | READ_AND_SPLITDEP(f) |
Functions | |
char * | _alpm_local_db_pkgpath (alpm_db_t *db, alpm_pkg_t *info, const char *filename) |
int | _alpm_local_db_prepare (alpm_db_t *db, alpm_pkg_t *info) |
int | _alpm_local_db_write (alpm_db_t *db, alpm_pkg_t *info, alpm_dbinfrq_t inforeq) |
int | _alpm_local_db_remove (alpm_db_t *db, alpm_pkg_t *info) |
alpm_db_t * | _alpm_db_register_local (alpm_handle_t *handle) |
Variables | |
struct db_operations | local_db_ops |
#define LAZY_LOAD | ( | info, | |
errret | |||
) |
do { \ if(!(pkg->infolevel & info)) { \ local_db_read(pkg, info); \ } \ } while(0)
Definition at line 43 of file be_local.c.
#define READ_AND_SPLITDEP | ( | f | ) |
do { \ if(fgets(line, sizeof(line), fp) == NULL) {\ if(!feof(fp)) goto error; else break; \ } \ if(_alpm_strip_newline(line) == 0) break; \ f = alpm_list_add(f, _alpm_splitdep(line)); \ } while(1) /* note the while(1) and not (0) */
Definition at line 510 of file be_local.c.
#define READ_AND_STORE | ( | f | ) |
do { \ READ_NEXT(); \ STRDUP(f, line, goto error); \ } while(0)
Definition at line 495 of file be_local.c.
#define READ_AND_STORE_ALL | ( | f | ) |
do { \ char *linedup; \ if(fgets(line, sizeof(line), fp) == NULL) {\ if(!feof(fp)) goto error; else break; \ } \ if(_alpm_strip_newline(line) == 0) break; \ STRDUP(linedup, line, goto error); \ f = alpm_list_add(f, linedup); \ } while(1) /* note the while(1) and not (0) */
Definition at line 500 of file be_local.c.
#define READ_NEXT | ( | ) |
do { \ if(fgets(line, sizeof(line), fp) == NULL && !feof(fp)) goto error; \ _alpm_strip_newline(line); \ } while(0)
Definition at line 490 of file be_local.c.
alpm_db_t* _alpm_db_register_local | ( | alpm_handle_t * | handle | ) |
Definition at line 927 of file be_local.c.
References _alpm_db_free(), _alpm_db_new(), _alpm_log(), ALPM_ERR_DB_CREATE, ALPM_LOG_DEBUG, __alpm_handle_t::db_local, handle, __alpm_db_t::handle, local_db_ops, __alpm_db_t::ops, and __alpm_handle_t::pm_errno.
Referenced by alpm_initialize().
char* _alpm_local_db_pkgpath | ( | alpm_db_t * | db, |
alpm_pkg_t * | info, | ||
const char * | filename | ||
) |
Definition at line 474 of file be_local.c.
References _alpm_db_path(), ALPM_ERR_MEMORY, dbpath, __alpm_db_t::handle, MALLOC, __alpm_pkg_t::name, RET_ERR, and __alpm_pkg_t::version.
Referenced by _alpm_local_db_prepare(), _alpm_local_db_remove(), _alpm_local_db_write(), and _alpm_remove_single_package().
int _alpm_local_db_prepare | ( | alpm_db_t * | db, |
alpm_pkg_t * | info | ||
) |
Definition at line 710 of file be_local.c.
References _, _alpm_local_db_pkgpath(), _alpm_log(), ALPM_LOG_ERROR, and __alpm_db_t::handle.
int _alpm_local_db_remove | ( | alpm_db_t * | db, |
alpm_pkg_t * | info | ||
) |
Definition at line 907 of file be_local.c.
References _alpm_local_db_pkgpath(), and _alpm_rmrf().
Referenced by _alpm_remove_single_package().
int _alpm_local_db_write | ( | alpm_db_t * | db, |
alpm_pkg_t * | info, | ||
alpm_dbinfrq_t | inforeq | ||
) |
Definition at line 734 of file be_local.c.
References _, _alpm_local_db_pkgpath(), _alpm_log(), alpm_dep_compute_string(), ALPM_LOG_DEBUG, ALPM_LOG_ERROR, __alpm_pkg_t::arch, __alpm_pkg_t::backup, __alpm_pkg_t::builddate, __alpm_pkg_t::conflicts, _alpm_filelist_t::count, __alpm_list_t::data, DB_STATUS_LOCAL, __alpm_pkg_t::depends, __alpm_pkg_t::desc, __alpm_pkg_t::files, _alpm_filelist_t::files, __alpm_pkg_t::groups, __alpm_db_t::handle, _alpm_backup_t::hash, INFRQ_DESC, INFRQ_FILES, __alpm_pkg_t::installdate, __alpm_pkg_t::isize, __alpm_pkg_t::licenses, __alpm_pkg_t::name, _alpm_file_t::name, _alpm_backup_t::name, __alpm_list_t::next, __alpm_pkg_t::optdepends, __alpm_pkg_t::packager, __alpm_pkg_t::provides, __alpm_pkg_t::reason, __alpm_pkg_t::replaces, __alpm_db_t::status, __alpm_pkg_t::url, and __alpm_pkg_t::version.
Referenced by alpm_db_set_pkgreason().
struct db_operations local_db_ops |
{ .validate = local_db_validate, .populate = local_db_populate, .unregister = _alpm_db_unregister, }
Definition at line 921 of file be_local.c.
Referenced by _alpm_db_register_local().