From 4f80bddbb257beb6a3d4ac0c5f0695612c21ac0e Mon Sep 17 00:00:00 2001 From: Juan RP Date: Sun, 22 Nov 2009 07:04:46 +0100 Subject: [PATCH] xbps-repo: print error if pkg-index file cannot be fetched. --HG-- extra : convert_revision : xtraeme%40gmail.com-20091122060446-sc4na9qa2k2bk5f6 --- bin/xbps-repo/main.c | 5 ++++- lib/download.c | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/bin/xbps-repo/main.c b/bin/xbps-repo/main.c index 18b96683..be05ce91 100644 --- a/bin/xbps-repo/main.c +++ b/bin/xbps-repo/main.c @@ -147,8 +147,11 @@ add_repository(const char *uri, bool remote) printf("Fetching remote package index at %s...\n", uri); rv = xbps_sync_repository_pkg_index(idxstr); - if (rv != 0) + if (rv != 0) { + printf("Couldn't download pkg index: %s\n", + xbps_fetch_error_string()); return rv; + } plist = xbps_get_pkg_index_plist(idxstr); } else { diff --git a/lib/download.c b/lib/download.c index 30a7b3fc..1de03008 100644 --- a/lib/download.c +++ b/lib/download.c @@ -297,7 +297,7 @@ xbps_fetch_file(const char *uri, const char *outputdir, bool refetch, printf("url_stat.mtime: %s\n", print_time(&url_st.mtime)); #endif if (fio == NULL && fetchLastErrCode != FETCH_OK) { - if (restart && fetchLastErrCode == FETCH_UNAVAIL) { + if (!refetch && restart && fetchLastErrCode == FETCH_UNAVAIL) { /* * In HTTP when 416 is returned and length==0 * means that local and remote file size match.