diff options
Diffstat (limited to 'lib/libalpm/db.c')
-rw-r--r-- | lib/libalpm/db.c | 42 |
1 files changed, 7 insertions, 35 deletions
diff --git a/lib/libalpm/db.c b/lib/libalpm/db.c index 8688a3cd..1f252abb 100644 --- a/lib/libalpm/db.c +++ b/lib/libalpm/db.c @@ -1,7 +1,7 @@ /* * db.c * - * Copyright (c) 2006-2011 Pacman Development Team <pacman-dev@archlinux.org> + * Copyright (c) 2006-2012 Pacman Development Team <pacman-dev@archlinux.org> * Copyright (c) 2002-2006 by Judd Vinet <jvinet@zeroflux.org> * Copyright (c) 2005 by Aurelien Foret <orelien@chez.com> * Copyright (c) 2005 by Christian Hamar <krics@linuxforum.hu> @@ -22,8 +22,6 @@ * along with this program. If not, see <http://www.gnu.org/licenses/>. */ -#include "config.h" - #include <stdio.h> #include <stdlib.h> #include <string.h> @@ -45,7 +43,7 @@ */ /** Register a sync database of packages. */ -alpm_db_t SYMEXPORT *alpm_db_register_sync(alpm_handle_t *handle, +alpm_db_t SYMEXPORT *alpm_register_syncdb(alpm_handle_t *handle, const char *treename, alpm_siglevel_t level) { /* Sanity checks */ @@ -70,7 +68,7 @@ void _alpm_db_unregister(alpm_db_t *db) } /** Unregister all package databases. */ -int SYMEXPORT alpm_db_unregister_all(alpm_handle_t *handle) +int SYMEXPORT alpm_unregister_all_syncdbs(alpm_handle_t *handle) { alpm_list_t *i; alpm_db_t *db; @@ -109,7 +107,7 @@ int SYMEXPORT alpm_db_unregister(alpm_db_t *db) } else { /* Warning : this function shouldn't be used to unregister all sync * databases by walking through the list returned by - * alpm_option_get_syncdbs, because the db is removed from that list here. + * alpm_get_syncdbs, because the db is removed from that list here. */ void *data; handle->dbs_sync = alpm_list_remove(handle->dbs_sync, @@ -138,7 +136,7 @@ alpm_list_t SYMEXPORT *alpm_db_get_servers(const alpm_db_t *db) int SYMEXPORT alpm_db_set_servers(alpm_db_t *db, alpm_list_t *servers) { ASSERT(db != NULL, return -1); - if(db->servers) FREELIST(db->servers); + FREELIST(db->servers); db->servers = servers; return 0; } @@ -263,7 +261,7 @@ alpm_list_t SYMEXPORT *alpm_db_get_pkgcache(alpm_db_t *db) } /** Get a group entry from a package database. */ -alpm_group_t SYMEXPORT *alpm_db_readgroup(alpm_db_t *db, const char *name) +alpm_group_t SYMEXPORT *alpm_db_get_group(alpm_db_t *db, const char *name) { ASSERT(db != NULL, return NULL); db->handle->pm_errno = 0; @@ -283,7 +281,7 @@ alpm_list_t SYMEXPORT *alpm_db_get_groupcache(alpm_db_t *db) } /** Searches a database. */ -alpm_list_t SYMEXPORT *alpm_db_search(alpm_db_t *db, const alpm_list_t* needles) +alpm_list_t SYMEXPORT *alpm_db_search(alpm_db_t *db, const alpm_list_t *needles) { ASSERT(db != NULL, return NULL); db->handle->pm_errno = 0; @@ -291,32 +289,6 @@ alpm_list_t SYMEXPORT *alpm_db_search(alpm_db_t *db, const alpm_list_t* needles) return _alpm_db_search(db, needles); } -/** Set install reason for a package in db. */ -int SYMEXPORT alpm_db_set_pkgreason(alpm_handle_t *handle, alpm_pkg_t *pkg, - alpm_pkgreason_t reason) -{ - CHECK_HANDLE(handle, return -1); - ASSERT(pkg != NULL, RET_ERR(handle, ALPM_ERR_WRONG_ARGS, -1)); - ASSERT(pkg->origin == PKG_FROM_LOCALDB, - RET_ERR(handle, ALPM_ERR_WRONG_ARGS, -1)); - ASSERT(pkg->origin_data.db == handle->db_local, - RET_ERR(handle, ALPM_ERR_WRONG_ARGS, -1)); - - _alpm_log(handle, ALPM_LOG_DEBUG, - "setting install reason %u for %s\n", reason, pkg->name); - if(alpm_pkg_get_reason(pkg) == reason) { - /* we are done */ - return 0; - } - /* set reason (in pkgcache) */ - pkg->reason = reason; - /* write DESC */ - if(_alpm_local_db_write(handle->db_local, pkg, INFRQ_DESC)) { - RET_ERR(handle, ALPM_ERR_DB_WRITE, -1); - } - - return 0; -} /** @} */ |