From 72883e3bcbc1ff2d46667fceb48c3c2c682cfe79 Mon Sep 17 00:00:00 2001 From: Dan McGee Date: Mon, 14 Sep 2009 22:44:51 -0500 Subject: Fully implement database lazy loading Commit 34e1413d75 attempted to implement lazy loading of package databases. Although it took care of my main complaint (creating the database directory if it didn't exist), it didn't allow sync repos to be registered before alpm_option_set_dbpath() had been called. With this patch, we no longer compute the individual repository DB paths until necessary, allowing full lazy loading to work as intended, and allowing us to drop the extra setlibpath() calls from the frontend. This allows the changes introduced in a2cd48960 (but later reverted) to be added back in again. Signed-off-by: Dan McGee --- src/pacman/pacman.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) (limited to 'src') diff --git a/src/pacman/pacman.c b/src/pacman/pacman.c index 2a228ed9..ac515029 100644 --- a/src/pacman/pacman.c +++ b/src/pacman/pacman.c @@ -758,11 +758,8 @@ static int _parseconfig(const char *file, const char *givensection, ret = 1; goto cleanup; } - /* if we are not looking at the options section, register a db and also - * ensure we have set all of our library paths as the library is too stupid - * at the moment to do lazy opening of the databases */ + /* if we are not looking at the options section, register a db */ if(strcmp(section, "options") != 0) { - setlibpaths(); db = alpm_db_register_sync(section); if(db == NULL) { pm_printf(PM_LOG_ERROR, _("could not register '%s' database (%s)\n"), -- cgit v1.2.3-70-g09d2