From f671147282e0f5c6a2e05c8cb7a0d5b72ef8cb61 Mon Sep 17 00:00:00 2001 From: Xavier Chantry Date: Mon, 12 May 2008 18:56:14 -0500 Subject: Fix rewinddir regression by cleaning up db_scan Commit 046003844739416ff6d168dd2dec76490adb0727 caused a regression when rereading the pkgcache after updating the on-disk databases. A rewinddir call was errantly removed. Instead of replacing the call to rewindir, clean up this whole mess. db_scan is used only once and with target == NULL so there was actually half the code of db_scan which was unused. This is gone now and replaced by a single new db_populate function. Dan: add_sorted ended up being 3x slower than one msort at the end, so I changed back to that. I also made one pointer variable const and merged this whole patch with my original fix for the rewinddir issue. Signed-off-by: Xavier Chantry Signed-off-by: Dan McGee --- lib/libalpm/db.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib/libalpm/db.h') diff --git a/lib/libalpm/db.h b/lib/libalpm/db.h index d500953c..eb0af1ae 100644 --- a/lib/libalpm/db.h +++ b/lib/libalpm/db.h @@ -58,7 +58,7 @@ pmdb_t *_alpm_db_register_sync(const char *treename); /* be.c, backend specific calls */ int _alpm_db_open(pmdb_t *db); void _alpm_db_close(pmdb_t *db); -pmpkg_t *_alpm_db_scan(pmdb_t *db, const char *target); +int _alpm_db_populate(pmdb_t *db); int _alpm_db_read(pmdb_t *db, pmpkg_t *info, pmdbinfrq_t inforeq); int _alpm_db_write(pmdb_t *db, pmpkg_t *info, pmdbinfrq_t inforeq); int _alpm_db_remove(pmdb_t *db, pmpkg_t *info); -- cgit v1.2.3-24-g4f1b