This patches ruby-mysql and ruby-mysql to avoid issuing deprecation
warnings in Ruby 3.1 and will allow building with Ruby 3.2.
Tested on amd64. Will be committing in a few days unless I hear
objections.
Thanks,
Jeremy
Index: ruby-mysql/Makefile
===================================================================
RCS file: /cvs/ports/databases/ruby-mysql/Makefile,v
retrieving revision 1.42
diff -u -p -r1.42 Makefile
--- ruby-mysql/Makefile 31 Mar 2022 13:58:01 -0000 1.42
+++ ruby-mysql/Makefile 11 Apr 2022 18:15:32 -0000
@@ -1,7 +1,7 @@
COMMENT= access a MySQL database from Ruby
DISTNAME= mysql-2.9.1
-REVISION= 6
+REVISION= 7
CATEGORIES= databases
HOMEPAGE= http://tmtm.org/mysql/ruby/
Index: ruby-mysql/patches/patch-ext_mysql_api_mysql_c
===================================================================
RCS file: /cvs/ports/databases/ruby-mysql/patches/patch-ext_mysql_api_mysql_c,v
retrieving revision 1.6
diff -u -p -r1.6 patch-ext_mysql_api_mysql_c
--- ruby-mysql/patches/patch-ext_mysql_api_mysql_c 11 Mar 2022 18:31:44 -0000 1.6
+++ ruby-mysql/patches/patch-ext_mysql_api_mysql_c 11 Apr 2022 18:30:01 -0000
@@ -6,9 +6,37 @@ Mysql#close not cause a crash if called
Remove client version check, which stopped working in MariaDB 10.6.
+Replace tainted string functions with non-tainted ones, as Ruby has removed
+tainted string support.
+
+Undef alloc function for Mysql and Mysql::Result to work around warning
+in Ruby 3.2.
+
Index: ext/mysql_api/mysql.c
--- ext/mysql_api/mysql.c.orig
+++ ext/mysql_api/mysql.c
+@@ -170,7 +170,7 @@ static void mysql_raise(MYSQL* m)
+ VALUE e = rb_exc_new2(eMysql, mysql_error(m));
+ rb_iv_set(e, "errno", INT2FIX(mysql_errno(m)));
+ #if MYSQL_VERSION_ID >= 40101
+- rb_iv_set(e, "sqlstate", rb_tainted_str_new2(mysql_sqlstate(m)));
++ rb_iv_set(e, "sqlstate", rb_str_new2(mysql_sqlstate(m)));
+
No comments:
Post a Comment