Compare commits
43 commits
rawhide
...
private-ru
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
27f4f20885 | ||
|
|
64579ec58f | ||
|
|
ceb2428ce1 | ||
|
|
3c57984780 | ||
|
|
3dd03fa528 | ||
|
|
2490fcead5 | ||
|
|
fd4e513476 | ||
|
|
2140307775 | ||
|
|
3bad6f1e94 | ||
|
|
9c44ddbd05 | ||
|
|
a05261a45d | ||
|
|
1be26a5e65 | ||
|
|
58fed71b97 | ||
|
|
10863d863c | ||
|
|
f2e5d52dee | ||
|
|
d61dd7f54c | ||
|
|
b37ff13fab | ||
|
|
5a32de95a4 | ||
|
|
320ac78f8a | ||
|
|
9cc2ff2afe | ||
|
|
99ceb0d65c | ||
|
|
5467bfd5c3 | ||
|
|
70f4ffd59c | ||
|
|
999707a8a9 | ||
|
|
8ce900a59e | ||
|
|
8490a57da6 | ||
|
|
f9a8b7fc74 | ||
|
|
2f788eb983 | ||
|
|
b7caba6d26 | ||
|
|
7c9a7d257f | ||
|
|
08398ea96f | ||
|
|
153f2c16fe | ||
|
|
45186be1b9 | ||
|
|
cdc6dd71a2 | ||
|
|
9c0a1cb650 | ||
|
|
33bcda5dc3 | ||
|
|
2cb1f7b4f0 | ||
|
|
de82ddebfd | ||
|
|
1f1a445441 | ||
|
|
03cd41fefd | ||
|
|
e940ed5d70 | ||
|
|
09794903d7 | ||
|
|
b1a7ccbd74 |
13 changed files with 553 additions and 683 deletions
3
.gitignore
vendored
3
.gitignore
vendored
|
|
@ -1,4 +1,3 @@
|
|||
/*/
|
||||
/ruby-2.*.tar.bz2
|
||||
/ruby-2.*.tar.xz
|
||||
/ruby-*.tar.xz
|
||||
/*.rpm
|
||||
|
|
|
|||
|
|
@ -11,7 +11,7 @@ diff --git a/configure.ac b/configure.ac
|
|||
index d261ea57b5..3c13076b82 100644
|
||||
--- a/configure.ac
|
||||
+++ b/configure.ac
|
||||
@@ -3102,6 +3102,11 @@ AS_IF([test ${multiarch+set}], [
|
||||
@@ -3211,6 +3211,11 @@ AS_IF([test ${multiarch+set}], [
|
||||
])
|
||||
|
||||
archlibdir='${libdir}/${arch}'
|
||||
|
|
|
|||
|
|
@ -14,7 +14,7 @@ diff --git a/configure.ac b/configure.ac
|
|||
index c42436c23d..d261ea57b5 100644
|
||||
--- a/configure.ac
|
||||
+++ b/configure.ac
|
||||
@@ -3740,7 +3740,8 @@ AS_CASE(["$ruby_version_dir_name"],
|
||||
@@ -3852,7 +3852,8 @@ AS_CASE(["$ruby_version_dir_name"],
|
||||
ruby_version_dir=/'${ruby_version_dir_name}'
|
||||
|
||||
if test -z "${ruby_version_dir_name}"; then
|
||||
|
|
|
|||
|
|
@ -11,7 +11,7 @@ diff --git a/configure.ac b/configure.ac
|
|||
index 3c13076b82..93af30321d 100644
|
||||
--- a/configure.ac
|
||||
+++ b/configure.ac
|
||||
@@ -3804,6 +3804,8 @@ AC_SUBST(vendorarchdir)dnl
|
||||
@@ -3916,6 +3916,8 @@ AC_SUBST(vendorarchdir)dnl
|
||||
AC_SUBST(CONFIGURE, "`echo $0 | sed 's|.*/||'`")dnl
|
||||
AC_SUBST(configure_args, "`echo "${ac_configure_args}" | sed 's/\\$/$$/g'`")dnl
|
||||
|
||||
|
|
|
|||
|
|
@ -15,7 +15,7 @@ diff --git a/configure.ac b/configure.ac
|
|||
index 93af30321d..bc13397e0e 100644
|
||||
--- a/configure.ac
|
||||
+++ b/configure.ac
|
||||
@@ -3776,6 +3776,10 @@ AC_ARG_WITH(vendorarchdir,
|
||||
@@ -3888,6 +3888,10 @@ AC_ARG_WITH(vendorarchdir,
|
||||
[vendorarchdir=$withval],
|
||||
[vendorarchdir=${multiarch+'${rubysitearchprefix}/vendor_ruby'${ruby_version_dir}}${multiarch-'${vendorlibdir}/${sitearch}'}])
|
||||
|
||||
|
|
@ -26,7 +26,7 @@ index 93af30321d..bc13397e0e 100644
|
|||
AS_IF([test "${LOAD_RELATIVE+set}"], [
|
||||
AC_DEFINE_UNQUOTED(LOAD_RELATIVE, $LOAD_RELATIVE)
|
||||
RUBY_EXEC_PREFIX=''
|
||||
@@ -3800,6 +3804,7 @@ AC_SUBST(sitearchdir)dnl
|
||||
@@ -3912,6 +3916,7 @@ AC_SUBST(sitearchdir)dnl
|
||||
AC_SUBST(vendordir)dnl
|
||||
AC_SUBST(vendorlibdir)dnl
|
||||
AC_SUBST(vendorarchdir)dnl
|
||||
|
|
@ -64,18 +64,18 @@ index 79c003e..34f2382 100644
|
|||
% R = {}
|
||||
% R["ruby_version"] = '"RUBY_LIB_VERSION"'
|
||||
diff --git a/tool/rbinstall.rb b/tool/rbinstall.rb
|
||||
index b47b6e1..0b99408 100755
|
||||
index e9110a17ca..76a1f0a315 100755
|
||||
--- a/tool/rbinstall.rb
|
||||
+++ b/tool/rbinstall.rb
|
||||
@@ -338,6 +338,7 @@ def CONFIG.[](name, mandatory = false)
|
||||
sitearchlibdir = CONFIG["sitearchdir"]
|
||||
vendorlibdir = CONFIG["vendorlibdir"]
|
||||
vendorarchlibdir = CONFIG["vendorarchdir"]
|
||||
@@ -348,6 +348,7 @@ def CONFIG.[](name, mandatory = false)
|
||||
vendorlibdir = CONFIG["vendorlibdir"]
|
||||
vendorarchlibdir = CONFIG["vendorarchdir"]
|
||||
end
|
||||
+rubygemsdir = CONFIG["rubygemsdir"]
|
||||
mandir = CONFIG["mandir", true]
|
||||
docdir = CONFIG["docdir", true]
|
||||
enable_shared = CONFIG["ENABLE_SHARED"] == 'yes'
|
||||
@@ -565,7 +566,16 @@ def stub
|
||||
@@ -580,7 +581,16 @@ def stub
|
||||
install?(:local, :comm, :lib) do
|
||||
prepare "library scripts", rubylibdir
|
||||
noinst = %w[*.txt *.rdoc *.gemspec]
|
||||
|
|
|
|||
|
|
@ -20,7 +20,7 @@ diff --git a/configure.ac b/configure.ac
|
|||
index 80b137e380..63cd3b4f8b 100644
|
||||
--- a/configure.ac
|
||||
+++ b/configure.ac
|
||||
@@ -3691,9 +3691,6 @@ AS_CASE(["$target_os"],
|
||||
@@ -3803,9 +3803,6 @@ AS_CASE(["$target_os"],
|
||||
rubyw_install_name='$(RUBYW_INSTALL_NAME)'
|
||||
])
|
||||
|
||||
|
|
@ -30,7 +30,7 @@ index 80b137e380..63cd3b4f8b 100644
|
|||
rubyarchprefix=${multiarch+'${archlibdir}/${RUBY_BASE_NAME}'}${multiarch-'${rubylibprefix}/${arch}'}
|
||||
AC_ARG_WITH(rubyarchprefix,
|
||||
AS_HELP_STRING([--with-rubyarchprefix=DIR],
|
||||
@@ -3716,56 +3713,62 @@ AC_ARG_WITH(ridir,
|
||||
@@ -3828,56 +3825,62 @@ AC_ARG_WITH(ridir,
|
||||
AC_SUBST(ridir)
|
||||
AC_SUBST(RI_BASE_NAME)
|
||||
|
||||
|
|
@ -120,7 +120,7 @@ index 80b137e380..63cd3b4f8b 100644
|
|||
|
||||
AS_IF([test "${LOAD_RELATIVE+set}"], [
|
||||
AC_DEFINE_UNQUOTED(LOAD_RELATIVE, $LOAD_RELATIVE)
|
||||
@@ -3782,6 +3785,7 @@ AC_SUBST(sitearchincludedir)dnl
|
||||
@@ -3894,6 +3897,7 @@ AC_SUBST(sitearchincludedir)dnl
|
||||
AC_SUBST(arch)dnl
|
||||
AC_SUBST(sitearch)dnl
|
||||
AC_SUBST(ruby_version)dnl
|
||||
|
|
@ -165,13 +165,13 @@ index 970cb91..5bf8230 100644
|
|||
- version = RbConfig::CONFIG['ruby_version']
|
||||
+ version = RbConfig::CONFIG['ruby_version_dir_name'] || RbConfig::CONFIG['ruby_version']
|
||||
|
||||
BASE = if RbConfig::CONFIG.key? 'ridir' then
|
||||
File.join RbConfig::CONFIG['ridir'], version
|
||||
BASE = File.join RbConfig::CONFIG['ridir'], version
|
||||
|
||||
diff --git a/tool/rbinstall.rb b/tool/rbinstall.rb
|
||||
index d4c110e..d39c9a6 100755
|
||||
--- a/tool/rbinstall.rb
|
||||
+++ b/tool/rbinstall.rb
|
||||
@@ -428,7 +428,7 @@ def CONFIG.[](name, mandatory = false)
|
||||
@@ -438,7 +438,7 @@ def CONFIG.[](name, mandatory = false)
|
||||
|
||||
install?(:doc, :rdoc) do
|
||||
if $rdocdir
|
||||
|
|
@ -198,33 +198,33 @@ diff --git a/lib/rubygems/defaults.rb b/lib/rubygems/defaults.rb
|
|||
index d4ff4a262c..3f9a5bf590 100644
|
||||
--- a/lib/rubygems/defaults.rb
|
||||
+++ b/lib/rubygems/defaults.rb
|
||||
@@ -32,13 +32,13 @@ def self.default_dir
|
||||
@@ -38,13 +38,13 @@ def self.default_dir
|
||||
[
|
||||
File.dirname(RbConfig::CONFIG['sitedir']),
|
||||
'Gems',
|
||||
- RbConfig::CONFIG['ruby_version']
|
||||
- RbConfig::CONFIG['ruby_version'],
|
||||
+ RbConfig::CONFIG['ruby_version_dir_name'] || RbConfig::CONFIG['ruby_version']
|
||||
]
|
||||
else
|
||||
[
|
||||
RbConfig::CONFIG['rubylibprefix'],
|
||||
'gems',
|
||||
- RbConfig::CONFIG['ruby_version']
|
||||
- RbConfig::CONFIG['ruby_version'],
|
||||
+ RbConfig::CONFIG['ruby_version_dir_name'] || RbConfig::CONFIG['ruby_version']
|
||||
]
|
||||
end
|
||||
|
||||
@@ -75,7 +75,8 @@ def self.default_specifications_dir
|
||||
|
||||
def self.user_dir
|
||||
parts = [Gem.user_home, '.gem', ruby_engine]
|
||||
@@ -117,7 +117,8 @@ def self.user_dir
|
||||
gem_dir = File.join(Gem.user_home, ".gem")
|
||||
gem_dir = File.join(Gem.data_home, "gem") unless File.exist?(gem_dir)
|
||||
parts = [gem_dir, ruby_engine]
|
||||
- parts << RbConfig::CONFIG['ruby_version'] unless RbConfig::CONFIG['ruby_version'].empty?
|
||||
+ ruby_version_dir_name = RbConfig::CONFIG['ruby_version_dir_name'] || RbConfig::CONFIG['ruby_version']
|
||||
+ parts << ruby_version_dir_name unless ruby_version_dir_name.empty?
|
||||
File.join parts
|
||||
end
|
||||
|
||||
@@ -158,7 +159,7 @@ def self.vendor_dir # :nodoc:
|
||||
@@ -252,7 +253,7 @@ def self.vendor_dir # :nodoc:
|
||||
return nil unless RbConfig::CONFIG.key? 'vendordir'
|
||||
|
||||
File.join RbConfig::CONFIG['vendordir'], 'gems',
|
||||
|
|
@ -237,7 +237,7 @@ diff --git a/test/rubygems/test_gem.rb b/test/rubygems/test_gem.rb
|
|||
index b25068405d..e9fef4a311 100644
|
||||
--- a/test/rubygems/test_gem.rb
|
||||
+++ b/test/rubygems/test_gem.rb
|
||||
@@ -1353,7 +1353,8 @@ def test_self_use_paths
|
||||
@@ -1369,7 +1369,8 @@ def test_self_use_paths
|
||||
|
||||
def test_self_user_dir
|
||||
parts = [@userhome, '.gem', Gem.ruby_engine]
|
||||
|
|
@ -245,9 +245,9 @@ index b25068405d..e9fef4a311 100644
|
|||
+ ruby_version_dir_name = RbConfig::CONFIG['ruby_version_dir_name'] || RbConfig::CONFIG['ruby_version']
|
||||
+ parts << ruby_version_dir_name unless ruby_version_dir_name.empty?
|
||||
|
||||
assert_equal File.join(parts), Gem.user_dir
|
||||
end
|
||||
@@ -1429,7 +1430,7 @@ def test_self_vendor_dir
|
||||
FileUtils.mkdir_p File.join(parts)
|
||||
|
||||
@@ -1447,7 +1448,7 @@ def test_self_vendor_dir
|
||||
vendordir(File.join(@tempdir, 'vendor')) do
|
||||
expected =
|
||||
File.join RbConfig::CONFIG['vendordir'], 'gems',
|
||||
|
|
@ -274,15 +274,15 @@ diff --git a/configure.ac b/configure.ac
|
|||
index a00f2b6776..999e2d6d5d 100644
|
||||
--- a/configure.ac
|
||||
+++ b/configure.ac
|
||||
@@ -98,7 +98,7 @@ RUBY_BASE_NAME=`echo ruby | sed "$program_transform_name"`
|
||||
@@ -81,7 +81,7 @@ RUBY_BASE_NAME=`echo ruby | sed "$program_transform_name"`
|
||||
RUBYW_BASE_NAME=`echo rubyw | sed "$program_transform_name"`
|
||||
AC_SUBST(RUBY_BASE_NAME)
|
||||
AC_SUBST(RUBYW_BASE_NAME)
|
||||
-AC_SUBST(RUBY_VERSION_NAME, '${RUBY_BASE_NAME}-${ruby_version}')
|
||||
+AC_SUBST(RUBY_VERSION_NAME, '${RUBY_BASE_NAME}-${ruby_version_dir_name}')
|
||||
|
||||
AC_CANONICAL_TARGET
|
||||
test x"$target_alias" = x &&
|
||||
dnl checks for alternative programs
|
||||
AC_CANONICAL_BUILD
|
||||
--
|
||||
2.1.0
|
||||
|
||||
|
|
|
|||
|
|
@ -8,122 +8,20 @@ on Red Hat platforms.
|
|||
|
||||
This workaround rhbz#1361037
|
||||
---
|
||||
test/fiddle/helper.rb | 105 ------------------------------------------
|
||||
1 file changed, 105 deletions(-)
|
||||
test/fiddle/helper.rb | 3 +++
|
||||
1 file changed, 3 insertions(+)
|
||||
|
||||
diff --git a/test/fiddle/helper.rb b/test/fiddle/helper.rb
|
||||
index 1da3d93..65148a1 100644
|
||||
--- a/test/fiddle/helper.rb
|
||||
+++ b/test/fiddle/helper.rb
|
||||
@@ -6,111 +6,6 @@
|
||||
@@ -139,6 +139,9 @@
|
||||
libc_so = libm_so = "/usr/lib/libSystem.B.dylib"
|
||||
end
|
||||
|
||||
libc_so = libm_so = nil
|
||||
|
||||
-case RUBY_PLATFORM
|
||||
-when /cygwin/
|
||||
- libc_so = "cygwin1.dll"
|
||||
- libm_so = "cygwin1.dll"
|
||||
-when /android/
|
||||
- libdir = '/system/lib'
|
||||
- if [0].pack('L!').size == 8
|
||||
- libdir = '/system/lib64'
|
||||
- end
|
||||
- libc_so = File.join(libdir, "libc.so")
|
||||
- libm_so = File.join(libdir, "libm.so")
|
||||
-when /linux/
|
||||
- libdir = '/lib'
|
||||
- case RbConfig::SIZEOF['void*']
|
||||
- when 4
|
||||
- # 32-bit ruby
|
||||
- case RUBY_PLATFORM
|
||||
- when /armv\w+-linux/
|
||||
- # In the ARM 32-bit libc package such as libc6:armhf libc6:armel,
|
||||
- # libc.so and libm.so are installed to /lib/arm-linux-gnu*.
|
||||
- # It's not installed to /lib32.
|
||||
- dirs = Dir.glob('/lib/arm-linux-gnu*')
|
||||
- libdir = dirs[0] if dirs && File.directory?(dirs[0])
|
||||
- else
|
||||
- libdir = '/lib32' if File.directory? '/lib32'
|
||||
- end
|
||||
- when 8
|
||||
- # 64-bit ruby
|
||||
- libdir = '/lib64' if File.directory? '/lib64'
|
||||
- end
|
||||
- libc_so = File.join(libdir, "libc.so.6")
|
||||
- libm_so = File.join(libdir, "libm.so.6")
|
||||
-when /mingw/, /mswin/
|
||||
- require "rbconfig"
|
||||
- crtname = RbConfig::CONFIG["RUBY_SO_NAME"][/msvc\w+/] || 'ucrtbase'
|
||||
- libc_so = libm_so = "#{crtname}.dll"
|
||||
-when /darwin/
|
||||
- libc_so = "/usr/lib/libc.dylib"
|
||||
- libm_so = "/usr/lib/libm.dylib"
|
||||
-when /kfreebsd/
|
||||
- libc_so = "/lib/libc.so.0.1"
|
||||
- libm_so = "/lib/libm.so.1"
|
||||
-when /gnu/ #GNU/Hurd
|
||||
- libc_so = "/lib/libc.so.0.3"
|
||||
- libm_so = "/lib/libm.so.6"
|
||||
-when /mirbsd/
|
||||
- libc_so = "/usr/lib/libc.so.41.10"
|
||||
- libm_so = "/usr/lib/libm.so.7.0"
|
||||
-when /freebsd/
|
||||
- libc_so = "/lib/libc.so.7"
|
||||
- libm_so = "/lib/libm.so.5"
|
||||
-when /bsd|dragonfly/
|
||||
- libc_so = "/usr/lib/libc.so"
|
||||
- libm_so = "/usr/lib/libm.so"
|
||||
-when /solaris/
|
||||
- libdir = '/lib'
|
||||
- case RbConfig::SIZEOF['void*']
|
||||
- when 4
|
||||
- # 32-bit ruby
|
||||
- libdir = '/lib' if File.directory? '/lib'
|
||||
- when 8
|
||||
- # 64-bit ruby
|
||||
- libdir = '/lib/64' if File.directory? '/lib/64'
|
||||
- end
|
||||
- libc_so = File.join(libdir, "libc.so")
|
||||
- libm_so = File.join(libdir, "libm.so")
|
||||
-when /aix/
|
||||
- pwd=Dir.pwd
|
||||
- libc_so = libm_so = "#{pwd}/libaixdltest.so"
|
||||
- unless File.exist? libc_so
|
||||
- cobjs=%w!strcpy.o!
|
||||
- mobjs=%w!floats.o sin.o!
|
||||
- funcs=%w!sin sinf strcpy strncpy!
|
||||
- expfile='dltest.exp'
|
||||
- require 'tmpdir'
|
||||
- Dir.mktmpdir do |dir|
|
||||
- begin
|
||||
- Dir.chdir dir
|
||||
- %x!/usr/bin/ar x /usr/lib/libc.a #{cobjs.join(' ')}!
|
||||
- %x!/usr/bin/ar x /usr/lib/libm.a #{mobjs.join(' ')}!
|
||||
- %x!echo "#{funcs.join("\n")}\n" > #{expfile}!
|
||||
- require 'rbconfig'
|
||||
- if RbConfig::CONFIG["GCC"] = 'yes'
|
||||
- lflag='-Wl,'
|
||||
- else
|
||||
- lflag=''
|
||||
- end
|
||||
- flags="#{lflag}-bE:#{expfile} #{lflag}-bnoentry -lm"
|
||||
- %x!#{RbConfig::CONFIG["LDSHARED"]} -o #{libc_so} #{(cobjs+mobjs).join(' ')} #{flags}!
|
||||
- ensure
|
||||
- Dir.chdir pwd
|
||||
- end
|
||||
- end
|
||||
- end
|
||||
-else
|
||||
- libc_so = ARGV[0] if ARGV[0] && ARGV[0][0] == ?/
|
||||
- libm_so = ARGV[1] if ARGV[1] && ARGV[1][0] == ?/
|
||||
- if( !(libc_so && libm_so) )
|
||||
- $stderr.puts("libc and libm not found: #{$0} <libc> <libm>")
|
||||
- end
|
||||
-end
|
||||
-
|
||||
-libc_so = nil if !libc_so || (libc_so[0] == ?/ && !File.file?(libc_so))
|
||||
-libm_so = nil if !libm_so || (libm_so[0] == ?/ && !File.file?(libm_so))
|
||||
-
|
||||
+# Just ignore the heuristic, because it is not reliable on all platforms.
|
||||
+libc_so = libm_so = nil
|
||||
+
|
||||
if !libc_so || !libm_so
|
||||
ruby = EnvUtil.rubybin
|
||||
# When the ruby binary is 32-bit and the host is 64-bit,
|
||||
|
|
|
|||
|
|
@ -1,182 +0,0 @@
|
|||
From f46bac1f3e8634e24c747d06b28e11b874f1e488 Mon Sep 17 00:00:00 2001
|
||||
From: Kazuki Yamaguchi <k@rhe.jp>
|
||||
Date: Thu, 16 Aug 2018 19:40:48 +0900
|
||||
Subject: [PATCH] config: support .include directive
|
||||
|
||||
OpenSSL 1.1.1 introduces a new '.include' directive. Update our config
|
||||
parser to support that.
|
||||
|
||||
As mentioned in the referenced GitHub issue, we should use the OpenSSL
|
||||
API instead of implementing the parsing logic ourselves, but it will
|
||||
need backwards-incompatible changes which we can't backport to stable
|
||||
versions. So continue to use the Ruby implementation for now.
|
||||
|
||||
Reference: https://github.com/ruby/openssl/issues/208
|
||||
---
|
||||
ext/openssl/lib/openssl/config.rb | 54 ++++++++++++++++++++-----------
|
||||
test/openssl/test_config.rb | 54 +++++++++++++++++++++++++++++++
|
||||
2 files changed, 90 insertions(+), 18 deletions(-)
|
||||
|
||||
diff --git a/ext/openssl/lib/openssl/config.rb b/ext/openssl/lib/openssl/config.rb
|
||||
index 88225451..ba3a54c8 100644
|
||||
--- a/ext/openssl/lib/openssl/config.rb
|
||||
+++ b/ext/openssl/lib/openssl/config.rb
|
||||
@@ -77,29 +77,44 @@ def get_key_string(data, section, key) # :nodoc:
|
||||
def parse_config_lines(io)
|
||||
section = 'default'
|
||||
data = {section => {}}
|
||||
- while definition = get_definition(io)
|
||||
+ io_stack = [io]
|
||||
+ while definition = get_definition(io_stack)
|
||||
definition = clear_comments(definition)
|
||||
next if definition.empty?
|
||||
- if definition[0] == ?[
|
||||
+ case definition
|
||||
+ when /\A\[/
|
||||
if /\[([^\]]*)\]/ =~ definition
|
||||
section = $1.strip
|
||||
data[section] ||= {}
|
||||
else
|
||||
raise ConfigError, "missing close square bracket"
|
||||
end
|
||||
- else
|
||||
- if /\A([^:\s]*)(?:::([^:\s]*))?\s*=(.*)\z/ =~ definition
|
||||
- if $2
|
||||
- section = $1
|
||||
- key = $2
|
||||
- else
|
||||
- key = $1
|
||||
+ when /\A\.include (\s*=\s*)?(.+)\z/
|
||||
+ path = $2
|
||||
+ if File.directory?(path)
|
||||
+ files = Dir.glob(File.join(path, "*.{cnf,conf}"), File::FNM_EXTGLOB)
|
||||
+ else
|
||||
+ files = [path]
|
||||
+ end
|
||||
+
|
||||
+ files.each do |filename|
|
||||
+ begin
|
||||
+ io_stack << StringIO.new(File.read(filename))
|
||||
+ rescue
|
||||
+ raise ConfigError, "could not include file '%s'" % filename
|
||||
end
|
||||
- value = unescape_value(data, section, $3)
|
||||
- (data[section] ||= {})[key] = value.strip
|
||||
+ end
|
||||
+ when /\A([^:\s]*)(?:::([^:\s]*))?\s*=(.*)\z/
|
||||
+ if $2
|
||||
+ section = $1
|
||||
+ key = $2
|
||||
else
|
||||
- raise ConfigError, "missing equal sign"
|
||||
+ key = $1
|
||||
end
|
||||
+ value = unescape_value(data, section, $3)
|
||||
+ (data[section] ||= {})[key] = value.strip
|
||||
+ else
|
||||
+ raise ConfigError, "missing equal sign"
|
||||
end
|
||||
end
|
||||
data
|
||||
@@ -212,10 +227,10 @@ def clear_comments(line)
|
||||
scanned.join
|
||||
end
|
||||
|
||||
- def get_definition(io)
|
||||
- if line = get_line(io)
|
||||
+ def get_definition(io_stack)
|
||||
+ if line = get_line(io_stack)
|
||||
while /[^\\]\\\z/ =~ line
|
||||
- if extra = get_line(io)
|
||||
+ if extra = get_line(io_stack)
|
||||
line += extra
|
||||
else
|
||||
break
|
||||
@@ -225,9 +240,12 @@ def get_definition(io)
|
||||
end
|
||||
end
|
||||
|
||||
- def get_line(io)
|
||||
- if line = io.gets
|
||||
- line.gsub(/[\r\n]*/, '')
|
||||
+ def get_line(io_stack)
|
||||
+ while io = io_stack.last
|
||||
+ if line = io.gets
|
||||
+ return line.gsub(/[\r\n]*/, '')
|
||||
+ end
|
||||
+ io_stack.pop
|
||||
end
|
||||
end
|
||||
end
|
||||
diff --git a/test/openssl/test_config.rb b/test/openssl/test_config.rb
|
||||
index 99dcc497..5653b5d0 100644
|
||||
--- a/test/openssl/test_config.rb
|
||||
+++ b/test/openssl/test_config.rb
|
||||
@@ -120,6 +120,49 @@ def test_s_parse_format
|
||||
assert_equal("error in line 7: missing close square bracket", excn.message)
|
||||
end
|
||||
|
||||
+ def test_s_parse_include
|
||||
+ in_tmpdir("ossl-config-include-test") do |dir|
|
||||
+ Dir.mkdir("child")
|
||||
+ File.write("child/a.conf", <<~__EOC__)
|
||||
+ [default]
|
||||
+ file-a = a.conf
|
||||
+ [sec-a]
|
||||
+ a = 123
|
||||
+ __EOC__
|
||||
+ File.write("child/b.cnf", <<~__EOC__)
|
||||
+ [default]
|
||||
+ file-b = b.cnf
|
||||
+ [sec-b]
|
||||
+ b = 123
|
||||
+ __EOC__
|
||||
+ File.write("include-child.conf", <<~__EOC__)
|
||||
+ key_outside_section = value_a
|
||||
+ .include child
|
||||
+ __EOC__
|
||||
+
|
||||
+ include_file = <<~__EOC__
|
||||
+ [default]
|
||||
+ file-main = unnamed
|
||||
+ [sec-main]
|
||||
+ main = 123
|
||||
+ .include = include-child.conf
|
||||
+ __EOC__
|
||||
+
|
||||
+ # Include a file by relative path
|
||||
+ c1 = OpenSSL::Config.parse(include_file)
|
||||
+ assert_equal(["default", "sec-a", "sec-b", "sec-main"], c1.sections.sort)
|
||||
+ assert_equal(["file-main", "file-a", "file-b"], c1["default"].keys)
|
||||
+ assert_equal({"a" => "123"}, c1["sec-a"])
|
||||
+ assert_equal({"b" => "123"}, c1["sec-b"])
|
||||
+ assert_equal({"main" => "123", "key_outside_section" => "value_a"}, c1["sec-main"])
|
||||
+
|
||||
+ # Relative paths are from the working directory
|
||||
+ assert_raise(OpenSSL::ConfigError) do
|
||||
+ Dir.chdir("child") { OpenSSL::Config.parse(include_file) }
|
||||
+ end
|
||||
+ end
|
||||
+ end
|
||||
+
|
||||
def test_s_load
|
||||
# alias of new
|
||||
c = OpenSSL::Config.load
|
||||
@@ -299,6 +342,17 @@ def test_clone
|
||||
@it['newsection'] = {'a' => 'b'}
|
||||
assert_not_equal(@it.sections.sort, c.sections.sort)
|
||||
end
|
||||
+
|
||||
+ private
|
||||
+
|
||||
+ def in_tmpdir(*args)
|
||||
+ Dir.mktmpdir(*args) do |dir|
|
||||
+ dir = File.realpath(dir)
|
||||
+ Dir.chdir(dir) do
|
||||
+ yield dir
|
||||
+ end
|
||||
+ end
|
||||
+ end
|
||||
end
|
||||
|
||||
end
|
||||
|
|
@ -15,7 +15,7 @@ To keep the things simple for now, load the ABRT hook via C.
|
|||
[4]: https://github.com/ruby/ruby/pull/2735
|
||||
[5]: https://lists.fedoraproject.org/archives/list/ruby-sig@lists.fedoraproject.org/message/LH6L6YJOYQT4Y5ZNOO4SLIPTUWZ5V45Q/
|
||||
---
|
||||
abrt.c | 12 ++++++++++++++
|
||||
abrt.c | 12 ++++++++++++
|
||||
common.mk | 3 ++-
|
||||
ruby.c | 4 ++++
|
||||
3 files changed, 18 insertions(+), 1 deletion(-)
|
||||
|
|
@ -57,7 +57,7 @@ diff --git a/ruby.c b/ruby.c
|
|||
index 60c57d6259..1eec16f2c8 100644
|
||||
--- a/ruby.c
|
||||
+++ b/ruby.c
|
||||
@@ -1439,10 +1439,14 @@ proc_options(long argc, char **argv, ruby_cmdline_options_t *opt, int envopt)
|
||||
@@ -1489,10 +1489,14 @@ proc_options(long argc, char **argv, ruby_cmdline_options_t *opt, int envopt)
|
||||
|
||||
void Init_builtin_features(void);
|
||||
|
||||
|
|
|
|||
|
|
@ -1,32 +0,0 @@
|
|||
From 6532dbecf36d1f24dab1f2143afd171e0b7699eb Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?V=C3=ADt=20Ondruch?= <vondruch@redhat.com>
|
||||
Date: Wed, 4 Sep 2019 15:07:07 +0200
|
||||
Subject: [PATCH] Remove RubyGems dependency.
|
||||
|
||||
Since `Process::RLIMIT_NOFILE` is platform specific, better to use Ruby
|
||||
introspection than detecting platform.
|
||||
---
|
||||
.../vendor/net-http-persistent/lib/net/http/persistent.rb | 6 +++---
|
||||
1 file changed, 3 insertions(+), 3 deletions(-)
|
||||
|
||||
diff --git a/lib/bundler/vendor/net-http-persistent/lib/net/http/persistent.rb b/lib/bundler/vendor/net-http-persistent/lib/net/http/persistent.rb
|
||||
index a54be2a..06739f1 100644
|
||||
--- a/lib/bundler/vendor/net-http-persistent/lib/net/http/persistent.rb
|
||||
+++ b/lib/bundler/vendor/net-http-persistent/lib/net/http/persistent.rb
|
||||
@@ -202,10 +202,10 @@ class Bundler::Persistent::Net::HTTP::Persistent
|
||||
##
|
||||
# The default connection pool size is 1/4 the allowed open files.
|
||||
|
||||
- if Gem.win_platform? then
|
||||
- DEFAULT_POOL_SIZE = 256
|
||||
- else
|
||||
+ if Process.const_defined? :RLIMIT_NOFILE
|
||||
DEFAULT_POOL_SIZE = Process.getrlimit(Process::RLIMIT_NOFILE).first / 4
|
||||
+ else
|
||||
+ DEFAULT_POOL_SIZE = 256
|
||||
end
|
||||
|
||||
##
|
||||
--
|
||||
2.23.0
|
||||
|
||||
|
|
@ -0,0 +1,34 @@
|
|||
From 9b42fce32bff25e0569581f76f532b9d57865aef Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?V=C3=ADt=20Ondruch?= <vondruch@redhat.com>
|
||||
Date: Mon, 27 Jul 2020 14:56:05 +0200
|
||||
Subject: [PATCH] Timeout the test_bug_reporter_add witout raising error.
|
||||
|
||||
While timeouting the threads might be still good idea, it does not seems
|
||||
the timeout impacts the TestBugReporter#test_bug_reporter_add result,
|
||||
because the output of the child process has been already collected
|
||||
earlier.
|
||||
|
||||
It seems that when the system is under heavy load, the thread might not
|
||||
be sheduled to finish its processing. Even finishing the child process
|
||||
might take tens of seconds and therefore the test case finish might take
|
||||
a while.
|
||||
---
|
||||
test/-ext-/bug_reporter/test_bug_reporter.rb | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/test/-ext-/bug_reporter/test_bug_reporter.rb b/test/-ext-/bug_reporter/test_bug_reporter.rb
|
||||
index 628fcd0340..2c677cc8a7 100644
|
||||
--- a/test/-ext-/bug_reporter/test_bug_reporter.rb
|
||||
+++ b/test/-ext-/bug_reporter/test_bug_reporter.rb
|
||||
@@ -21,7 +21,7 @@ def test_bug_reporter_add
|
||||
args = ["--disable-gems", "-r-test-/bug_reporter",
|
||||
"-C", tmpdir]
|
||||
stdin = "register_sample_bug_reporter(12345); Process.kill :SEGV, $$"
|
||||
- assert_in_out_err(args, stdin, [], expected_stderr, encoding: "ASCII-8BIT")
|
||||
+ assert_in_out_err(args, stdin, [], expected_stderr, encoding: "ASCII-8BIT", timeout_error: nil)
|
||||
ensure
|
||||
FileUtils.rm_rf(tmpdir) if tmpdir
|
||||
end
|
||||
--
|
||||
2.27.0
|
||||
|
||||
2
sources
2
sources
|
|
@ -1 +1 @@
|
|||
SHA512 (ruby-2.7.0.tar.xz) = dd5690c631bf3a2b76cdc06902bcd76a89713a045e136debab9b8a81ff8c433bbb254aa09e4014ca1cf85a69ff4bcb13de11da5e40c224e7268be43ef2194af7
|
||||
SHA512 (ruby-3.0.0.tar.xz) = 2a23c2894e62e24bb20cec6b2a016b66d7df05083668726b6f70af8338211cfec417aa3624290d1f5ccd130f65ee7b52b5db7d428abc4a9460459c9a5dd1a450
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue