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

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