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; }