diff --git a/include/xbps_api.h b/include/xbps_api.h index 5d8c67fe..0be3d9a8 100644 --- a/include/xbps_api.h +++ b/include/xbps_api.h @@ -56,7 +56,7 @@ */ #define XBPS_PKGINDEX_VERSION "1.4" -#define XBPS_API_VERSION "20120412" +#define XBPS_API_VERSION "20120506" #define XBPS_VERSION "0.16" /** diff --git a/lib/transaction_commit.c b/lib/transaction_commit.c index aa985491..d9412c61 100644 --- a/lib/transaction_commit.c +++ b/lib/transaction_commit.c @@ -111,7 +111,7 @@ download_binpkgs(struct xbps_handle *xhp, prop_object_iterator_t iter) { prop_object_t obj; const char *pkgver, *repoloc, *filen, *trans; - const char *pkgname, *version; + const char *pkgname, *version, *fetchstr; char *binfile; int rv = 0; @@ -163,11 +163,13 @@ download_binpkgs(struct xbps_handle *xhp, prop_object_iterator_t iter) */ rv = xbps_fetch_file(binfile, xhp->cachedir, false, NULL); if (rv == -1) { + fetchstr = xbps_fetch_error_string(); xbps_set_cb_state(XBPS_STATE_DOWNLOAD_FAIL, - errno, pkgname, version, + fetchLastErrCode != 0 ? fetchLastErrCode : errno, + pkgname, version, "%s: [trans] failed to download binary package " "`%s' from `%s': %s", pkgver, filen, repoloc, - strerror(errno)); + fetchstr ? fetchstr : strerror(errno)); free(binfile); break; }