libalpm
Arch Linux Package Manager Library
|
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <regex.h>
#include "db.h"
#include "alpm_list.h"
#include "log.h"
#include "util.h"
#include "handle.h"
#include "alpm.h"
#include "package.h"
#include "group.h"
Go to the source code of this file.
Functions | |
alpm_db_t * | alpm_db_register_sync (alpm_handle_t *handle, const char *treename, alpm_siglevel_t level) |
Register a sync database of packages. | |
void | _alpm_db_unregister (alpm_db_t *db) |
int | alpm_db_unregister_all (alpm_handle_t *handle) |
Unregister all package databases. | |
int | alpm_db_unregister (alpm_db_t *db) |
Unregister a package database. | |
alpm_list_t * | alpm_db_get_servers (const alpm_db_t *db) |
Get the serverlist of a database. | |
int | alpm_db_set_servers (alpm_db_t *db, alpm_list_t *servers) |
Set the serverlist of a database. | |
int | alpm_db_add_server (alpm_db_t *db, const char *url) |
Add a download server to a database. | |
int | alpm_db_remove_server (alpm_db_t *db, const char *url) |
Remove a download server from a database. | |
const char * | alpm_db_get_name (const alpm_db_t *db) |
Get the name of a package database. | |
alpm_siglevel_t | alpm_db_get_siglevel (alpm_db_t *db) |
Get the signature verification level for a database. | |
int | alpm_db_get_valid (alpm_db_t *db) |
Check the validity of a database. | |
alpm_pkg_t * | alpm_db_get_pkg (alpm_db_t *db, const char *name) |
Get a package entry from a package database. | |
alpm_list_t * | alpm_db_get_pkgcache (alpm_db_t *db) |
Get the package cache of a package database. | |
alpm_group_t * | alpm_db_readgroup (alpm_db_t *db, const char *name) |
Get a group entry from a package database. | |
alpm_list_t * | alpm_db_get_groupcache (alpm_db_t *db) |
Get the group cache of a package database. | |
alpm_list_t * | alpm_db_search (alpm_db_t *db, const alpm_list_t *needles) |
Searches a database. | |
int | alpm_db_set_pkgreason (alpm_handle_t *handle, alpm_pkg_t *pkg, alpm_pkgreason_t reason) |
Set install reason for a package in db. | |
alpm_db_t * | _alpm_db_new (const char *treename, int is_local) |
void | _alpm_db_free (alpm_db_t *db) |
const char * | _alpm_db_path (alpm_db_t *db) |
int | _alpm_db_cmp (const void *d1, const void *d2) |
alpm_list_t * | _alpm_db_search (alpm_db_t *db, const alpm_list_t *needles) |
void | _alpm_db_free_pkgcache (alpm_db_t *db) |
alpm_pkghash_t * | _alpm_db_get_pkgcache_hash (alpm_db_t *db) |
alpm_list_t * | _alpm_db_get_pkgcache (alpm_db_t *db) |
int | _alpm_db_add_pkgincache (alpm_db_t *db, alpm_pkg_t *pkg) |
int | _alpm_db_remove_pkgfromcache (alpm_db_t *db, alpm_pkg_t *pkg) |
alpm_pkg_t * | _alpm_db_get_pkgfromcache (alpm_db_t *db, const char *target) |
alpm_list_t * | _alpm_db_get_groupcache (alpm_db_t *db) |
alpm_group_t * | _alpm_db_get_groupfromcache (alpm_db_t *db, const char *target) |
int _alpm_db_add_pkgincache | ( | alpm_db_t * | db, |
alpm_pkg_t * | pkg | ||
) |
Definition at line 548 of file db.c.
References _alpm_log(), _alpm_pkg_dup(), _alpm_pkghash_add_sorted(), ALPM_LOG_DEBUG, DB_STATUS_PKGCACHE, __alpm_db_t::handle, __alpm_pkg_t::name, __alpm_db_t::pkgcache, __alpm_db_t::status, and __alpm_db_t::treename.
int _alpm_db_cmp | ( | const void * | d1, |
const void * | d2 | ||
) |
Definition at line 380 of file db.c.
References __alpm_db_t::treename.
Referenced by alpm_db_unregister().
void _alpm_db_free | ( | alpm_db_t * | db | ) |
Definition at line 336 of file db.c.
References _alpm_db_free_pkgcache(), __alpm_db_t::_path, FREE, FREELIST, __alpm_db_t::servers, and __alpm_db_t::treename.
Referenced by _alpm_db_register_local(), and _alpm_db_unregister().
void _alpm_db_free_pkgcache | ( | alpm_db_t * | db | ) |
Definition at line 500 of file db.c.
References _alpm_log(), _alpm_pkg_free(), _alpm_pkghash_free(), alpm_list_free_inner(), ALPM_LOG_DEBUG, DB_STATUS_PKGCACHE, __alpm_db_t::handle, __alpm_pkghash_t::list, __alpm_db_t::pkgcache, __alpm_db_t::status, and __alpm_db_t::treename.
Referenced by _alpm_db_free(), and alpm_db_update().
alpm_list_t* _alpm_db_get_groupcache | ( | alpm_db_t * | db | ) |
Definition at line 661 of file db.c.
References ALPM_ERR_DB_INVALID, DB_STATUS_GRPCACHE, DB_STATUS_VALID, __alpm_db_t::grpcache, __alpm_db_t::handle, RET_ERR, and __alpm_db_t::status.
Referenced by _alpm_db_get_groupfromcache(), and alpm_db_get_groupcache().
alpm_group_t* _alpm_db_get_groupfromcache | ( | alpm_db_t * | db, |
const char * | target | ||
) |
Definition at line 678 of file db.c.
References _alpm_db_get_groupcache(), __alpm_list_t::data, _alpm_group_t::name, and __alpm_list_t::next.
Referenced by alpm_db_readgroup().
alpm_list_t* _alpm_db_get_pkgcache | ( | alpm_db_t * | db | ) |
Definition at line 536 of file db.c.
References _alpm_db_get_pkgcache_hash(), and __alpm_pkghash_t::list.
Referenced by _alpm_db_find_fileconflicts(), _alpm_db_search(), _alpm_outerconflicts(), _alpm_recursedeps(), _alpm_remove_prepare(), _alpm_sync_prepare(), alpm_db_get_pkgcache(), and alpm_sync_sysupgrade().
Definition at line 519 of file db.c.
References ALPM_ERR_DB_INVALID, DB_STATUS_PKGCACHE, DB_STATUS_VALID, __alpm_db_t::handle, __alpm_db_t::pkgcache, RET_ERR, and __alpm_db_t::status.
Referenced by _alpm_db_get_pkgcache(), and _alpm_db_get_pkgfromcache().
alpm_pkg_t* _alpm_db_get_pkgfromcache | ( | alpm_db_t * | db, |
const char * | target | ||
) |
Definition at line 595 of file db.c.
References _alpm_db_get_pkgcache_hash(), and _alpm_pkghash_find().
Referenced by _alpm_check_diskspace(), _alpm_db_find_fileconflicts(), _alpm_resolvedeps(), _alpm_sync_prepare(), alpm_add_pkg(), alpm_db_get_pkg(), alpm_sync_newversion(), and alpm_sync_sysupgrade().
alpm_db_t* _alpm_db_new | ( | const char * | treename, |
int | is_local | ||
) |
Definition at line 321 of file db.c.
References CALLOC, DB_STATUS_LOCAL, __alpm_db_t::status, STRDUP, and __alpm_db_t::treename.
Referenced by _alpm_db_register_local(), and _alpm_db_register_sync().
const char* _alpm_db_path | ( | alpm_db_t * | db | ) |
Definition at line 349 of file db.c.
References _, _alpm_log(), __alpm_db_t::_path, ALPM_ERR_DB_OPEN, ALPM_ERR_MEMORY, ALPM_LOG_DEBUG, ALPM_LOG_ERROR, CALLOC, DB_STATUS_LOCAL, __alpm_handle_t::dbpath, dbpath, __alpm_db_t::handle, RET_ERR, __alpm_db_t::status, and __alpm_db_t::treename.
Referenced by _alpm_local_db_pkgpath(), alpm_db_check_pgp_signature(), and alpm_db_update().
int _alpm_db_remove_pkgfromcache | ( | alpm_db_t * | db, |
alpm_pkg_t * | pkg | ||
) |
Definition at line 569 of file db.c.
References _alpm_log(), _alpm_pkg_free(), _alpm_pkghash_remove(), ALPM_LOG_DEBUG, DB_STATUS_PKGCACHE, __alpm_db_t::handle, __alpm_pkg_t::name, __alpm_db_t::pkgcache, __alpm_db_t::status, and __alpm_db_t::treename.
Referenced by _alpm_remove_single_package().
alpm_list_t* _alpm_db_search | ( | alpm_db_t * | db, |
const alpm_list_t * | needles | ||
) |
Definition at line 387 of file db.c.
References _alpm_db_get_pkgcache(), _alpm_log(), ALPM_ERR_INVALID_REGEX, alpm_list_add(), alpm_list_copy(), alpm_list_free(), ALPM_LOG_DEBUG, alpm_pkg_get_desc(), alpm_pkg_get_groups(), alpm_pkg_get_provides(), __alpm_list_t::data, __alpm_db_t::handle, __alpm_pkg_t::name, _alpm_depend_t::name, __alpm_list_t::next, and RET_ERR.
Referenced by alpm_db_search().