index : pacman | |
Archlinux32 fork of pacman | gitolite user |
summaryrefslogtreecommitdiff |
-rw-r--r-- | lib/libalpm/alpm.c | 21 |
diff --git a/lib/libalpm/alpm.c b/lib/libalpm/alpm.c index 51b9e25b..4f95832d 100644 --- a/lib/libalpm/alpm.c +++ b/lib/libalpm/alpm.c @@ -1,7 +1,7 @@ /* * alpm.c * - * Copyright (c) 2006-2010 Pacman Development Team <pacman-dev@archlinux.org> + * Copyright (c) 2006-2011 Pacman Development Team <pacman-dev@archlinux.org> * Copyright (c) 2002-2006 by Judd Vinet <jvinet@zeroflux.org> * Copyright (c) 2005 by Aurelien Foret <orelien@chez.com> * Copyright (c) 2005 by Christian Hamar <krics@linuxforum.hu> @@ -23,6 +23,11 @@ #include "config.h" +/* connection caching setup */ +#ifdef HAVE_LIBFETCH +#include <fetch.h> +#endif + /* libalpm */ #include "alpm.h" #include "alpm_list.h" @@ -49,11 +54,21 @@ int SYMEXPORT alpm_initialize(void) if(handle == NULL) { RET_ERR(PM_ERR_MEMORY, -1); } + if(_alpm_db_register_local() == NULL) { + /* error code should be set */ + _alpm_handle_free(handle); + handle = NULL; + return(-1); + } #ifdef ENABLE_NLS bindtextdomain("libalpm", LOCALEDIR); #endif +#ifdef HAVE_LIBFETCH + fetchConnectionCacheInit(5, 1); +#endif + return(0); } @@ -73,6 +88,10 @@ int SYMEXPORT alpm_release(void) _alpm_handle_free(handle); handle = NULL; +#ifdef HAVE_LIBFETCH + fetchConnectionCacheClose(); +#endif + return(0); } |