]> err.no Git - pkg-config/commitdiff
2008-03-23 Tollef Fog Heen <tfheen@err.no>
authorTollef Fog Heen <tfheen@err.no>
Sun, 23 Mar 2008 20:39:07 +0000 (21:39 +0100)
committerTollef Fog Heen <tfheen@err.no>
Sun, 23 Mar 2008 20:39:07 +0000 (21:39 +0100)
       * 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.

ChangeLog
check/Makefile.am
check/check-conflicts [new file with mode: 0755]
check/conflicts-test.pc [new file with mode: 0644]
check/public-dep.pc
pkg.c

index 56012ca7725c941a090a10504473558305665b9e..df3374cc37a203025c9c5752f843b7d79be9fe0c 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,12 @@
 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,
index df199c7d53d346ebb23da759f25736ef6f95ff85..772c8ad18db1629bcf90557d219eb4e931ba9e4b 100644 (file)
@@ -1,6 +1,7 @@
 
 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
diff --git a/check/check-conflicts b/check/check-conflicts
new file mode 100755 (executable)
index 0000000..8092ba9
--- /dev/null
@@ -0,0 +1,16 @@
+#! /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
+
diff --git a/check/conflicts-test.pc b/check/conflicts-test.pc
new file mode 100644 (file)
index 0000000..aadebf0
--- /dev/null
@@ -0,0 +1,6 @@
+Name: Conflicts test package
+Description: Dummy pkgconfig test package for testing Conflicts
+Version: 1.0.0
+Requires: public-dep
+Conflicts: simple
+
index 7350e5d2db7a4eda241a119eebb8cac321c3cb5c..66af831cd59ce65c4ef1f6425c4b0898850e5c68 100644 (file)
@@ -3,4 +3,3 @@ Description: Dummy pkgconfig test package for testing Requires/Requires.private
 Version: 1.0.0
 Libs: -L/public-dep/lib -lpublic-dep
 Cflags: -I/public-dep/include
-
diff --git a/pkg.c b/pkg.c
index 540d7935a1e022db84fdb8eb598eb1a6e8c7dbc0..0d750fd849b2229b876ec0251cc31d30bef82d6c 100644 (file)
--- a/pkg.c
+++ b/pkg.c
@@ -842,9 +842,10 @@ verify_package (Package *pkg)
         {
           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",