Send patches - preferably formatted by git format-patch - to patches at archlinux32 dot org.
summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorJudd Vinet <judd@archlinux.org>2005-10-07 16:38:17 +0000
committerJudd Vinet <judd@archlinux.org>2005-10-07 16:38:17 +0000
commit79031ccd1a544475162facb8ca3d671f3464d1f8 (patch)
tree29a7db3b6c6ef1c74f97370c1b19b4d716a31837 /lib
parent52670048845e27f707bfb23613822090e9f78fe2 (diff)
patch from vmiklos -- properly remove each db entry instead of rmrf'ing the whole thing
Diffstat (limited to 'lib')
-rw-r--r--lib/libalpm/alpm.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/lib/libalpm/alpm.c b/lib/libalpm/alpm.c
index 7cf86922..10444fa4 100644
--- a/lib/libalpm/alpm.c
+++ b/lib/libalpm/alpm.c
@@ -254,6 +254,7 @@ void *alpm_db_getinfo(PM_DB *db, unsigned char parm)
int alpm_db_update(PM_DB *db, char *archive, char *ts)
{
struct stat buf;
+ PMList *lp;
/* Sanity checks */
ASSERT(handle != NULL, RET_ERR(PM_ERR_HANDLE_NULL, -1));
@@ -282,9 +283,9 @@ int alpm_db_update(PM_DB *db, char *archive, char *ts)
/* remove the old dir */
_alpm_log(PM_LOG_FLOW2, "removing database %s/%s", handle->dbpath, db->treename);
- /* ORE
- We should db_remove each db entry, and not rmrf the top directory */
- _alpm_rmrf(db->path);
+ for(lp = alpm_db_getpkgcache(db); lp; lp = alpm_list_next(lp)) {
+ db_remove(db, alpm_list_getdata(lp));
+ }
/* make the new dir */
if(db_create(handle->root, handle->dbpath, db->treename) != 0) {