Update to Ruby 2.2.3.

This commit is contained in:
Vít Ondruch 2015-09-01 14:24:51 +02:00
parent 693a96cb40
commit b945bce4cb
11 changed files with 17 additions and 193 deletions

1
.gitignore vendored
View File

@ -2,3 +2,4 @@
/ruby-2.2.0.tar.xz
/ruby-2.2.1.tar.xz
/ruby-2.2.2.tar.xz
/ruby-2.2.3.tar.xz

View File

@ -11,7 +11,7 @@ diff --git a/lib/mkmf.rb b/lib/mkmf.rb
index 682eb46..e6b1445 100644
--- a/lib/mkmf.rb
+++ b/lib/mkmf.rb
@@ -1858,7 +1858,7 @@ SRC
@@ -1859,7 +1859,7 @@ SRC
SHELL = /bin/sh
# V=0 quiet, V=1 verbose. other values don't work.

View File

@ -26,7 +26,7 @@ diff --git a/common.mk b/common.mk
index 5cfbc3d..3f0a82e 100644
--- a/common.mk
+++ b/common.mk
@@ -115,7 +115,7 @@ ALLOBJS = $(NORMALMAINOBJ) $(MINIOBJS) $(COMMONOBJS) $(INITOBJS)
@@ -117,7 +117,7 @@ ALLOBJS = $(NORMALMAINOBJ) $(MINIOBJS) $(COMMONOBJS) $(INITOBJS)
GOLFOBJS = goruby.$(OBJEXT) golf_prelude.$(OBJEXT)
DEFAULT_PRELUDES = $(GEM_PRELUDE)
@ -39,7 +39,7 @@ diff --git a/configure.in b/configure.in
index 0e371e2..d4f1dcb 100644
--- a/configure.in
+++ b/configure.in
@@ -4160,6 +4160,13 @@ AC_SUBST(rubyarchhdrdir)dnl
@@ -4169,6 +4169,13 @@ AC_SUBST(rubyarchhdrdir)dnl
AC_SUBST(sitearchhdrdir)dnl
AC_SUBST(vendorarchhdrdir)dnl

View File

@ -11,7 +11,7 @@ diff --git a/configure.in b/configure.in
index 37d9a62..553d4d0 100644
--- a/configure.in
+++ b/configure.in
@@ -3379,6 +3379,11 @@ if test ${multiarch+set}; then
@@ -3385,6 +3385,11 @@ if test ${multiarch+set}; then
fi
archlibdir='${libdir}/${arch}'

View File

