Blame SOURCES/ruby-2.1.0-Prevent-duplicated-paths-when-empty-version-string-i.patch

a54e24
From e24d97c938c481450ed80ec83e5399595946c1ae Mon Sep 17 00:00:00 2001
a54e24
From: =?UTF-8?q?V=C3=ADt=20Ondruch?= <vondruch@redhat.com>
a54e24
Date: Fri, 8 Feb 2013 22:48:41 +0100
a54e24
Subject: [PATCH] Prevent duplicated paths when empty version string is
a54e24
 configured.
a54e24
a54e24
---
a54e24
 configure.ac     |  3 ++-
a54e24
 loadpath.c       | 12 ++++++++++++
a54e24
 tool/mkconfig.rb |  2 +-
a54e24
 3 files changed, 15 insertions(+), 2 deletions(-)
a54e24
a54e24
diff --git a/configure.ac b/configure.ac
a54e24
index 999e2d6d5d..11fc237552 100644
a54e24
--- a/configure.ac
a54e24
+++ b/configure.ac
9f47f6
@@ -3727,7 +3727,8 @@ AS_CASE(["$ruby_version_dir_name"],
a54e24
 ruby_version_dir=/'${ruby_version_dir_name}'
a54e24
 
a54e24
 if test -z "${ruby_version_dir_name}"; then
a54e24
-    AC_MSG_ERROR([No ruby version, No place for bundled libraries])
a54e24
+    unset ruby_version_dir
a54e24
+    AC_DEFINE(RUBY_LIB_VERSION_BLANK, 1)
a54e24
 fi
a54e24
 
a54e24
 rubylibdir='${rubylibprefix}'${ruby_version_dir}
a54e24
diff --git a/loadpath.c b/loadpath.c
a54e24
index 9160031..0d4d953 100644
a54e24
--- a/loadpath.c
a54e24
+++ b/loadpath.c
a54e24
@@ -65,21 +65,33 @@ const char ruby_initial_load_paths[] =
a54e24
     RUBY_SEARCH_PATH "\0"
a54e24
 #endif
a54e24
 #ifndef NO_RUBY_SITE_LIB
a54e24
+#ifdef RUBY_LIB_VERSION_BLANK
a54e24
+    RUBY_SITE_LIB "\0"
a54e24
+#else
a54e24
     RUBY_SITE_LIB2 "\0"
a54e24
+#endif
a54e24
 #ifdef RUBY_THINARCH
a54e24
     RUBY_SITE_ARCH_LIB_FOR(RUBY_THINARCH) "\0"
a54e24
 #endif
a54e24
     RUBY_SITE_ARCH_LIB_FOR(RUBY_SITEARCH) "\0"
a54e24
+#ifndef RUBY_LIB_VERSION_BLANK
a54e24
     RUBY_SITE_LIB "\0"
a54e24
 #endif
a54e24
+#endif
a54e24
 
a54e24
 #ifndef NO_RUBY_VENDOR_LIB
a54e24
+#ifdef RUBY_LIB_VERSION_BLANK
a54e24
+    RUBY_VENDOR_LIB "\0"
a54e24
+#else
a54e24
     RUBY_VENDOR_LIB2 "\0"
a54e24
+#endif
a54e24
 #ifdef RUBY_THINARCH
a54e24
     RUBY_VENDOR_ARCH_LIB_FOR(RUBY_THINARCH) "\0"
a54e24
 #endif
a54e24
     RUBY_VENDOR_ARCH_LIB_FOR(RUBY_SITEARCH) "\0"
a54e24
+#ifndef RUBY_LIB_VERSION_BLANK
a54e24
     RUBY_VENDOR_LIB "\0"
a54e24
+#endif
a54e24
 #endif
a54e24
 
a54e24
     RUBY_LIB "\0"
a54e24
diff --git a/tool/mkconfig.rb b/tool/mkconfig.rb
a54e24
index 07076d4..35e6c3c 100755
a54e24
--- a/tool/mkconfig.rb
a54e24
+++ b/tool/mkconfig.rb
a54e24
@@ -114,7 +114,7 @@
a54e24
     val = val.gsub(/\$(?:\$|\{?(\w+)\}?)/) {$1 ? "$(#{$1})" : $&}.dump
a54e24
     case name
a54e24
     when /^prefix$/
a54e24
-      val = "(TOPDIR || DESTDIR + #{val})"
a54e24
+      val = "(((TOPDIR && TOPDIR.empty?) ? nil : TOPDIR) || DESTDIR + #{val})"
a54e24
     when /^ARCH_FLAG$/
a54e24
       val = "arch_flag || #{val}" if universal
a54e24
     when /^UNIVERSAL_ARCHNAMES$/
a54e24
-- 
a54e24
1.9.0
a54e24