From 78203c1735add824a1fa613614703d0ae828d072 Mon Sep 17 00:00:00 2001 From: Enno Boland Date: Tue, 23 Sep 2014 19:14:45 +0200 Subject: [PATCH] bin/xbps-rindex: fix adding packages with reverts. --- bin/xbps-rindex/index-add.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/bin/xbps-rindex/index-add.c b/bin/xbps-rindex/index-add.c index ae54fd2c..e8955a81 100644 --- a/bin/xbps-rindex/index-add.c +++ b/bin/xbps-rindex/index-add.c @@ -119,17 +119,17 @@ index_add(struct xbps_handle *xhp, int argc, char **argv, bool force) ret = xbps_cmpver(pkgver, opkgver); /* - * If the current package reverts the package in the index, consider - * the current package as the newer one. + * If the considered package reverts the package in the index, + * consider the current package as the newer one. */ - if(ret < 0 && xbps_pkg_reverts(curpkgd, pkgver)) { + if(ret < 0 && xbps_pkg_reverts(binpkgd, opkgver)) { ret = 1; } /* - * If package in the index reverts current package, consider the + * If package in the index reverts considered package, consider the * package in the index as the newer one. */ - else if (ret < 0 && xbps_pkg_reverts(binpkgd, opkgver)) { + else if (ret > 0 && xbps_pkg_reverts(curpkgd, pkgver)) { ret = -1; }