pkgsrc-Users archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

pkg_filecheck under darwin



Hi,

I encountered some problems when building pkgtools/pkg_filecheck under
darwin.

I get build errors with incorrect db4 uses:

pkg_filecheck.c: In function 'main':
pkg_filecheck.c:101: error: too few arguments to function '(*((struct DB 
**)((i) * 4u) + db))->close'

pkg_filecheck.c: In function 'check':
pkg_filecheck.c:133: warning: passing argument 2 of '(*((struct DB **)((i) * 
4u) + db))->get' from incompatible pointer type

pkg_filecheck.c:133: error: too few arguments to function '(*((struct DB 
**)((i) * 4u) + db))->get'

Using the attached patch fixes the issues, and simply make sure the
functions are used with the signatures from:
/usr/pkg/share/doc/db4/api_c/db_close.html
/usr/pkg/share/doc/db4/api_c/db_get.html

That is, .include "../../mk/bdb.buildlink3.mk" gets the db4-4.4.20nb1
package, so pkg_filecheck should use its api.

However, pkg_filecheck builds fine under netbsd, and will fail with the
attached patch. db4 pkg is installed, but bdb.buildlink3.mk do not
require it, and pkg_filecheck uses /usr/include/db.h.

What is the correct way to fix this problem ?
One way is to force bdb.buildlink3 to pull the db4 package under netbsd
as well, but it doesn't seem right.

Best regards,
antoine
Index: files/pkg_filecheck.c
===================================================================
RCS file: /cvsroot/pkgsrc/pkgtools/pkg_filecheck/files/pkg_filecheck.c,v
retrieving revision 1.4
diff -u -r1.4 pkg_filecheck.c
--- files/pkg_filecheck.c       24 Oct 2006 19:23:38 -0000      1.4
+++ files/pkg_filecheck.c       16 Feb 2007 21:35:19 -0000
@@ -98,7 +98,7 @@
     err = check(dir, db, ignore);
 
     for (i=0; db[i]; i++)
-       db[i]->close(db[i]);
+       db[i]->close(db[i],0);
     free(dir);
     free(db);
     free(ignore);
@@ -130,7 +130,7 @@
            
            found = 0;
            for (i=0; db[i]; i++)
-               if (db[i]->get(db[i], &key, &val, 0) == 0) {
+               if (db[i]->get(db[i], NULL, &key, &val, 0) == 0) {
                    found = 1;
                    break;
                }

Attachment: pgpUCEcb3iS8L.pgp
Description: PGP signature



Home | Main Index | Thread Index | Old Index