xbps-repo: fixed issue 24 (xbps-src make-repoidx is doing something wrong).

This commit is contained in:
Juan RP 2012-06-30 11:10:00 +02:00
parent 54bc92bd97
commit f1ad8a95de
3 changed files with 14 additions and 6 deletions

8
NEWS
View File

@ -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

View File

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

View File

@ -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