From 8a992372ed5251f4c3fac065776ab027a5bd770e Mon Sep 17 00:00:00 2001 From: Enno Boland Date: Mon, 11 Aug 2014 20:01:24 +0200 Subject: [PATCH] lib/repo_sync.c: use xbps_fetch_delta instead of xbps_fetch_file --- lib/repo_sync.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/lib/repo_sync.c b/lib/repo_sync.c index 171d1aa7..e334818e 100644 --- a/lib/repo_sync.c +++ b/lib/repo_sync.c @@ -75,7 +75,7 @@ int HIDDEN xbps_repo_sync(struct xbps_handle *xhp, const char *uri) { const char *arch, *fetchstr = NULL; - char *repodata, *lrepodir, *uri_fixedp; + char *repodata, *repofile, *lrepodir, *uri_fixedp; int rv = 0; assert(uri != NULL); @@ -124,14 +124,15 @@ xbps_repo_sync(struct xbps_handle *xhp, const char *uri) /* * Remote repository plist index full URL. */ - repodata = xbps_xasprintf("%s/%s-repodata", uri, arch); + repofile = xbps_xasprintf("%s-repodata", arch); + repodata = xbps_xasprintf("%s/%s", uri, repofile); /* reposync start cb */ xbps_set_cb_state(xhp, XBPS_STATE_REPOSYNC, 0, repodata, NULL); /* * Download plist index file from repository. */ - if ((rv = xbps_fetch_file(xhp, repodata, NULL)) == -1) { + if ((rv = xbps_fetch_delta(xhp, repofile, repodata, repofile, NULL)) == -1) { /* reposync error cb */ fetchstr = xbps_fetch_error_string(); xbps_set_cb_state(xhp, XBPS_STATE_REPOSYNC_FAIL, @@ -142,6 +143,7 @@ xbps_repo_sync(struct xbps_handle *xhp, const char *uri) rv = 0; free(repodata); + free(repofile); return rv; }