2008-03-23 Tollef Fog Heen <tfheen@err.no>
+ * check/check-conflicts, check/conflicts-test.pc: New test,
+ testing that conflicts work as they should.
+
+ * pkg.c (verify_package): Make the conflicts check not only check
+ package versions, but also package names. This makes conflicts
+ functional, something they were not before.
+
* check/check-requires-private: Remove unnecessary set -x
* check/check-cflags, check/check-define-variable,
TESTS = check-cflags check-libs check-define-variable \
- check-libs-private check-requires-private check-includedir
+ check-libs-private check-requires-private check-includedir \
+ check-conflicts
EXTRA_DIST = $(TESTS) common simple.pc requires-test.pc public-dep.pc \
private-dep.pc includedir.pc
--- /dev/null
+#! /bin/sh
+
+# Make sure we're POSIX
+if [ "$PKG_CONFIG_SHELL_IS_POSIX" != "1" ]; then
+ PKG_CONFIG_SHELL_IS_POSIX=1 PATH=`getconf PATH` exec sh $0 "$@"
+fi
+
+set -e
+
+. ${srcdir}/common
+
+ARGS="--libs conflicts-test"
+RESULT="-L/public-dep/lib -lpublic-dep"
+
+run_test
+
--- /dev/null
+Name: Conflicts test package
+Description: Dummy pkgconfig test package for testing Conflicts
+Version: 1.0.0
+Requires: public-dep
+Conflicts: simple
+
Version: 1.0.0
Libs: -L/public-dep/lib -lpublic-dep
Cflags: -I/public-dep/include
-
{
RequiredVersion *ver = conflicts_iter->data;
- if (version_test (ver->comparison,
- req->version,
- ver->version))
+ if (strcmp (ver->name, req->key) == 0 &&
+ version_test (ver->comparison,
+ req->version,
+ ver->version))
{
verbose_error ("Version %s of %s creates a conflict.\n"
"(%s %s %s conflicts with %s %s)\n",