Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 20 Apr 2019 20:56:50 +0900
From:      Hajimu UMEMOTO <ume@mahoroba.org>
To:        Walter Schwarzenfeld <w.schwarzenfeld@utanet.at>
Cc:        freebsd-ports@freebsd.org
Subject:   Re: Request to change ruby default version to 2.5
Message-ID:  <yged0lgopod.wl-ume@mahoroba.org>
In-Reply-To: <06c269a7-d2d3-a909-8f27-04cfc8b5acab@utanet.at>
References:  <571f0b5c-c85e-2b4b-7409-6ed0dc7e6eaa@fechner.net> <06c269a7-d2d3-a909-8f27-04cfc8b5acab@utanet.at>

next in thread | previous in thread | raw e-mail | index | archive | help
--Multipart_Sat_Apr_20_20:56:49_2019-1
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 8bit

Hi,

>>>>> On Sat, 20 Apr 2019 06:59:16 +0200
>>>>> Walter Schwarzenfeld <w.schwarzenfeld@utanet.at> said:

w.schwarzenfeld> ===>>> Port directory: /usr/ports/databases/ruby-bdb

w.schwarzenfeld>     ===>>> This port is marked BROKEN
w.schwarzenfeld>     ===>>> does not build with Ruby 2.5

How about this patch?

Sincerely,


--Multipart_Sat_Apr_20_20:56:49_2019-1
Content-Type: text/plain; type=patch; charset=US-ASCII
Content-Disposition: attachment; filename="ruby-bdb-ruby25.diff"
Content-Transfer-Encoding: 7bit

Index: Makefile
===================================================================
--- Makefile	(revision 499424)
+++ Makefile	(working copy)
@@ -16,8 +16,6 @@
 
 LICENSE=	RUBY
 
-BROKEN_RUBY25=	yes
-
 OPTIONS_DEFINE=	DOCS EXAMPLES
 
 USE_RUBY=		yes
Index: files/patch-src-common.c
===================================================================
--- files/patch-src-common.c	(revision 499424)
+++ files/patch-src-common.c	(working copy)
@@ -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--;
Index: files/patch-src-cursor.c
===================================================================
--- files/patch-src-cursor.c	(revision 499424)
+++ files/patch-src-cursor.c	(working copy)
@@ -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--;
Index: files/patch-src-recnum.c
===================================================================
--- files/patch-src-recnum.c	(revision 499424)
+++ files/patch-src-recnum.c	(working copy)
@@ -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--;

--Multipart_Sat_Apr_20_20:56:49_2019-1
Content-Type: text/plain; charset=US-ASCII


--
Hajimu UMEMOTO
ume@mahoroba.org  ume@FreeBSD.org
http://www.mahoroba.org/~ume/

--Multipart_Sat_Apr_20_20:56:49_2019-1--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?yged0lgopod.wl-ume>