extra/ruby to 2.1.1-1

This commit is contained in:
Kevin Mihelich 2014-03-07 18:43:52 +00:00
parent f3d065e120
commit 427a4727eb
4 changed files with 34 additions and 109 deletions

View file

@ -1,84 +0,0 @@
From f5bbf838c8b13369a61c6756355305388df5824f Mon Sep 17 00:00:00 2001
From: Tim Moore <tmoore@incrementalism.net>
Date: Tue, 31 Dec 2013 17:39:45 +1100
Subject: [PATCH] Fix installing gem from file without dependencies.
Commit 9437ccc fixed the ability to install remote gems that was accidentally
broken by d97fba1, but in the process accidentally broke installing from local
files.
This also changes the order to check for local first, to avoid unnecessary
network requests in the case where the gem is local.
Closes #760.
---
lib/rubygems/commands/install_command.rb | 20 ++++++++++++--------
test/rubygems/test_gem_commands_install_command.rb | 14 ++++++++++++++
2 files changed, 26 insertions(+), 8 deletions(-)
diff --git a/lib/rubygems/commands/install_command.rb b/lib/rubygems/commands/install_command.rb
index 4485eb1..8219eef 100644
--- a/lib/rubygems/commands/install_command.rb
+++ b/lib/rubygems/commands/install_command.rb
@@ -228,7 +228,18 @@ to write the specification by hand. For example:
def install_gem_without_dependencies name, req # :nodoc:
gem = nil
- if remote? then
+ if local? then
+ if name =~ /\.gem$/ and File.file? name then
+ source = Gem::Source::SpecificFile.new name
+ spec = source.spec
+ else
+ source = Gem::Source::Local.new
+ spec = source.find_gem name, req
+ end
+ gem = source.download spec if spec
+ end
+
+ if remote? and not gem then
dependency = Gem::Dependency.new name, req
dependency.prerelease = options[:prerelease]
@@ -236,13 +247,6 @@ to write the specification by hand. For example:
gem = fetcher.download_to_cache dependency
end
- if local? and not gem then
- source = Gem::Source::Local.new
- spec = source.find_gem name, req
-
- gem = source.download spec
- end
-
inst = Gem::Installer.new gem, options
inst.install
diff --git a/test/rubygems/test_gem_commands_install_command.rb b/test/rubygems/test_gem_commands_install_command.rb
index 76ea6b4..a5917c0 100644
--- a/test/rubygems/test_gem_commands_install_command.rb
+++ b/test/rubygems/test_gem_commands_install_command.rb
@@ -560,6 +560,20 @@ ERROR: Possible alternatives: non_existent_with_hint
assert_equal %w[a-2], @cmd.installed_specs.map { |spec| spec.full_name }
end
+ def test_install_gem_ignore_dependencies_specific_file
+ spec = quick_spec 'a', 2
+
+ util_build_gem spec
+
+ FileUtils.mv spec.cache_file, @tempdir
+
+ @cmd.options[:ignore_dependencies] = true
+
+ @cmd.install_gem File.join(@tempdir, spec.file_name), nil
+
+ assert_equal %w[a-2], @cmd.installed_specs.map { |spec| spec.full_name }
+ end
+
def test_parses_requirement_from_gemname
spec_fetcher do |fetcher|
fetcher.gem 'a', 2
--
1.8.5.2

View file

@ -0,0 +1,26 @@
From 4c4da3fc650a3595ecc06f49072f1ffae07db706 Mon Sep 17 00:00:00 2001
From: Thomas Dziedzic <gostrc@gmail.com>
Date: Sat, 1 Mar 2014 21:41:28 -0800
Subject: [PATCH] Fix undeclared identifier error by using the actual type of
rl_pre_input_hook
---
ext/readline/readline.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/ext/readline/readline.c b/ext/readline/readline.c
index 659adb9..7bc0eed 100644
--- a/ext/readline/readline.c
+++ b/ext/readline/readline.c
@@ -1974,7 +1974,7 @@ Init_readline()
rl_attempted_completion_function = readline_attempted_completion_function;
#if defined(HAVE_RL_PRE_INPUT_HOOK)
- rl_pre_input_hook = (Function *)readline_pre_input_hook;
+ rl_pre_input_hook = (rl_hook_func_t *)readline_pre_input_hook;
#endif
#ifdef HAVE_RL_CATCH_SIGNALS
rl_catch_signals = 0;
--
1.9.0

View file

@ -8,8 +8,8 @@
# - patch to fix running ruby on v5 (#705)
pkgname=('ruby' 'ruby-docs')
pkgver=2.1.0
pkgrel=2.1
pkgver=2.1.1
pkgrel=1
arch=('i686' 'x86_64')
url='http://www.ruby-lang.org/en/'
license=('BSD' 'custom')
@ -18,25 +18,21 @@ license=('BSD' 'custom')
# wait for upstream to start supporting tk 8.6
makedepends=('gdbm' 'openssl' 'libffi' 'doxygen' 'graphviz' 'libyaml') # 'tk'
options=('!emptydirs' '!makeflags' 'staticlibs')
source=("http://cache.ruby-lang.org/pub/ruby/ruby-${pkgver}.tar.bz2"
source=("http://cache.ruby-lang.org/pub/ruby/${pkgver:0:3}/ruby-${pkgver}.tar.bz2"
'gemrc'
'0001-Fix-installing-gem-from-file-without-dependencies.patch'
'changeset_r45225.diff'
'0001-Fix-undeclared-identifier-error-by-using-the-actual-.patch'
'0002-Use-only-unsigned-long-for-rb_serial_t.patch')
md5sums=('1546eeb763ac7754365664be763a1e8f'
'6fb8e7a09955e0f64be3158fb4a27e7a'
'61a1507f260866805fc6451c14733b25'
'64839e135447accd2e0568c563e12d23'
'0496e962e0ce11507b7577a8eb93af58'
'f6f9c200c5e9afc4d5b21575da4821a2')
build() {
cd ruby-${pkgver}
# fixes https://github.com/rubygems/rubygems/issues/760
patch -Np1 -i ${srcdir}/0001-Fix-installing-gem-from-file-without-dependencies.patch
# fixes https://bugs.ruby-lang.org/issues/9578
patch -Np0 -i ../changeset_r45225.diff
# readline 6.3 doesn't define Function anymore
# https://bugs.ruby-lang.org/issues/9578
patch -Np1 -i ${srcdir}/0001-Fix-undeclared-identifier-error-by-using-the-actual-.patch
# fixes https://bugs.ruby-lang.org/issues/9507
[[ $CARCH == 'arm' ]] && patch -Np1 -i ../0002-Use-only-unsigned-long-for-rb_serial_t.patch

View file

@ -1,13 +0,0 @@
Index: ext/readline/readline.c
===================================================================
--- ext/readline/readline.c (revision 45224)
+++ ext/readline/readline.c (revision 45225)
@@ -1974,7 +1974,7 @@
rl_attempted_completion_function = readline_attempted_completion_function;
#if defined(HAVE_RL_PRE_INPUT_HOOK)
- rl_pre_input_hook = (Function *)readline_pre_input_hook;
+ rl_pre_input_hook = (rl_hook_func_t *)readline_pre_input_hook;
#endif
#ifdef HAVE_RL_CATCH_SIGNALS
rl_catch_signals = 0;