Git-Url: http://git.frugalware.org/gitweb/gitweb.cgi?p=pacman-g2.git;a=commitdiff;h=7c05f1a57ef81312111711524e2a652a2ddfc001
commit 7c05f1a57ef81312111711524e2a652a2ddfc001 Author: Michel Hermier <[email protected]> Date: Sat Jun 8 09:45:10 2013 +0200 pacman-g2: Do not track syncs db using a global pmc_syncs, use pacman_get_option (PM_OPT_SYNCDB, ...) instead. diff --git a/src/pacman-g2/conf.c b/src/pacman-g2/conf.c index ba9f931..e4bb031 100644 --- a/src/pacman-g2/conf.c +++ b/src/pacman-g2/conf.c @@ -34,8 +34,6 @@ #include "download.h" #include "conf.h" -extern list_t *pmc_syncs; - config_t *config_new() { config_t *config; @@ -61,9 +59,4 @@ int config_free(config_t *config) return(0); } -void cb_db_register(const char *section, PM_DB *db) -{ - pmc_syncs = list_add(pmc_syncs, db); -} - /* vim: set ts=2 sw=2 noet: */ diff --git a/src/pacman-g2/conf.h b/src/pacman-g2/conf.h index c6309f7..dc54e6c 100644 --- a/src/pacman-g2/conf.h +++ b/src/pacman-g2/conf.h @@ -71,7 +71,6 @@ typedef struct __config_t { config_t *config_new(void); int config_free(config_t *config); -void cb_db_register(const char *section, PM_DB *db); #endif /* _PM_CONF_H */ diff --git a/src/pacman-g2/pacman-g2.c b/src/pacman-g2/pacman-g2.c index d7223a0..0141784 100644 --- a/src/pacman-g2/pacman-g2.c +++ b/src/pacman-g2/pacman-g2.c @@ -80,8 +80,6 @@ enum { config_t *config = NULL; PM_DB *db_local; -/* list of (PM_DB *) structs for sync locations */ -list_t *pmc_syncs = NULL; /* list of targets specified on command line */ list_t *pm_targets = NULL; @@ -202,7 +200,6 @@ static void cleanup(int exitcode) } /* free memory */ - FREELISTPTR(pmc_syncs); FREELIST(pm_targets); FREECONF(config); @@ -561,7 +558,7 @@ int main(int argc, char *argv[]) if(config->configfile == NULL) { config->configfile = strdup(PACCONF); } - if(pacman_parse_config(config->configfile, cb_db_register, "") != 0) { + if(pacman_parse_config(config->configfile, NULL, "") != 0) { ERR(NL, _("failed to parse config (%s)\n"), pacman_strerror(pm_errno)); cleanup(1); } diff --git a/src/pacman-g2/query.c b/src/pacman-g2/query.c index 2aeb7fb..3d2b5aa 100644 --- a/src/pacman-g2/query.c +++ b/src/pacman-g2/query.c @@ -39,7 +39,6 @@ extern config_t *config; extern PM_DB *db_local; -extern list_t *pmc_syncs; int querypkg(list_t *targets) { @@ -49,6 +48,9 @@ int querypkg(list_t *targets) PM_LIST *j, *ret; char *package = NULL; int done = 0, errors = 0; + PM_LIST *pmc_syncs; + + pacman_get_option (PM_OPT_SYNCDB, (long *)&pmc_syncs); if(config->op_q_search) { f_foreach (i, targets) { diff --git a/src/pacman-g2/sync.c b/src/pacman-g2/sync.c index 7886eec..ac13d91 100644 --- a/src/pacman-g2/sync.c +++ b/src/pacman-g2/sync.c @@ -55,8 +55,6 @@ extern PM_DB *db_local; extern config_t *config; -extern list_t *pmc_syncs; - static int sync_synctree(int level, list_t *syncs) { list_t *i; @@ -265,6 +263,9 @@ int syncpkg(list_t *targets) int retval = 0; list_t *i; PM_LIST *packages, *data, *lp; + PM_LIST *pmc_syncs; + + pacman_get_option (PM_OPT_SYNCDB, (long *)&pmc_syncs); if (f_ptrlist_count (pmc_syncs) == 0) { ERR(NL, _("no usable package repositories configured.\n")); _______________________________________________ Frugalware-git mailing list [email protected] http://frugalware.org/mailman/listinfo/frugalware-git
