From f1ad8a95de5d3476f0047794cf8da8f844508e30 Mon Sep 17 00:00:00 2001 From: Juan RP Date: Sat, 30 Jun 2012 11:10:00 +0200 Subject: [PATCH] xbps-repo: fixed issue 24 (xbps-src make-repoidx is doing something wrong). --- NEWS | 8 +++++++- bin/xbps-repo/index.c | 10 ++++++---- include/xbps_api.h | 2 +- 3 files changed, 14 insertions(+), 6 deletions(-) diff --git a/NEWS b/NEWS index 2571471f..4de1af51 100644 --- a/NEWS +++ b/NEWS @@ -1,4 +1,10 @@ -xbps-0.16 (???): +xbps-0.16.1 (2012-06-30): + + * xbps-repo(8): fixed a regression in the 'genindex' target. It was looking + at wrong repository subdirectory when removing obsolete files. + This also fixes issue 24 from googlecode. + +xbps-0.16 (2012-06-20): * Added support for package conflicts. If any conflicting pkg has been found in a transaction, xbps_transaction_prepare() will return EAGAIN and diff --git a/bin/xbps-repo/index.c b/bin/xbps-repo/index.c index 126bbbe2..427f1acd 100644 --- a/bin/xbps-repo/index.c +++ b/bin/xbps-repo/index.c @@ -131,7 +131,7 @@ repoidx_get(struct xbps_handle *xhp, const char *pkgdir) static int add_binpkg_to_index(struct xbps_handle *xhp, prop_array_t idx, - const char *filedir, + const char *repodir, const char *file) { prop_dictionary_t newpkgd, curpkgd; @@ -186,7 +186,8 @@ add_binpkg_to_index(struct xbps_handle *xhp, goto out; } else if (ret == -1) { /* idx version is greater, remove current binpkg */ - oldfilepath = xbps_xasprintf("%s/%s", filedir, filen); + oldfilepath = xbps_xasprintf("%s/%s/%s", + repodir, arch, filen); assert(oldfilepath != NULL); if (remove(oldfilepath) == -1) { rv = errno; @@ -219,7 +220,8 @@ add_binpkg_to_index(struct xbps_handle *xhp, rv = ENOMEM; goto out; } - oldfilepath = xbps_xasprintf("%s/%s", filedir, oldfilen); + oldfilepath = xbps_xasprintf("%s/%s/%s", + repodir, oldarch, oldfilen); if (oldfilepath == NULL) { rv = errno; prop_object_release(newpkgd); @@ -352,7 +354,7 @@ repo_genindex(struct xbps_handle *xhp, const char *pkgdir) rv = errno; goto out; } - rv = add_binpkg_to_index(xhp, idx, curdir, binfile); + rv = add_binpkg_to_index(xhp, idx, pkgdir, binfile); free(binfile); if (rv == EEXIST) { rv = 0; diff --git a/include/xbps_api.h b/include/xbps_api.h index c416a629..e7594e7c 100644 --- a/include/xbps_api.h +++ b/include/xbps_api.h @@ -57,7 +57,7 @@ #define XBPS_PKGINDEX_VERSION "1.5" #define XBPS_API_VERSION "20120620" -#define XBPS_VERSION "0.16" +#define XBPS_VERSION "0.16.1" /** * @def XBPS_RELVER