summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRichard Brown <rbrown@gentoo.org>2007-05-01 21:17:42 +0000
committerRichard Brown <rbrown@gentoo.org>2007-05-01 21:17:42 +0000
commit5fd431d8fc2a31289e1b037d7ce06d1eacb2cd40 (patch)
tree6c29cbf867784c8157f38f3cab3dec1d7d244687 /dev-lang/ruby/files
parentupstream updates (diff)
downloadgentoo-2-5fd431d8fc2a31289e1b037d7ce06d1eacb2cd40.tar.gz
gentoo-2-5fd431d8fc2a31289e1b037d7ce06d1eacb2cd40.tar.bz2
gentoo-2-5fd431d8fc2a31289e1b037d7ce06d1eacb2cd40.zip
Add new src_test, and add return code patch from [ruby-core:10609] and [ruby-core:10760]
(Portage version: 2.1.2.2)
Diffstat (limited to 'dev-lang/ruby/files')
-rw-r--r--dev-lang/ruby/files/digest-ruby-1.8.6-r13
-rw-r--r--dev-lang/ruby/files/ruby-1.8.6-exit-status.patch80
2 files changed, 83 insertions, 0 deletions
diff --git a/dev-lang/ruby/files/digest-ruby-1.8.6-r1 b/dev-lang/ruby/files/digest-ruby-1.8.6-r1
new file mode 100644
index 000000000000..a77335fc09d4
--- /dev/null
+++ b/dev-lang/ruby/files/digest-ruby-1.8.6-r1
@@ -0,0 +1,3 @@
+MD5 23d2494aa94e7ae1ecbbb8c5e1507683 ruby-1.8.6.tar.gz 4589394
+RMD160 a1ad902bb1311233cd3cf9db52ab2ec076a709f5 ruby-1.8.6.tar.gz 4589394
+SHA256 3ef37fb961d04471a1aef2c8079d6fab09932e3281d79859d5cd5d426bde0868 ruby-1.8.6.tar.gz 4589394
diff --git a/dev-lang/ruby/files/ruby-1.8.6-exit-status.patch b/dev-lang/ruby/files/ruby-1.8.6-exit-status.patch
new file mode 100644
index 000000000000..a86587f7a7be
--- /dev/null
+++ b/dev-lang/ruby/files/ruby-1.8.6-exit-status.patch
@@ -0,0 +1,80 @@
+Index: test/ruby/test_beginendblock.rb
+===================================================================
+--- test/ruby/test_beginendblock.rb (revision 12125)
++++ test/ruby/test_beginendblock.rb (revision 12126)
+@@ -54,4 +54,34 @@
+ assert_equal(expected, File.read(erroutpath))
+ # expecting Tempfile to unlink launcher and errout file.
+ end
++
++ def test_raise_in_at_exit
++ # [ruby-core:09675]
++ ruby = EnvUtil.rubybin
++ out = IO.popen("#{q(ruby)} -e 'STDERR.reopen(STDOUT);" \
++ "at_exit{raise %[SomethingBad]};" \
++ "raise %[SomethingElse]'") {|f|
++ f.read
++ }
++ assert_match /SomethingBad/, out
++ assert_match /SomethingElse/, out
++ end
++
++ def test_should_propagate_exit_code
++ ruby = EnvUtil.rubybin
++ assert_equal false, system("#{q(ruby)} -e 'at_exit{exit 2}'")
++ assert_equal 2, $?.exitstatus
++ assert_nil $?.termsig
++ end
++
++ def test_should_propagate_signaled
++ ruby = EnvUtil.rubybin
++ out = IO.popen("#{q(ruby)} -e 'STDERR.reopen(STDOUT);" \
++ "at_exit{Process.kill(:INT, $$)}'"){|f|
++ f.read
++ }
++ assert_match /Interrupt$/, out
++ assert_nil $?.exitstatus
++ assert_equal Signal.list["INT"], $?.termsig
++ end
+ end
+Index: eval.c
+===================================================================
+--- eval.c (revision 12125)
++++ eval.c (revision 12126)
+@@ -1562,11 +1562,15 @@
+ int ex;
+ {
+ int state;
+- volatile VALUE err = ruby_errinfo;
++ VALUE err;
++ volatile VALUE errs[2];
++ int nerr;
+
++ errs[0] = ruby_errinfo;
+ ruby_safe_level = 0;
+ Init_stack((void*)&state);
+ ruby_finalize_0();
++ errs[1] = ruby_errinfo;
+ PUSH_TAG(PROT_NONE);
+ PUSH_ITER(ITER_NOT);
+ if ((state = EXEC_TAG()) == 0) {
+@@ -1577,15 +1581,15 @@
+ ex = state;
+ }
+ POP_ITER();
+- ruby_errinfo = err;
++ ruby_errinfo = errs[0];
+ ex = error_handle(ex);
+ ruby_finalize_1();
+ POP_TAG();
+
+- if (err) {
++ for (nerr = sizeof(errs) / sizeof(errs[0]); nerr;) {
++ if (!(err = errs[--nerr])) continue;
+ if (rb_obj_is_kind_of(err, rb_eSystemExit)) {
+- VALUE st = rb_iv_get(err, "status");
+- return NUM2INT(st);
++ return sysexit_status(err);
+ }
+ else if (rb_obj_is_kind_of(err, rb_eSignal)) {
+ VALUE sig = rb_iv_get(err, "signo");