]> git.pld-linux.org Git - packages/ruby.git/blob - duplicated-paths.patch
eb341075724e084838728c294f7a632e2cd6220d
[packages/ruby.git] / duplicated-paths.patch
1 From e24d97c938c481450ed80ec83e5399595946c1ae Mon Sep 17 00:00:00 2001
2 From: =?UTF-8?q?V=C3=ADt=20Ondruch?= <vondruch@redhat.com>
3 Date: Fri, 8 Feb 2013 22:48:41 +0100
4 Subject: [PATCH] Prevent duplicated paths when empty version string is
5  configured.
6
7 ---
8  configure.in     |  3 ++-
9  loadpath.c       | 12 ++++++++++++
10  tool/mkconfig.rb |  2 +-
11  3 files changed, 15 insertions(+), 2 deletions(-)
12
13 diff --git a/configure.in b/configure.in
14 index db37cd6..ce8d149 100644
15 --- a/configure.in
16 +++ b/configure.in
17 @@ -4228,7 +4228,8 @@ AS_CASE(["$ruby_version_dir_name"],
18  ruby_version_dir=/'${ruby_version_dir_name}'
19  
20  if test -z "${ruby_version_dir_name}"; then
21 -    AC_MSG_ERROR([No ruby version, No place for bundled libraries])
22 +    unset ruby_version_dir
23 +    AC_DEFINE(RUBY_LIB_VERSION_BLANK, 1)
24  fi
25  
26  rubylibdir='${rubylibprefix}'${ruby_version_dir}
27 diff --git a/loadpath.c b/loadpath.c
28 index 9160031..0d4d953 100644
29 --- a/loadpath.c
30 +++ b/loadpath.c
31 @@ -65,22 +65,34 @@ const char ruby_initial_load_paths[] =
32      RUBY_SEARCH_PATH "\0"
33  #endif
34  #ifndef NO_RUBY_SITE_LIB
35 +#ifdef RUBY_LIB_VERSION_BLANK
36 +    RUBY_SITE_LIB "\0"
37 +#else
38      RUBY_SITE_LIB2 "\0"
39 +#endif
40  #ifdef RUBY_THINARCH
41      RUBY_SITE_ARCH_LIB_FOR(RUBY_THINARCH) "\0"
42  #endif
43      RUBY_SITE_ARCH_LIB_FOR(RUBY_SITEARCH) "\0"
44 +#ifndef RUBY_LIB_VERSION_BLANK
45      RUBY_SITE_LIB "\0"
46  #endif
47 +#endif
48  
49  #ifndef NO_RUBY_VENDOR_LIB
50 +#ifdef RUBY_LIB_VERSION_BLANK
51 +    RUBY_VENDOR_LIB "\0"
52 +#else
53      RUBY_VENDOR_LIB2 "\0"
54 +#endif
55  #ifdef RUBY_THINARCH
56      RUBY_VENDOR_ARCH_LIB_FOR(RUBY_THINARCH) "\0"
57  #endif
58      RUBY_VENDOR_ARCH_LIB_FOR(RUBY_SITEARCH) "\0"
59 +#ifndef RUBY_LIB_VERSION_BLANK
60      RUBY_VENDOR_LIB "\0"
61  #endif
62 +#endif
63  
64      RUBY_LIB "\0"
65  #ifdef RUBY_THINARCH
66 diff --git a/tool/mkconfig.rb b/tool/mkconfig.rb
67 index 07076d4..35e6c3c 100755
68 --- a/tool/mkconfig.rb
69 +++ b/tool/mkconfig.rb
70 @@ -122,7 +122,7 @@ def config.write(arg)
71      val = val.gsub(/\$(?:\$|\{?(\w+)\}?)/) {$1 ? "$(#{$1})" : $&}.dump
72      case name
73      when /^prefix$/
74 -      val = "(TOPDIR || DESTDIR + #{val})"
75 +      val = "(((TOPDIR && TOPDIR.empty?) ? nil : TOPDIR) || DESTDIR + #{val})"
76      when /^ARCH_FLAG$/
77        val = "arch_flag || #{val}" if universal
78      when /^UNIVERSAL_ARCHNAMES$/
79 -- 
80 1.9.0
81
This page took 0.052339 seconds and 2 git commands to generate.