Send patches - preferably formatted by git format-patch - to patches at archlinux32 dot org.
summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorDave Reisner <d@falconindy.com>2011-03-24 15:10:01 -0400
committerDan McGee <dan@archlinux.org>2011-03-24 17:18:24 -0500
commite68e994eb2c32c4b7ad5288f8f4b8809e1c39c9b (patch)
treea4c0ed7bf95f6b47e4f4b55af1dd28ace6161e3a /lib
parent351942c71b80adaac614ed1c353d0e8e6f49ac8b (diff)
alpm/db: do not close local DB in alpm_db_unregister_all
pacman 3.5.0 removed alpm_db_register_local, so calling alpm_db_unregister_all leaves the front end in a position where there's no local db, and no way to re-register it. Signed-off-by: Dave Reisner <d@falconindy.com> Signed-off-by: Dan McGee <dan@archlinux.org>
Diffstat (limited to 'lib')
-rw-r--r--lib/libalpm/alpm.c9
-rw-r--r--lib/libalpm/db.c8
2 files changed, 11 insertions, 6 deletions
diff --git a/lib/libalpm/alpm.c b/lib/libalpm/alpm.c
index 4f95832d..a60a4bb6 100644
--- a/lib/libalpm/alpm.c
+++ b/lib/libalpm/alpm.c
@@ -77,10 +77,19 @@ int SYMEXPORT alpm_initialize(void)
*/
int SYMEXPORT alpm_release(void)
{
+ pmdb_t *db;
+
ALPM_LOG_FUNC;
ASSERT(handle != NULL, RET_ERR(PM_ERR_HANDLE_NULL, -1));
+ /* close local database */
+ db = handle->db_local;
+ if(db) {
+ db->ops->unregister(db);
+ handle->db_local = NULL;
+ }
+
if(alpm_db_unregister_all() == -1) {
return(-1);
}
diff --git a/lib/libalpm/db.c b/lib/libalpm/db.c
index fb64faed..bf6df06e 100644
--- a/lib/libalpm/db.c
+++ b/lib/libalpm/db.c
@@ -90,12 +90,8 @@ int SYMEXPORT alpm_db_unregister_all(void)
/* Do not unregister a database if a transaction is on-going */
ASSERT(handle->trans == NULL, RET_ERR(PM_ERR_TRANS_NOT_NULL, -1));
- /* close local database */
- db = handle->db_local;
- if(db) {
- db->ops->unregister(db);
- handle->db_local = NULL;
- }
+ /* since the local DB is registered in alpm_initialize(), we'll be
+ * symmetrical and let the cleanup occur in alpm_release() */
/* and also sync ones */
for(i = handle->dbs_sync; i; i = i->next) {