Database Functions

Functions to query and manipulate the database of libalpm. More...

Functions

pmdb_talpm_db_register_sync (const char *treename)
pmdb_talpm_db_register_local (void)
int alpm_db_unregister_all (void)
int alpm_db_unregister (pmdb_t *db)
int alpm_db_setserver (pmdb_t *db, const char *url)
int alpm_db_update (int force, pmdb_t *db)
const char * alpm_db_get_name (const pmdb_t *db)
const char * alpm_db_get_url (const pmdb_t *db)
pmpkg_talpm_db_get_pkg (pmdb_t *db, const char *name)
alpm_list_talpm_db_getpkgcache (pmdb_t *db)
alpm_list_talpm_db_whatprovides (pmdb_t *db, const char *name)
pmgrp_talpm_db_readgrp (pmdb_t *db, const char *name)
alpm_list_talpm_db_getgrpcache (pmdb_t *db)
alpm_list_talpm_db_search (pmdb_t *db, const alpm_list_t *needles)

Detailed Description

Functions to query and manipulate the database of libalpm.


Function Documentation

const char* alpm_db_get_name ( const pmdb_t db  ) 

Get the name of a package database

Parameters:
db pointer to the package database
Returns:
the name of the package database, NULL on error

Definition at line 305 of file db.c.

References ALPM_LOG_FUNC, ASSERT, handle, and __pmdb_t::treename.

Referenced by _alpm_pkg_compare_versions(), and alpm_pkg_changelog_open().

Here is the caller graph for this function:

pmpkg_t* alpm_db_get_pkg ( pmdb_t db,
const char *  name 
)

Get a package entry from a package database

Parameters:
db pointer to the package database to get the package from
name of the package
Returns:
the package entry on success, NULL on error

Definition at line 343 of file db.c.

References _alpm_db_get_pkgfromcache(), ALPM_LOG_FUNC, ASSERT, and handle.

Referenced by pacman_deptest(), and pacman_query().

Here is the call graph for this function:

Here is the caller graph for this function:

const char* alpm_db_get_url ( const pmdb_t db  ) 

Get a download URL for the package database

Parameters:
db pointer to the package database
Returns:
a fully-specified download URL, NULL on error

Definition at line 320 of file db.c.

References ALPM_LOG_FUNC, ASSERT, __alpm_list_t::data, handle, __pmserver_t::s_url, and __pmdb_t::servers.

Referenced by _alpm_sync_commit().

Here is the caller graph for this function:

alpm_list_t* alpm_db_getgrpcache ( pmdb_t db  ) 

Get the group cache of a package database

Parameters:
db pointer to the package database to get the group from
Returns:
the list of groups on success, NULL on error

Definition at line 408 of file db.c.

References _alpm_db_get_grpcache(), ALPM_LOG_FUNC, ASSERT, and handle.

Here is the call graph for this function:

alpm_list_t* alpm_db_getpkgcache ( pmdb_t db  ) 

Get the package cache of a package database

Parameters:
db pointer to the package database to get the package from
Returns:
the list of packages on success, NULL on error

Definition at line 359 of file db.c.

References _alpm_db_get_pkgcache(), ALPM_LOG_FUNC, ASSERT, and handle.

Referenced by main(), and pacman_query().

Here is the call graph for this function:

Here is the caller graph for this function:

pmgrp_t* alpm_db_readgrp ( pmdb_t db,
const char *  name 
)

Get a group entry from a package database

Parameters:
db pointer to the package database to get the group from
name of the group
Returns:
the groups entry on success, NULL on error

Definition at line 392 of file db.c.

References _alpm_db_get_grpfromcache(), ALPM_LOG_FUNC, ASSERT, and handle.

Referenced by pacman_remove().

Here is the call graph for this function:

Here is the caller graph for this function:

pmdb_t* alpm_db_register_local ( void   ) 

Register the local package database.

Returns:
a pmdb_t* representing the local database, or NULL on error

Definition at line 73 of file db.c.

References _alpm_db_register_local(), ALPM_LOG_FUNC, ASSERT, handle, PM_ERR_HANDLE_NULL, PM_ERR_TRANS_NOT_NULL, RET_ERR, and _pmhandle_t::trans.

Referenced by main().

Here is the call graph for this function:

Here is the caller graph for this function:

pmdb_t* alpm_db_register_sync ( const char *  treename  ) 

Register a sync database of packages.

Parameters:
treename the name of the sync repository
Returns:
a pmdb_t* on success (the value), NULL on error

Definition at line 57 of file db.c.

References _alpm_db_register_sync(), ALPM_LOG_FUNC, ASSERT, handle, PM_ERR_HANDLE_NULL, PM_ERR_TRANS_NOT_NULL, PM_ERR_WRONG_ARGS, RET_ERR, and _pmhandle_t::trans.

