From cb1f10d415fd91bfa069312a75d9b48211267748 Mon Sep 17 00:00:00 2001 From: Juan RP Date: Fri, 16 Oct 2009 17:04:35 +0200 Subject: [PATCH] xbps-bin: don't initialize repolist data unless we want to update. xbps_find_new_pkg: always initialize repolist data. --HG-- extra : convert_revision : xtraeme%40gmail.com-20091016150435-wpjfd453hpwr5k89 --- bin/xbps-bin/main.c | 5 ----- lib/findpkg.c | 6 ++++++ 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/bin/xbps-bin/main.c b/bin/xbps-bin/main.c index 7245e9ab..c6047691 100644 --- a/bin/xbps-bin/main.c +++ b/bin/xbps-bin/main.c @@ -130,11 +130,6 @@ main(int argc, char **argv) goto out; } } - if ((rv = xbps_prepare_repolist_data()) != 0) { - printf("Couldn't initialized repository pool data (%s)\n", - strerror(rv)); - goto out; - } if (strcasecmp(argv[0], "list") == 0) { /* Lists packages currently registered in database. */ diff --git a/lib/findpkg.c b/lib/findpkg.c index 09c85249..f43bcc9b 100644 --- a/lib/findpkg.c +++ b/lib/findpkg.c @@ -256,6 +256,12 @@ xbps_find_new_pkg(const char *pkgname, prop_dictionary_t instpkg) assert(pkgname != NULL); assert(instpkg != NULL); + /* + * Prepare dictionary with all registered repositories. + */ + if ((rv = xbps_prepare_repolist_data()) != 0) + return rv; + SIMPLEQ_FOREACH(rdata, &repodata_queue, chain) { /* * Get the package dictionary from current repository.