@ -14,7 +14,7 @@ diff --git a/configure.in b/configure.in
index 17ed3ed..5843651 100644
--- a/configure.in
+++ b/configure.in
@@ -3966,8 +3966,6 @@ AS_CASE(["$target_os"],
@@ -3975,8 +3975,6 @@ AS_CASE(["$target_os"],
rubyw_install_name='$(RUBYW_INSTALL_NAME)'
])
@ -23,7 +23,7 @@ index 17ed3ed..5843651 100644
rubyarchprefix=${multiarch+'${archlibdir}/${RUBY_BASE_NAME}'}${multiarch-'${rubylibprefix}/${arch}'}
AC_ARG_WITH(rubyarchprefix,
@@ -3997,6 +3995,7 @@ AC_ARG_WITH(ruby-version,
@@ -4006,6 +4004,7 @@ AC_ARG_WITH(ruby-version,
[ruby_version=full])
unset RUBY_LIB_VERSION
unset RUBY_LIB_VERSION_STYLE
@ -31,7 +31,7 @@ index 17ed3ed..5843651 100644
AS_CASE(["$ruby_version"],
[full], [RUBY_LIB_VERSION_STYLE='3 /* full */'],
[minor], [RUBY_LIB_VERSION_STYLE='2 /* minor */'])
@@ -4013,30 +4012,34 @@ if test ${RUBY_LIB_VERSION_STYLE+set}; then
@@ -4022,30 +4021,34 @@ if test ${RUBY_LIB_VERSION_STYLE+set}; then
ruby_version="`$CPP -I. -I"${srcdir}" -I"${srcdir}/include" conftest.c | sed '/^ruby_version=/!d;s/ //g'`"
eval $ruby_version
elif test -z "${ruby_version}"; then

View File

@ -11,7 +11,7 @@ diff --git a/configure.in b/configure.in
index 553d4d0..03a4152 100644
--- a/configure.in
+++ b/configure.in
@@ -4078,6 +4078,8 @@ AC_SUBST(vendorarchdir)dnl
@@ -4087,6 +4087,8 @@ AC_SUBST(vendorarchdir)dnl
AC_SUBST(configure_args, "`echo "${ac_configure_args}" | sed 's/\\$/$$/g'`")dnl

View File

@ -15,7 +15,7 @@ diff --git a/configure.in b/configure.in
index 03a4152..0e371e2 100644
--- a/configure.in
+++ b/configure.in
@@ -4052,6 +4052,10 @@ AC_ARG_WITH(vendorarchdir,
@@ -4061,6 +4061,10 @@ AC_ARG_WITH(vendorarchdir,
[vendorarchdir=$withval],
[vendorarchdir=${multiarch+'${rubysitearchprefix}/vendor_ruby/${ruby_version}'}${multiarch-'${vendorlibdir}/${sitearch}'}])
@ -26,7 +26,7 @@ index 03a4152..0e371e2 100644
if test "${LOAD_RELATIVE+set}"; then
AC_DEFINE_UNQUOTED(LOAD_RELATIVE, $LOAD_RELATIVE)
RUBY_EXEC_PREFIX=''
@@ -4075,6 +4079,7 @@ AC_SUBST(sitearchdir)dnl
@@ -4084,6 +4088,7 @@ AC_SUBST(sitearchdir)dnl
AC_SUBST(vendordir)dnl
AC_SUBST(vendorlibdir)dnl
AC_SUBST(vendorarchdir)dnl

View File

@ -1,141 +0,0 @@
diff --git a/ChangeLog b/ChangeLog
index 909c092..9f09144 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -70,1 +70,6 @@
+Tue Mar 24 17:30:12 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * ext/-test-/file/fs.c (get_fsname): return filesystem name by
+ statfs/statvfs. [ruby-core:68624] [Bug #10998]
+
Thu Feb 26 15:48:41 2015 NAKAMURA Usaku <usa@ruby-lang.org>
diff --git a/ext/-test-/file/extconf.rb b/ext/-test-/file/extconf.rb
index 4e134dd..be4a2fb 100644
--- a/ext/-test-/file/extconf.rb
+++ b/ext/-test-/file/extconf.rb
@@ -1,4 +1,18 @@
$INCFLAGS << " -I$(topdir) -I$(top_srcdir)"
+
+headers = %w[sys/param.h sys/mount.h sys/vfs.h].select {|h| have_header(h)}
+if have_type("struct statfs", headers)
+ have_struct_member("struct statfs", "f_fstypename", headers)
+ have_struct_member("struct statfs", "f_type", headers)
+end
+
+headers = %w[sys/statvfs.h]
+if have_type("struct statvfs", headers)
+ have_struct_member("struct statvfs", "f_fstypename", headers)
+ have_struct_member("struct statvfs", "f_basetype", headers)
+ have_struct_member("struct statvfs", "f_type", headers)
+end
+
$srcs = Dir[File.join($srcdir, "*.{#{SRC_EXT.join(%q{,})}}")]
inits = $srcs.map {|s| File.basename(s, ".*")}
inits.delete("init")
diff --git a/ext/-test-/file/fs.c b/ext/-test-/file/fs.c
index 4a41bf3..94d96d3 100644
--- a/ext/-test-/file/fs.c
+++ b/ext/-test-/file/fs.c
@@ -1,55 +1,64 @@
#include "ruby/ruby.h"
#include "ruby/io.h"
-#ifdef __linux__
-# define HAVE_GETMNTENT
+#ifdef HAVE_SYS_MOUNT_H
+#include <sys/mount.h>
+#endif
+#ifdef HAVE_SYS_VFS_H
+#include <sys/vfs.h>
#endif
-#ifdef HAVE_GETMNTENT
-# include <stdio.h>
-# include <mntent.h>
+#if defined HAVE_STRUCT_STATFS_F_FSTYPENAME
+typedef struct statfs statfs_t;
+# define STATFS(f, s) statfs((f), (s))
+# define HAVE_STRUCT_STATFS_T_F_FSTYPENAME 1
+#elif defined(HAVE_STRUCT_STATVFS_F_FSTYPENAME) /* NetBSD */
+typedef struct statvfs statfs_t;
+# define STATFS(f, s) statvfs((f), (s))
+# define HAVE_STRUCT_STATFS_T_F_FSTYPENAME 1
+#elif defined(HAVE_STRUCT_STATVFS_F_BASETYPE) /* AIX, HP-UX, Solaris */
+typedef struct statvfs statfs_t;
+# define STATFS(f, s) statvfs((f), (s))
+# define HAVE_STRUCT_STATFS_T_F_FSTYPENAME 1
+# define f_fstypename f_basetype
+#elif defined HAVE_STRUCT_STATFS_F_TYPE
+typedef struct statfs statfs_t;
+# define STATFS(f, s) statfs((f), (s))
+#elif defined HAVE_STRUCT_STATVFS_F_TYPE
+typedef struct statvfs statfs_t;
+# define STATFS(f, s) statvfs((f), (s))
#endif
VALUE
get_fsname(VALUE self, VALUE str)
{
-#ifdef HAVE_GETMNTENT
- const char *path;
- struct mntent mntbuf;
- static const int buflen = 4096;
- char *buf = alloca(buflen);
- int len = 0;
- FILE *fp;
-#define FSNAME_LEN 100
- char name[FSNAME_LEN] = "";
+#ifdef STATFS
+ statfs_t st;
+# define CSTR(s) rb_str_new_cstr(s)
FilePathValue(str);
- path = RSTRING_PTR(str);
- fp = setmntent("/etc/mtab", "r");
- if (!fp) rb_sys_fail("setmntent(/etb/mtab)");;
-
- while (getmntent_r(fp, &mntbuf, buf, buflen)) {
- int i;
- char *mnt_dir = mntbuf.mnt_dir;
- for (i=0; mnt_dir[i]; i++) {
- if (mnt_dir[i] != path[i]) {
- goto next_entry;
- }
- }
- if (i >= len) {
- len = i;
- strlcpy(name, mntbuf.mnt_type, FSNAME_LEN);
- }
-next_entry:
- ;
+ str = rb_str_encode_ospath(str);
+ if (STATFS(StringValueCStr(str), &st) == -1) {
+ rb_sys_fail_str(str);
+ }
+# ifdef HAVE_STRUCT_STATFS_T_F_FSTYPENAME
+ if (st.f_fstypename[0])
+ return CSTR(st.f_fstypename);
+# endif
+ switch (st.f_type) {
+ case 0x9123683E: /* BTRFS_SUPER_MAGIC */
+ return CSTR("btrfs");
+ case 0x7461636f: /* OCFS2_SUPER_MAGIC */
+ return CSTR("ocfs");
+ case 0xEF53: /* EXT2_SUPER_MAGIC EXT3_SUPER_MAGIC EXT4_SUPER_MAGIC */
+ return CSTR("ext4");
+ case 0x58465342: /* XFS_SUPER_MAGIC */
+ return CSTR("xfs");
+ case 0x01021994: /* TMPFS_MAGIC */
+ return CSTR("tmpfs");
}
- endmntent(fp);
-
- if (!len) rb_sys_fail("no matching entry");;
- return rb_str_new_cstr(name);
-#else
- return Qnil;
#endif
+ return Qnil;
}
void

View File

@ -1,30 +0,0 @@
From 6398515adfc86813686605019a3e22d49cd95517 Mon Sep 17 00:00:00 2001
From: nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>
Date: Fri, 19 Jun 2015 06:04:00 +0000
Subject: [PATCH] test_gem_remote_fetcher.rb: get rid of errors
* test/rubygems/test_gem_remote_fetcher.rb (start_ssl_server):
temporary measure for "dh key too small" error of OpenSSL
1.0.2c+.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50972 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
---
test/rubygems/test_gem_remote_fetcher.rb | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/test/rubygems/test_gem_remote_fetcher.rb b/test/rubygems/test_gem_remote_fetcher.rb
index 6b29e18..63dd8fe 100644
--- a/test/rubygems/test_gem_remote_fetcher.rb
+++ b/test/rubygems/test_gem_remote_fetcher.rb
@@ -898,7 +898,7 @@ gems:
server.mount_proc("/insecure_redirect") { |req, res|
res.set_redirect(WEBrick::HTTPStatus::MovedPermanently, req.query['to'])
}
- server.ssl_context.tmp_dh_callback = proc { OpenSSL::PKey::DH.new 128 }
+ server.ssl_context.tmp_dh_callback = proc {|_, _, k| OpenSSL::PKey::DH.new(k) }
t = Thread.new do
begin
server.start
--
2.4.3

View File

@ -1,6 +1,6 @@
%global major_version 2
%global minor_version 2
%global teeny_version 2
%global teeny_version 3
%global major_minor_version %{major_version}.%{minor_version}
%global ruby_version %{major_minor_version}.%{teeny_version}
@ -21,7 +21,7 @@
%endif
%global release 43
%global release 44
%{!?release_string:%global release_string %{?development_release:0.}%{release}%{?development_release:.%{development_release}}%{?dist}}
%global rubygems_version 2.4.5
@ -110,13 +110,6 @@ Patch5: ruby-1.9.3-mkmf-verbose.patch
# in support for ABRT.
# http://bugs.ruby-lang.org/issues/8566
Patch6: ruby-2.1.0-Allow-to-specify-additional-preludes-by-configuratio.patch
# can_seek_data does not work correctly in chroot for Kernel 3.19+.
# https://bugs.ruby-lang.org/issues/10998
Patch7: ruby-2.2.1-use-statfs.patch
# Fix "dh key too small" error of OpenSSL 1.0.2c+.
# https://github.com/rubygems/rubygems/issues/1289
# https://github.com/ruby/ruby/commit/6398515adfc86813686605019a3e22d49cd95517
Patch8: ruby-2.3.0-test_gem_remote_fetcher.rb-get-rid-of-errors.patch
# Don't use SSLv3 for tests.
# https://bugs.ruby-lang.org/issues/10046
Patch9: ruby-2.3.0-fix-test-ctx-client-session-cb.patch
@ -422,8 +415,6 @@ rm -rf ext/fiddle/libffi*
%patch4 -p1
%patch5 -p1
%patch6 -p1
%patch7 -p1
%patch8 -p1
%patch9
%patch10
%patch11
@ -902,6 +893,9 @@ make check TESTS="-v $DISABLE_TESTS"
%{ruby_libdir}/tkextlib
%changelog
* Tue Sep 01 2015 Vít Ondruch <vondruch@redhat.com> - 2.2.3-44
- Update to Ruby 2.2.3.
* Tue Jun 23 2015 Vít Ondruch <vondruch@redhat.com> - 2.2.2-43
- Fix for "dh key too small" error of OpenSSL 1.0.2+.

View File

@ -1 +1 @@
dbce9b9d79d90f213ba8d448b0b6ed86 ruby-2.2.2.tar.xz
2a8bc1f46aba8938add70f742e8af1ff ruby-2.2.3.tar.xz