1 Star 0 Fork 39

任义 / ruby

forked from src-openEuler / ruby 
Create your Gitee Account
Explore and code with more than 12 million developers,Free private repositories !:)
Sign up
This repository doesn't specify license. Please pay attention to the specific project description and its upstream code dependency when using it.
Clone or Download
ruby-2.1.0-Prevent-duplicated-paths-when-empty-version-string-i.patch 2.16 KB
Copy Edit Raw Blame History
桐小哥 authored 2023-07-27 20:53 . upgrade version to 3.2.2
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.
---
configure.ac | 3 ++-
loadpath.c | 12 ++++++++++++
tool/mkconfig.rb | 2 +-
3 files changed, 15 insertions(+), 2 deletions(-)
diff --git a/configure.ac b/configure.ac
index c42436c23d..d261ea57b5 100644
--- a/configure.ac
+++ b/configure.ac
@@ -4196,7 +4196,8 @@ AS_CASE(["$ruby_version_dir_name"],
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
@@ -65,21 +65,33 @@ const char ruby_initial_load_paths[] =
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
#endif
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
@@ -115,7 +115,7 @@
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$/
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/ren-yi43/ruby.git
git@gitee.com:ren-yi43/ruby.git
ren-yi43
ruby
ruby
master

Search

344bd9b3 5694891 D2dac590 5694891