mirror of
https://github.com/moparisthebest/pacman
synced 2024-08-13 17:03:46 -04:00
patch from vmiklos -- properly remove each db entry instead of rmrf'ing the whole thing
This commit is contained in:
parent
5267004884
commit
79031ccd1a
@ -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)
|
int alpm_db_update(PM_DB *db, char *archive, char *ts)
|
||||||
{
|
{
|
||||||
struct stat buf;
|
struct stat buf;
|
||||||
|
PMList *lp;
|
||||||
|
|
||||||
/* Sanity checks */
|
/* Sanity checks */
|
||||||
ASSERT(handle != NULL, RET_ERR(PM_ERR_HANDLE_NULL, -1));
|
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 */
|
/* remove the old dir */
|
||||||
_alpm_log(PM_LOG_FLOW2, "removing database %s/%s", handle->dbpath, db->treename);
|
_alpm_log(PM_LOG_FLOW2, "removing database %s/%s", handle->dbpath, db->treename);
|
||||||
/* ORE
|
for(lp = alpm_db_getpkgcache(db); lp; lp = alpm_list_next(lp)) {
|
||||||
We should db_remove each db entry, and not rmrf the top directory */
|
db_remove(db, alpm_list_getdata(lp));
|
||||||
_alpm_rmrf(db->path);
|
}
|
||||||
|
|
||||||
/* make the new dir */
|
/* make the new dir */
|
||||||
if(db_create(handle->root, handle->dbpath, db->treename) != 0) {
|
if(db_create(handle->root, handle->dbpath, db->treename) != 0) {
|
||||||
|
Loading…
Reference in New Issue
Block a user