From 4fcda862a4f5e4dbcaaa3fef3b390d65b01a9638 Mon Sep 17 00:00:00 2001 From: William Pitcock Date: Fri, 9 Sep 2016 14:34:38 -0500 Subject: [PATCH] pkg: make fuzzy Provides matching for PKG_CMP_NOT_EQUAL ops more correct --- libpkgconf/pkg.c | 8 ++++---- tests/run.sh.in | 14 +++++++------- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/libpkgconf/pkg.c b/libpkgconf/pkg.c index 504e8ef..00b1492 100644 --- a/libpkgconf/pkg.c +++ b/libpkgconf/pkg.c @@ -988,10 +988,10 @@ static const pkgconf_pkg_provides_vermatch_rule_t pkgconf_pkg_provides_vermatch_ .depcmp = pkgconf_pkg_comparator_ne, .rulecmp = { [PKGCONF_CMP_ANY] = pkgconf_pkg_comparator_none, - [PKGCONF_CMP_LESS_THAN] = pkgconf_pkg_comparator_ne, - [PKGCONF_CMP_GREATER_THAN] = pkgconf_pkg_comparator_ne, - [PKGCONF_CMP_LESS_THAN_EQUAL] = pkgconf_pkg_comparator_ne, - [PKGCONF_CMP_GREATER_THAN_EQUAL] = pkgconf_pkg_comparator_ne, + [PKGCONF_CMP_LESS_THAN] = pkgconf_pkg_comparator_gte, + [PKGCONF_CMP_GREATER_THAN] = pkgconf_pkg_comparator_lte, + [PKGCONF_CMP_LESS_THAN_EQUAL] = pkgconf_pkg_comparator_gt, + [PKGCONF_CMP_GREATER_THAN_EQUAL] = pkgconf_pkg_comparator_lt, [PKGCONF_CMP_EQUAL] = pkgconf_pkg_comparator_ne, [PKGCONF_CMP_NOT_EQUAL] = pkgconf_pkg_comparator_eq } diff --git a/tests/run.sh.in b/tests/run.sh.in index aeb9344..d3c0821 100644 --- a/tests/run.sh.in +++ b/tests/run.sh.in @@ -326,9 +326,9 @@ run_test "PKG_CONFIG_PATH='${selfdir}/lib1' ${1} --libs 'provides-test-bar >= 1. run_test "PKG_CONFIG_PATH='${selfdir}/lib1' ${1} --libs 'provides-test-bar <= 1.1.1'; echo \$?" \ "0" run_test "PKG_CONFIG_PATH='${selfdir}/lib1' ${1} --libs 'provides-test-bar != 1.1.0'; echo \$?" \ - "1" -run_test "PKG_CONFIG_PATH='${selfdir}/lib1' ${1} --libs 'provides-test-bar != 1.1.1'; echo \$?" \ "0" +run_test "PKG_CONFIG_PATH='${selfdir}/lib1' ${1} --libs 'provides-test-bar != 1.1.1'; echo \$?" \ + "1" run_test "PKG_CONFIG_PATH='${selfdir}/lib1' ${1} --libs 'provides-test-bar > 1.1.1'; echo \$?" \ "0" run_test "PKG_CONFIG_PATH='${selfdir}/lib1' ${1} --libs 'provides-test-bar <= 1.1.0'; echo \$?" \ @@ -374,11 +374,11 @@ run_test "PKG_CONFIG_PATH='${selfdir}/lib1' ${1} --libs 'provides-test-quux <= 1 run_test "PKG_CONFIG_PATH='${selfdir}/lib1' ${1} --libs 'provides-test-quux <= 1.1.9'; echo \$?" \ "0" run_test "PKG_CONFIG_PATH='${selfdir}/lib1' ${1} --libs 'provides-test-quux != 1.2.0'; echo \$?" \ - "1" + "0" run_test "PKG_CONFIG_PATH='${selfdir}/lib1' ${1} --libs 'provides-test-quux != 1.1.0'; echo \$?" \ - "0" + "1" run_test "PKG_CONFIG_PATH='${selfdir}/lib1' ${1} --libs 'provides-test-quux != 1.0.0'; echo \$?" \ - "0" + "1" run_test "PKG_CONFIG_PATH='${selfdir}/lib1' ${1} --libs 'provides-test-quux > 1.1.9'; echo \$?" \ "0" run_test "PKG_CONFIG_PATH='${selfdir}/lib1' ${1} --libs 'provides-test-quux > 1.2.0'; echo \$?" \ @@ -402,9 +402,9 @@ run_test "PKG_CONFIG_PATH='${selfdir}/lib1' ${1} --libs 'provides-test-moo >= 1. run_test "PKG_CONFIG_PATH='${selfdir}/lib1' ${1} --libs 'provides-test-moo <= 1.2.0'; echo \$?" \ "0" run_test "PKG_CONFIG_PATH='${selfdir}/lib1' ${1} --libs 'provides-test-moo != 1.1.0'; echo \$?" \ - "0" + "1" run_test "PKG_CONFIG_PATH='${selfdir}/lib1' ${1} --libs 'provides-test-moo != 1.0.0'; echo \$?" \ - "0" + "1" run_test "PKG_CONFIG_PATH='${selfdir}/lib1' ${1} --libs 'provides-test-moo > 1.1.9'; echo \$?" \ "0" run_test "PKG_CONFIG_PATH='${selfdir}/lib1' ${1} --libs 'provides-test-moo > 1.2.0'; echo \$?" \