[postgresql-plruby] Change default safe level to 3, since Ruby 2.1+ does not support otherwise.

Honza Horak hhorak at fedoraproject.org
Mon Apr 28 16:15:45 UTC 2014


commit 1206e8f3a4566517721ede3f95fd5cb5a3d16426
Author: Honza Horak <hhorak at redhat.com>
Date:   Mon Apr 28 18:15:39 2014 +0200

    Change default safe level to 3, since Ruby 2.1+ does not support otherwise.

 postgresql-plruby-safelevel.patch |   16 ++++++++++++++++
 postgresql-plruby.spec            |    7 ++++++-
 2 files changed, 22 insertions(+), 1 deletions(-)
---
diff --git a/postgresql-plruby-safelevel.patch b/postgresql-plruby-safelevel.patch
new file mode 100644
index 0000000..0d6fd2d
--- /dev/null
+++ b/postgresql-plruby-safelevel.patch
@@ -0,0 +1,16 @@
+Ruby 2.1+ and later does not support safe level bigger than 3.
+https://bugs.ruby-lang.org/issues/8468
+https://bugs.ruby-lang.org/projects/ruby-trunk/repository/revisions/41259
+
+diff -up postgresql-plruby-0.5.4/src/plruby.h.safelevel postgresql-plruby-0.5.4/src/plruby.h
+--- postgresql-plruby-0.5.4/src/plruby.h.safelevel	2014-04-28 17:41:59.837748275 +0200
++++ postgresql-plruby-0.5.4/src/plruby.h	2014-04-28 17:42:06.324751504 +0200
+@@ -68,7 +68,7 @@
+ extern VALUE rb_thread_list();
+ 
+ #ifndef SAFE_LEVEL
+-#define SAFE_LEVEL 12
++#define SAFE_LEVEL 3
+ #endif
+ 
+ #ifndef MAIN_SAFE_LEVEL
diff --git a/postgresql-plruby.spec b/postgresql-plruby.spec
index 06aa686..1e3b713 100644
--- a/postgresql-plruby.spec
+++ b/postgresql-plruby.spec
@@ -8,7 +8,7 @@
 Summary:	PostgreSQL Ruby Procedural Language
 Name:		postgresql-plruby
 Version:	0.5.4
-Release:	1%{?dist}
+Release:	2%{?dist}
 Source0:	https://github.com/knu/%{name}/archive/v0.5.4/%{name}-%{version}.tar.gz
 License:	Ruby or GPL+
 Group:		Applications/Databases
@@ -21,6 +21,7 @@ Patch0: postgresql-plruby-bitopers.patch
 Patch2: postgresql-plruby-retval.patch
 Patch3: postgresql-plruby-includes.patch
 Patch4: postgresql-plruby-version.patch
+Patch5: postgresql-plruby-safelevel.patch
 
 %description
 PL/Ruby is a loadable procedural language for the PostgreSQL database
@@ -44,6 +45,7 @@ Documentation for plruby.
 %patch2 -p1 -b .retval
 %patch3 -p1 -b .debug
 %patch4 -p1 -b .version
+%patch5 -p1 -b .safelevel
 
 %build
 ruby extconf.rb --vendor
@@ -69,6 +71,9 @@ rm -rf %{buildroot}
 %doc docs/plruby.rb
 
 %changelog
+* Mon Apr 28 2014 Honza Horak <hhorak at redhat.com> - 0.5.4-2
+- Change default safe level to 3, since Ruby 2.1+ does not support otherwise.
+
 * Mon Apr 28 2014 Honza Horak <hhorak at redhat.com> - 0.5.4-1
 - Rebase to new upstream version 0.5.4
 - Change upstream URL


More information about the scm-commits mailing list