libalpm
Arch Linux Package Manager Library
Functions
db.c File Reference
#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"
Include dependency graph for db.c:

Go to the source code of this file.

Functions

alpm_db_talpm_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_talpm_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_talpm_db_get_pkg (alpm_db_t *db, const char *name)
 Get a package entry from a package database.
alpm_list_talpm_db_get_pkgcache (alpm_db_t *db)
 Get the package cache of a package database.
alpm_group_talpm_db_readgroup (alpm_db_t *db, const char *name)
 Get a group entry from a package database.
alpm_list_talpm_db_get_groupcache (alpm_db_t *db)
 Get the group cache of a package database.
alpm_list_talpm_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)

Function Documentation

int _alpm_db_add_pkgincache ( alpm_db_t db,
alpm_pkg_t pkg 
)
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().

Here is the caller graph for this function:

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().

Here is the call graph for this function:

Here is the caller graph for this function:

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().

Here is the call graph for this function:

Here is the caller graph for this function:

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().

Here is the caller graph for this function:

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().

Here is the call graph for this function:

Here is the caller graph for this function:

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().

Here is the call graph for this function:

Here is the caller graph for this function:

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().

Here is the caller graph for this function:

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().

Here is the call graph for this function:

Here is the caller graph for this function:

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().

Here is the caller graph for this function:

const char* _alpm_db_path ( alpm_db_t db)

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().

Here is the call graph for this function:

Here is the caller graph for this function:

alpm_list_t* _alpm_db_search ( alpm_db_t db,
const alpm_list_t needles 
)