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

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