Here is the call graph for this function:

alpm_list_t* alpm_db_search ( pmdb_t db,
const alpm_list_t needles 
)

Searches a database

Parameters:
db pointer to the package database to search in
needles the list of strings to search for
Returns:
the list of packages on success, NULL on error

Definition at line 424 of file db.c.

References _alpm_db_search(), ALPM_LOG_FUNC, ASSERT, and handle.

Here is the call graph for this function:

int alpm_db_setserver ( pmdb_t db,
const char *  url 
)

Set the serverlist of a database.

Parameters:
db database pointer
url url of the server
Returns:
0 on success, -1 on error (pm_errno is set accordingly)

Definition at line 172 of file db.c.

References _alpm_log(), _alpm_server_new(), alpm_list_add(), ALPM_LOG_FUNC, ASSERT, __alpm_list_t::data, _pmhandle_t::dbs_sync, FREELIST, handle, __alpm_list_t::next, PM_ERR_DB_NOT_FOUND, PM_ERR_DB_NULL, PM_LOG_DEBUG, RET_ERR, __pmserver_t::s_url, __pmdb_t::servers, and __pmdb_t::treename.

Here is the call graph for this function:

int alpm_db_unregister ( pmdb_t db  ) 

Unregister a package database

Parameters:
db pointer to the package database to unregister
Returns:
0 on success, -1 on error (pm_errno is set accordingly)

Definition at line 131 of file db.c.

References _alpm_db_cmp(), alpm_list_remove(), ALPM_LOG_FUNC, ASSERT, _pmhandle_t::db_local, _pmhandle_t::dbs_sync, handle, PM_ERR_DB_NOT_FOUND, PM_ERR_HANDLE_NULL, PM_ERR_TRANS_NOT_NULL, PM_ERR_WRONG_ARGS, RET_ERR, and _pmhandle_t::trans.

Here is the call graph for this function:

int alpm_db_unregister_all ( void   ) 

Unregister all package databases

Returns:
0 on success, -1 on error (pm_errno is set accordingly)

Definition at line 102 of file db.c.

References ALPM_LOG_FUNC, ASSERT, __alpm_list_t::data, _pmhandle_t::db_local, _pmhandle_t::dbs_sync, FREELIST, handle, __alpm_list_t::next, PM_ERR_HANDLE_NULL, PM_ERR_TRANS_NOT_NULL, RET_ERR, and _pmhandle_t::trans.

Referenced by alpm_release().

Here is the caller graph for this function:

int alpm_db_update ( int  force,
pmdb_t db 
)

Update a package database

Parameters:
force if true, then forces the update, otherwise update only in case the database isn't up to date
db pointer to the package database to update
Returns:
0 on success, > 0 on error (pm_errno is set accordingly), < 0 if up to date

Definition at line 216 of file db.c.

References _, _alpm_db_free_pkgcache(), _alpm_db_get_pkgcache(), _alpm_db_getlastupdate(), _alpm_db_install(), _alpm_db_remove(), _alpm_db_setlastupdate(), _alpm_downloadfiles_forreal(), _alpm_log(), alpm_list_add(), alpm_list_find_ptr(), ALPM_LOG_FUNC, alpm_option_get_dbpath(), alpm_pkg_get_name(), ASSERT, __alpm_list_t::data, _pmhandle_t::db_local, _pmhandle_t::dbs_sync, FREELIST, handle, __alpm_list_t::next, __pmdb_t::path, PM_ERR_DB_NOT_FOUND, PM_ERR_DB_REMOVE, PM_ERR_DB_SYNC, PM_ERR_HANDLE_NULL, PM_ERR_TRANS_NOT_INITIALIZED, PM_ERR_TRANS_NULL, PM_ERR_TRANS_TYPE, PM_ERR_WRONG_ARGS, pm_errno, PM_LOG_DEBUG, PM_LOG_ERROR, PM_TRANS_TYPE_SYNC, RET_ERR, __pmdb_t::servers, __pmtrans_t::state, STATE_INITIALIZED, _pmhandle_t::trans, __pmdb_t::treename, and __pmtrans_t::type.

Here is the call graph for this function:

alpm_list_t* alpm_db_whatprovides ( pmdb_t db,
const char *  name 
)

Get the list of packages that a package provides

Parameters:
db pointer to the package database to get the package from
name name of the package
Returns:
the list of packages on success, NULL on error

Definition at line 375 of file db.c.

References _alpm_db_whatprovides(), ALPM_LOG_FUNC, ASSERT, and handle.

Referenced by pacman_deptest().

Here is the call graph for this function:

Here is the caller graph for this function:


Generated on Tue Jan 15 00:02:24 2008 for libalpm by  doxygen 1.5.4