From b6f89f03afcb6e1e6aa5d1c437db1df54a4baaca Mon Sep 17 00:00:00 2001 From: Travis Willard Date: Sun, 26 Aug 2007 22:42:17 -0400 Subject: separate local from sync dbs on filesystem Introduce two new methods into the API - alpm_db_register_sync and alpm_db_register_local, which replace the functionality of alpm_db_register. db_register_local always returns the local DB, and db_register_sync will always try to register a sync DB. This conceptually separates the local DB from sync DBs in the code. Also updated the pacman frontend to use the new functions. In addition, this changes the location of all sync DBs in the filesystem from $DBPATH/$REPO to $DBPATH/sync/$REPO, This removes the silly limitation that a sync DB couldn't be named 'local', along with structurally separating sync DBs and the local DB in the filesystem. Signed-off-by: Travis Willard Signed-off-by: Dan McGee --- src/pacman/pacman.c | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) (limited to 'src') diff --git a/src/pacman/pacman.c b/src/pacman/pacman.c index fef6d38e..f62e588b 100644 --- a/src/pacman/pacman.c +++ b/src/pacman/pacman.c @@ -495,15 +495,9 @@ static int _parseconfig(const char *file, const char *givensection, file, linenum); return(1); } - /* a section/database named local is not allowed */ - if(!strcmp(section, "local")) { - pm_printf(PM_LOG_ERROR, _("config file %s, line %d: 'local' cannot be used as section name.\n"), - file, linenum); - return(1); - } /* if we are not looking at the options section, register a db */ if(strcmp(section, "options") != 0) { - db = alpm_db_register(section); + db = alpm_db_register_sync(section); } } else { /* directive */ @@ -815,7 +809,7 @@ int main(int argc, char *argv[]) } /* Opening local database */ - db_local = alpm_db_register("local"); + db_local = alpm_db_register_local(); if(db_local == NULL) { pm_printf(PM_LOG_ERROR, _("could not register 'local' database (%s)\n"), alpm_strerror(pm_errno)); -- cgit v1.2.3-70-g09d2