aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorakr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2014-05-18 07:43:45 +0000
committerakr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2014-05-18 07:43:45 +0000
commit778fd514821c0e19e1695eda5688b2898d268382 (patch)
treeb5d6fef44da37887458de1330b35e41bfc88e4d3
parentf4f71d6e6bfc7a678626734eef13364b1d0d78e5 (diff)
downloadruby-778fd514821c0e19e1695eda5688b2898d268382.tar.gz
* test/ruby/test_m17n_comb.rb (test_str_crypt): Use Etc.confstr to
detect the glibc version. libc.so is not an executable on Debian GNU/kFreeBSD 7.0 (wheezy). git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@45996 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r--ChangeLog6
-rw-r--r--test/ruby/test_m17n_comb.rb12
2 files changed, 12 insertions, 6 deletions
diff --git a/ChangeLog b/ChangeLog
index 7ee5b5a75d..2057e02b25 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+Sun May 18 16:42:08 2014 Tanaka Akira <akr@fsij.org>
+
+ * test/ruby/test_m17n_comb.rb (test_str_crypt): Use Etc.confstr to
+ detect the glibc version.
+ libc.so is not an executable on Debian GNU/kFreeBSD 7.0 (wheezy).
+
Sun May 18 12:15:54 2014 Jonathan Mukai-Heidt <johnnymukai@gmail.com>
* io.c (argf_each_line, argf_inplace_mode_set): [DOC] Update ARGF
diff --git a/test/ruby/test_m17n_comb.rb b/test/ruby/test_m17n_comb.rb
index ee43c746f8..8258f422a1 100644
--- a/test/ruby/test_m17n_comb.rb
+++ b/test/ruby/test_m17n_comb.rb
@@ -1,4 +1,5 @@
require 'test/unit'
+require 'etc'
require_relative 'allpairs'
class TestM17NComb < Test::Unit::TestCase
@@ -724,12 +725,11 @@ class TestM17NComb < Test::Unit::TestCase
end
def test_str_crypt
- begin
- # glibc 2.16 or later denies salt contained other than [0-9A-Za-z./] #7312
- glibcpath = `ldd #{RbConfig.ruby}`[/\S+\/libc.so\S+/]
- glibcver = `#{glibcpath}`[/\AGNU C Library.*version ([0-9.]+)/, 1].split('.').map(&:to_i)
- strict_crypt = (glibcver <=> [2, 16]) > -1
- rescue
+ strict_crypt = nil
+ # glibc 2.16 or later denies salt contained other than [0-9A-Za-z./] #7312
+ if defined? Etc::Etc::CS_GNU_LIBC_VERSION
+ glibcver = Etc.confstr(Etc::CS_GNU_LIBC_VERSION).scan(/\d+/).map(&:to_i)
+ strict_crypt = (glibcver <=> [2, 16]) >= 0
end
combination(STRINGS, STRINGS) {|str, salt|