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

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