~ubuntu-branches/ubuntu/quantal/ruby1.9.1/quantal

« back to all changes in this revision

Viewing changes to debian/patches/100518_load_libc_libm.diff

  • Committer: Bazaar Package Importer
  • Author(s): Lucas Nussbaum
  • Date: 2011-09-24 19:16:17 UTC
  • mfrom: (1.1.8 upstream) (13.1.7 experimental)
  • Revision ID: james.westby@ubuntu.com-20110924191617-o1qz4rcmqjot8zuy
Tags: 1.9.3~rc1-1
* New upstream release: 1.9.3 RC1.
  + Includes load.c fixes. Closes: #639959.
* Upload to unstable.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
#! /bin/sh /usr/share/dpatch/dpatch-run
2
 
## 100518_load_libc_libm.dpatch by Lucas Nussbaum <lucas@lucas-nussbaum.net>
3
 
##
4
 
## All lines beginning with `## DP:' are a description of the patch.
5
 
## DP: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=560293
6
 
## DP: ruby1.9.1: test fails to load libc and libm on GNU/kFreeBSD
7
 
 
8
 
@DPATCH@
9
 
Index: b/test/dl/test_base.rb
10
 
===================================================================
11
 
--- a/test/dl/test_base.rb      2010-07-20 21:45:44.000000000 +0900
12
 
+++ b/test/dl/test_base.rb      2010-07-20 21:46:19.000000000 +0900
13
 
@@ -1,42 +1,9 @@
14
 
 require 'test/unit'
15
 
 require 'dl'
16
 
 
17
 
-case RUBY_PLATFORM
18
 
-when /cygwin/
19
 
-  LIBC_SO = "cygwin1.dll"
20
 
-  LIBM_SO = "cygwin1.dll"
21
 
-when /x86_64-linux/
22
 
-  LIBC_SO = "/lib64/libc.so.6"
23
 
-  LIBM_SO = "/lib64/libm.so.6"
24
 
-when /linux/
25
 
-  libdir = '/lib'
26
 
-  case [0].pack('L!').size
27
 
-  when 4
28
 
-    # 32-bit ruby
29
 
-    libdir = '/lib32' if File.directory? '/lib32'
30
 
-  when 8
31
 
-    # 64-bit ruby
32
 
-    libdir = '/lib64' if File.directory? '/lib64'
33
 
-  end
34
 
-  LIBC_SO = File.join(libdir, "libc.so.6")
35
 
-  LIBM_SO = File.join(libdir, "libm.so.6")
36
 
-when /mingw/, /mswin32/
37
 
-  LIBC_SO = "msvcrt.dll"
38
 
-  LIBM_SO = "msvcrt.dll"
39
 
-when /darwin/
40
 
-  LIBC_SO = "/usr/lib/libc.dylib"
41
 
-  LIBM_SO = "/usr/lib/libm.dylib"
42
 
-when /bsd/
43
 
-  LIBC_SO = "/usr/lib/libc.so"
44
 
-  LIBM_SO = "/usr/lib/libm.so"
45
 
-else
46
 
-  LIBC_SO = ARGV[0]
47
 
-  LIBM_SO = ARGV[1]
48
 
-  if( !(LIBC_SO && LIBM_SO) )
49
 
-    $stderr.puts("#{$0} <libc> <libm>")
50
 
-    exit
51
 
-  end
52
 
-end
53
 
+# hack, but likely more reliable than the original code
54
 
+LIBC_SO = Dir::glob('/lib/libc.so.*')[0]
55
 
+LIBM_SO = Dir::glob('/lib/libm.so.*')[0]
56
 
 
57
 
 module DL
58
 
   class TestBase < Test::Unit::TestCase