diff --git a/bin/xbps-rindex/index-add.c b/bin/xbps-rindex/index-add.c index 5ef65ac0..ae54fd2c 100644 --- a/bin/xbps-rindex/index-add.c +++ b/bin/xbps-rindex/index-add.c @@ -122,14 +122,14 @@ index_add(struct xbps_handle *xhp, int argc, char **argv, bool force) * If the current package reverts the package in the index, consider * the current package as the newer one. */ - if(ret < 0 && xbps_pkgver_is_reverted(pkgver, curpkgd)) { + if(ret < 0 && xbps_pkg_reverts(curpkgd, pkgver)) { ret = 1; } /* * If package in the index reverts current package, consider the * package in the index as the newer one. */ - else if (ret < 0 && xbps_pkgver_is_reverted(opkgver, binpkgd)) { + else if (ret < 0 && xbps_pkg_reverts(binpkgd, opkgver)) { ret = -1; } diff --git a/include/xbps.h.in b/include/xbps.h.in index 32e0e824..d534dd1a 100644 --- a/include/xbps.h.in +++ b/include/xbps.h.in @@ -1841,12 +1841,12 @@ int xbps_humanize_number(char *buf, int64_t bytes); * The package version is defined by: * ${VERSION}_${REVISION}. * - * @param[in] pkgver a package version string * @param[in] pkg a package which is a candidate to revert pkgver. + * @param[in] pkgver a package version string * * @return 1 if pkg reverts pkgver, 0 otherwise. */ -int xbps_pkgver_is_reverted(const char *pkgver, xbps_dictionary_t pkg); +int xbps_pkg_reverts(xbps_dictionary_t pkg, const char *pkgver); /** * Compares package version strings. diff --git a/lib/transaction_ops.c b/lib/transaction_ops.c index 22211e97..63e6edf4 100644 --- a/lib/transaction_ops.c +++ b/lib/transaction_ops.c @@ -118,7 +118,7 @@ trans_find_pkg(struct xbps_handle *xhp, const char *pkg, bool reinstall) xbps_dictionary_get_cstring_nocopy(pkg_pkgdb, "pkgver", &instpkgver); if (xbps_cmpver(repopkgver, instpkgver) <= 0 && - !xbps_pkgver_is_reverted(repopkgver, pkg_repod)) { + !xbps_pkg_reverts(pkg_repod, repopkgver)) { xbps_dbg_printf(xhp, "[rpool] Skipping `%s' " "(installed: %s) from repository `%s'\n", repopkgver, instpkgver, repoloc); diff --git a/lib/util.c b/lib/util.c index 8d476f35..0732c40e 100644 --- a/lib/util.c +++ b/lib/util.c @@ -430,7 +430,7 @@ xbps_humanize_number(char *buf, int64_t bytes) * Check if pkg is explicitly marked to replace a specific installed version. */ int -xbps_pkgver_is_reverted(const char *pkgver, xbps_dictionary_t pkg) { +xbps_pkg_reverts(xbps_dictionary_t pkg, const char *pkgver) { unsigned int i; xbps_array_t reverts; const char *revertver;