mirror of
https://git.FreeBSD.org/ports.git
synced 2025-01-04 06:15:24 +00:00
Fix build problem with ruby 2.5.
This patch should be included upstream. PR: 237410 Submitted by: ume@ Reported by: mbeis@xs4all.nl Reviewed by: mbeis@xs4all.nl, w.schwarzenfeld@utanet.at
This commit is contained in:
parent
3d8afb5258
commit
cf37386b71
Notes:
svn2git
2021-03-31 03:12:20 +00:00
svn path=/head/; revision=499463
@ -3,7 +3,7 @@
|
||||
|
||||
PORTNAME= bdb
|
||||
PORTVERSION= 0.6.6
|
||||
PORTREVISION= 5
|
||||
PORTREVISION= 6
|
||||
CATEGORIES= databases ruby
|
||||
MASTER_SITES= ftp://ftp.idaemons.org/pub/distfiles/ruby/ \
|
||||
http://idaemons.org/distfiles/ruby/ \
|
||||
@ -16,13 +16,11 @@ COMMENT= Ruby interface to Oracle Berkeley DB revision 2 or later
|
||||
|
||||
LICENSE= RUBY
|
||||
|
||||
BROKEN_RUBY25= yes
|
||||
|
||||
OPTIONS_DEFINE= DOCS EXAMPLES
|
||||
|
||||
USE_RUBY= yes
|
||||
USE_RUBY_EXTCONF= yes
|
||||
MAKE_ENV+= RUBY_RDOC=${LOCALBASE}/bin/rdoc
|
||||
USE_RUBY_RDOC= yes
|
||||
|
||||
ALL_TARGET= all rdoc
|
||||
CONFIGURE_ARGS= --with-db-include=${BDB_INCLUDE_DIR} \
|
||||
|
@ -1,38 +1,38 @@
|
||||
--- src/common.c.orig 2011-04-06 19:35:39.000000000 +0000
|
||||
+++ src/common.c 2015-01-22 17:10:32.000000000 +0000
|
||||
@@ -1229,7 +1229,7 @@
|
||||
--- src/common.c.orig 2011-04-06 19:35:39 UTC
|
||||
+++ src/common.c
|
||||
@@ -1229,7 +1229,7 @@ bdb_s_new(int argc, VALUE *argv, VALUE o
|
||||
if (argc && TYPE(argv[argc - 1]) == T_HASH) {
|
||||
VALUE v, f = argv[argc - 1];
|
||||
|
||||
- if ((v = rb_hash_aref(f, rb_str_new2("txn"))) != RHASH(f)->ifnone) {
|
||||
+ if ((v = rb_hash_aref(f, rb_str_new2("txn"))) != rb_hash_ifnone(f)) {
|
||||
+ if ((v = rb_hash_lookup(f, rb_str_new2("txn"))) != Qnil) {
|
||||
if (!rb_obj_is_kind_of(v, bdb_cTxn)) {
|
||||
rb_raise(bdb_eFatal, "argument of txn must be a transaction");
|
||||
}
|
||||
@@ -1241,7 +1241,7 @@
|
||||
@@ -1241,7 +1241,7 @@ bdb_s_new(int argc, VALUE *argv, VALUE o
|
||||
dbst->options |= envst->options & BDB_NO_THREAD;
|
||||
dbst->marshal = txnst->marshal;
|
||||
}
|
||||
- else if ((v = rb_hash_aref(f, rb_str_new2("env"))) != RHASH(f)->ifnone) {
|
||||
+ else if ((v = rb_hash_aref(f, rb_str_new2("env"))) != rb_hash_ifnone(f)) {
|
||||
+ else if ((v = rb_hash_lookup(f, rb_str_new2("env"))) != Qnil) {
|
||||
if (!rb_obj_is_kind_of(v, bdb_cEnv)) {
|
||||
rb_raise(bdb_eFatal, "argument of env must be an environnement");
|
||||
}
|
||||
@@ -1254,11 +1254,11 @@
|
||||
@@ -1254,11 +1254,11 @@ bdb_s_new(int argc, VALUE *argv, VALUE o
|
||||
#if HAVE_CONST_DB_ENCRYPT
|
||||
if (envst && (envst->options & BDB_ENV_ENCRYPT)) {
|
||||
VALUE tmp = rb_str_new2("set_flags");
|
||||
- if ((v = rb_hash_aref(f, rb_intern("set_flags"))) != RHASH(f)->ifnone) {
|
||||
+ if ((v = rb_hash_aref(f, rb_intern("set_flags"))) != rb_hash_ifnone(f)) {
|
||||
+ if ((v = rb_hash_lookup(f, rb_intern("set_flags"))) != Qnil) {
|
||||
rb_hash_aset(f, rb_intern("set_flags"),
|
||||
INT2NUM(NUM2INT(v) | DB_ENCRYPT));
|
||||
}
|
||||
- else if ((v = rb_hash_aref(f, tmp)) != RHASH(f)->ifnone) {
|
||||
+ else if ((v = rb_hash_aref(f, tmp)) != rb_hash_ifnone(f)) {
|
||||
+ else if ((v = rb_hash_lookup(f, tmp)) != Qnil) {
|
||||
rb_hash_aset(f, tmp, INT2NUM(NUM2INT(v) | DB_ENCRYPT));
|
||||
}
|
||||
else {
|
||||
@@ -1570,10 +1570,10 @@
|
||||
@@ -1570,10 +1570,10 @@ bdb_init(int argc, VALUE *argv, VALUE ob
|
||||
#endif
|
||||
switch(dbst->type) {
|
||||
case DB_BTREE:
|
||||
@ -45,7 +45,7 @@
|
||||
break;
|
||||
case DB_RECNO:
|
||||
{
|
||||
@@ -1581,17 +1581,17 @@
|
||||
@@ -1581,17 +1581,17 @@ bdb_init(int argc, VALUE *argv, VALUE ob
|
||||
|
||||
rb_warning("It's hard to distinguish Recnum with Recno for all versions of Berkeley DB");
|
||||
if ((count = bdb_is_recnum(dbst->dbp)) != -1) {
|
||||
@ -66,7 +66,7 @@
|
||||
break;
|
||||
#endif
|
||||
default:
|
||||
@@ -1635,29 +1635,29 @@
|
||||
@@ -1635,29 +1635,29 @@ bdb_s_alloc(obj)
|
||||
dbst->options = BDB_NOT_OPEN;
|
||||
cl = obj;
|
||||
while (cl) {
|
||||
@ -102,36 +102,36 @@
|
||||
dbst->type = DB_UNKNOWN;
|
||||
break;
|
||||
}
|
||||
@@ -3004,8 +3004,8 @@
|
||||
@@ -3004,8 +3004,8 @@ bdb_each_kvc(argc, argv, obj, sens, repl
|
||||
|
||||
if (argc && TYPE(argv[argc - 1]) == T_HASH) {
|
||||
VALUE g, f = argv[argc - 1];
|
||||
- if ((g = rb_hash_aref(f, rb_intern("flags"))) != RHASH(f)->ifnone ||
|
||||
- (g = rb_hash_aref(f, rb_str_new2("flags"))) != RHASH(f)->ifnone) {
|
||||
+ if ((g = rb_hash_aref(f, rb_intern("flags"))) != rb_hash_ifnone(f) ||
|
||||
+ (g = rb_hash_aref(f, rb_str_new2("flags"))) != rb_hash_ifnone(f)) {
|
||||
+ if ((g = rb_hash_lookup(f, rb_intern("flags"))) != Qnil ||
|
||||
+ (g = rb_hash_lookup(f, rb_str_new2("flags"))) != Qnil) {
|
||||
flags = NUM2INT(g);
|
||||
}
|
||||
argc--;
|
||||
@@ -3323,8 +3323,8 @@
|
||||
@@ -3323,8 +3323,8 @@ bdb_clear(int argc, VALUE *argv, VALUE o
|
||||
flags = 0;
|
||||
if (argc && TYPE(argv[argc - 1]) == T_HASH) {
|
||||
VALUE g, f = argv[argc - 1];
|
||||
- if ((g = rb_hash_aref(f, rb_intern("flags"))) != RHASH(f)->ifnone ||
|
||||
- (g = rb_hash_aref(f, rb_str_new2("flags"))) != RHASH(f)->ifnone) {
|
||||
+ if ((g = rb_hash_aref(f, rb_intern("flags"))) != rb_hash_ifnone(f) ||
|
||||
+ (g = rb_hash_aref(f, rb_str_new2("flags"))) != rb_hash_ifnone(f)) {
|
||||
+ if ((g = rb_hash_lookup(f, rb_intern("flags"))) != Qnil ||
|
||||
+ (g = rb_hash_lookup(f, rb_str_new2("flags"))) != Qnil) {
|
||||
flags = NUM2INT(g);
|
||||
}
|
||||
argc--;
|
||||
@@ -3348,8 +3348,8 @@
|
||||
@@ -3348,8 +3348,8 @@ bdb_replace(int argc, VALUE *argv, VALUE
|
||||
flags = 0;
|
||||
if (TYPE(argv[argc - 1]) == T_HASH) {
|
||||
VALUE f = argv[argc - 1];
|
||||
- if ((g = rb_hash_aref(f, rb_intern("flags"))) != RHASH(f)->ifnone ||
|
||||
- (g = rb_hash_aref(f, rb_str_new2("flags"))) != RHASH(f)->ifnone) {
|
||||
+ if ((g = rb_hash_aref(f, rb_intern("flags"))) != rb_hash_ifnone(f) ||
|
||||
+ (g = rb_hash_aref(f, rb_str_new2("flags"))) != rb_hash_ifnone(f)) {
|
||||
+ if ((g = rb_hash_lookup(f, rb_intern("flags"))) != Qnil ||
|
||||
+ (g = rb_hash_lookup(f, rb_str_new2("flags"))) != Qnil) {
|
||||
flags = NUM2INT(g);
|
||||
}
|
||||
argc--;
|
||||
|
@ -1,13 +1,13 @@
|
||||
--- src/cursor.c.orig 2015-01-22 17:37:51.000000000 +0000
|
||||
+++ src/cursor.c 2015-01-22 17:38:17.000000000 +0000
|
||||
@@ -29,8 +29,8 @@
|
||||
--- src/cursor.c.orig 2011-04-06 19:35:39 UTC
|
||||
+++ src/cursor.c
|
||||
@@ -29,8 +29,8 @@ bdb_cursor(int argc, VALUE *argv, VALUE
|
||||
flags = 0;
|
||||
if (argc && TYPE(argv[argc - 1]) == T_HASH) {
|
||||
VALUE g, f = argv[argc - 1];
|
||||
- if ((g = rb_hash_aref(f, rb_intern("flags"))) != RHASH(f)->ifnone ||
|
||||
- (g = rb_hash_aref(f, rb_str_new2("flags"))) != RHASH(f)->ifnone) {
|
||||
+ if ((g = rb_hash_aref(f, rb_intern("flags"))) != rb_hash_ifnone(f) ||
|
||||
+ (g = rb_hash_aref(f, rb_str_new2("flags"))) != rb_hash_ifnone(f)) {
|
||||
+ if ((g = rb_hash_lookup(f, rb_intern("flags"))) != Qnil ||
|
||||
+ (g = rb_hash_lookup(f, rb_str_new2("flags"))) != Qnil) {
|
||||
flags = NUM2INT(g);
|
||||
}
|
||||
argc--;
|
||||
|
@ -1,22 +1,22 @@
|
||||
--- src/recnum.c.orig 2011-04-06 19:35:39.000000000 +0000
|
||||
+++ src/recnum.c 2015-01-22 17:16:32.000000000 +0000
|
||||
@@ -17,7 +17,7 @@
|
||||
--- src/recnum.c.orig 2011-04-06 19:35:39 UTC
|
||||
+++ src/recnum.c
|
||||
@@ -17,7 +17,7 @@ bdb_recnum_init(int argc, VALUE *argv, V
|
||||
argc++;
|
||||
}
|
||||
rb_hash_aset(argv[argc - 1], array, INT2FIX(0));
|
||||
- if (rb_hash_aref(argv[argc - 1], sarray) != RHASH(argv[argc - 1])->ifnone) {
|
||||
+ if (rb_hash_aref(argv[argc - 1], sarray) != rb_hash_ifnone(argv[argc - 1])) {
|
||||
+ if (rb_hash_lookup(argv[argc - 1], sarray) != Qnil) {
|
||||
rb_hash_aset(argv[argc - 1], sarray, INT2FIX(0));
|
||||
}
|
||||
rb_hash_aset(argv[argc - 1], rb_str_new2("set_flags"), INT2FIX(DB_RENUMBER));
|
||||
@@ -697,8 +697,8 @@
|
||||
@@ -697,8 +697,8 @@ bdb_sary_clear(int argc, VALUE *argv, VA
|
||||
|
||||
if (argc && TYPE(argv[argc - 1]) == T_HASH) {
|
||||
VALUE f = argv[argc - 1];
|
||||
- if ((g = rb_hash_aref(f, rb_intern("flags"))) != RHASH(f)->ifnone ||
|
||||
- (g = rb_hash_aref(f, rb_str_new2("flags"))) != RHASH(f)->ifnone) {
|
||||
+ if ((g = rb_hash_aref(f, rb_intern("flags"))) != rb_hash_ifnone(f) ||
|
||||
+ (g = rb_hash_aref(f, rb_str_new2("flags"))) != rb_hash_ifnone(f)) {
|
||||
+ if ((g = rb_hash_lookup(f, rb_intern("flags"))) != Qnil ||
|
||||
+ (g = rb_hash_lookup(f, rb_str_new2("flags"))) != Qnil) {
|
||||
flags = NUM2INT(g);
|
||||
}
|
||||
argc--;
|
||||
|
Loading…
Reference in New Issue
Block a user