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

81 lines
2.2 KiB
Diff
Raw Normal View History

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