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

99 lines
3.6 KiB
Diff
Raw Normal View History

2013-10-07 10:30:18 +00:00
From 35b8c14ddc7f9b38c21c15dfecefa3dff7567981 Mon Sep 17 00:00:00 2001
2013-02-08 23:54:37 +00:00
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.
---
2013-10-07 10:30:18 +00:00
configure.in | 15 +++++++++------
loadpath.c | 4 ++++
2 files changed, 13 insertions(+), 6 deletions(-)
2013-02-08 23:54:37 +00:00
diff --git a/configure.in b/configure.in
2013-10-07 10:30:18 +00:00
index 881449e..37d9a62 100644
2013-02-08 23:54:37 +00:00
--- a/configure.in
+++ b/configure.in
2013-10-07 10:30:18 +00:00
@@ -3535,8 +3535,6 @@ AC_ARG_WITH(rubylibprefix,
fi
rubylibprefix="$withval"])
AC_SUBST(rubylibprefix)
-rubylibdir='${rubylibprefix}/${ruby_version}'
-rubyarchdir=${multiarch+'${rubyarchprefix}/${ruby_version}'}${multiarch-'${rubylibdir}/${arch}'}
rubyarchprefix=${multiarch+'${archlibdir}/${RUBY_BASE_NAME}'}${multiarch-'${rubylibprefix}/${arch}'}
AC_ARG_WITH(rubyarchprefix,
@@ -3566,6 +3564,7 @@ AC_ARG_WITH(ruby-version,
[ruby_version=full])
unset RUBY_LIB_VERSION
unset RUBY_LIB_VERSION_STYLE
+ruby_version_suffix=/'${ruby_version}'
AS_CASE(["$ruby_version"],
[full], [RUBY_LIB_VERSION_STYLE='3 /* full */'],
[minor], [RUBY_LIB_VERSION_STYLE='2 /* minor */'])
@@ -3582,30 +3581,34 @@ if test ${RUBY_LIB_VERSION_STYLE+set}; then
ruby_version="`$CPP -I. -I"${srcdir}" -I"${srcdir}/include" conftest.c | sed '/^ruby_version=/!d;s/ //g'`"
eval $ruby_version
elif test -z "${ruby_version}"; then
- AC_MSG_ERROR([No ruby version, No place for bundled libraries])
+ unset ruby_version_suffix
+ AC_DEFINE(RUBY_LIB_VERSION_BLANK, 1)
2013-02-08 23:54:37 +00:00
else
2013-10-07 10:30:18 +00:00
RUBY_LIB_VERSION="\"${ruby_version}\""
2013-02-08 23:54:37 +00:00
fi
2013-10-07 10:30:18 +00:00
AC_SUBST(RUBY_LIB_VERSION_STYLE)
AC_SUBST(RUBY_LIB_VERSION)
2013-02-08 23:54:37 +00:00
2013-10-07 10:30:18 +00:00
+rubylibdir='${rubylibprefix}'${ruby_version_suffix}
+rubyarchdir=${multiarch+'${rubyarchprefix}'${ruby_version_suffix}}${multiarch-'${rubylibdir}/${arch}'}
+
AC_ARG_WITH(sitedir,
AS_HELP_STRING([--with-sitedir=DIR], [site libraries in DIR [[RUBY_LIB_PREFIX/site_ruby]], "no" to disable site directory]),
[sitedir=$withval],
[sitedir='${rubylibprefix}/site_ruby'])
-sitelibdir='${sitedir}/${ruby_version}'
+sitelibdir='${sitedir}'${ruby_version_suffix}
AC_ARG_WITH(sitearchdir,
AS_HELP_STRING([--with-sitearchdir=DIR],
[architecture dependent site libraries in DIR [[SITEDIR/SITEARCH]], "no" to disable site directory]),
[sitearchdir=$withval],
- [sitearchdir=${multiarch+'${rubysitearchprefix}/site_ruby/${ruby_version}'}${multiarch-'${sitelibdir}/${sitearch}'}])
+ [sitearchdir=${multiarch+'${rubysitearchprefix}/site_ruby'${ruby_version_suffix}}${multiarch-'${sitelibdir}/${sitearch}'}])
AC_ARG_WITH(vendordir,
AS_HELP_STRING([--with-vendordir=DIR], [vendor libraries in DIR [[RUBY_LIB_PREFIX/vendor_ruby]], "no" to disable vendor directory]),
[vendordir=$withval],
[vendordir='${rubylibprefix}/vendor_ruby'])
-vendorlibdir='${vendordir}/${ruby_version}'
+vendorlibdir='${vendordir}'${ruby_version_suffix}
AC_ARG_WITH(vendorarchdir,
AS_HELP_STRING([--with-vendorarchdir=DIR],
diff --git a/loadpath.c b/loadpath.c
index 9160031..623dc9d 100644
--- a/loadpath.c
+++ b/loadpath.c
@@ -65,7 +65,9 @@ const char ruby_initial_load_paths[] =
RUBY_SEARCH_PATH "\0"
2013-02-08 23:54:37 +00:00
#endif
2013-10-07 10:30:18 +00:00
#ifndef NO_RUBY_SITE_LIB
+#ifndef RUBY_LIB_VERSION_BLANK
RUBY_SITE_LIB2 "\0"
+#endif
#ifdef RUBY_THINARCH
2013-02-08 23:54:37 +00:00
RUBY_SITE_ARCH_LIB_FOR(RUBY_THINARCH) "\0"
#endif
2013-10-07 10:30:18 +00:00
@@ -74,7 +76,9 @@ const char ruby_initial_load_paths[] =
2013-02-08 23:54:37 +00:00
#endif
#ifndef NO_RUBY_VENDOR_LIB
+#ifndef RUBY_LIB_VERSION_BLANK
2013-10-07 10:30:18 +00:00
RUBY_VENDOR_LIB2 "\0"
2013-02-08 23:54:37 +00:00
+#endif
#ifdef RUBY_THINARCH
2013-10-07 10:30:18 +00:00
RUBY_VENDOR_ARCH_LIB_FOR(RUBY_THINARCH) "\0"
#endif
2013-02-08 23:54:37 +00:00
--
2013-10-07 10:30:18 +00:00
1.8.3.1
2013-02-08 23:54:37 +00:00