[DRE-commits] [rerun] 11/12: apply upstream patch for Object#timeout deprecation
Antonio Terceiro
terceiro at moszumanska.debian.org
Mon May 9 01:18:55 UTC 2016
This is an automated email from the git hooks/post-receive script.
terceiro pushed a commit to branch master
in repository rerun.
commit aae609538e83518d42c5c45489eda4460a50efd3
Author: Antonio Terceiro <terceiro at softwarelivre.org>
Date: Sun May 8 21:54:00 2016 -0300
apply upstream patch for Object#timeout deprecation
---
debian/changelog | 3 +-
...t-timeout-deprecation-warning-in-Ruby-2.3.patch | 25 ++++++++
...ls-to-Object.timeout-with-calls-to-Timeou.patch | 66 ----------------------
debian/patches/series | 2 +-
4 files changed, 27 insertions(+), 69 deletions(-)
diff --git a/debian/changelog b/debian/changelog
index 2e604cf..3ac42c1 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -5,8 +5,7 @@ rerun (0.11.0-1) UNRELEASED; urgency=medium
* Stop building manpages with ruby-ronn which depends on a deprecated
library.
* Build manpage with asciidoctor, straight from the upstream README.md
- * 0003-Replace-calls-to-Object.timeout-with-calls-to-Timeou.patch: remove
- usage of deprecated feature in Ruby 2.3
+ * Apply upstream patch to remove usage of deprecated feature in Ruby 2.3
-- Antonio Terceiro <terceiro at debian.org> Wed, 16 Mar 2016 17:14:58 -0300
diff --git a/debian/patches/0003-Fix-Object-timeout-deprecation-warning-in-Ruby-2.3.patch b/debian/patches/0003-Fix-Object-timeout-deprecation-warning-in-Ruby-2.3.patch
new file mode 100644
index 0000000..cc48928
--- /dev/null
+++ b/debian/patches/0003-Fix-Object-timeout-deprecation-warning-in-Ruby-2.3.patch
@@ -0,0 +1,25 @@
+From: Matt Brictson <matt at mattbrictson.com>
+Date: Fri, 1 Jan 2016 21:48:08 -0800
+Subject: Fix Object#timeout deprecation warning in Ruby 2.3
+
+Fix the following warning by explicitly including the Timeout module, rather
+than relying on Object#timeout:
+
+lib/rerun/runner.rb:254:in `stop': Object#timeout is deprecated,
+use Timeout.timeout instead.
+---
+ lib/rerun/runner.rb | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/lib/rerun/runner.rb b/lib/rerun/runner.rb
+index b085ff1..6d7254c 100644
+--- a/lib/rerun/runner.rb
++++ b/lib/rerun/runner.rb
+@@ -13,6 +13,7 @@ module Rerun
+ end
+
+ include System
++ include ::Timeout
+
+ def initialize(run_command, options = {})
+ @run_command, @options = run_command, options
diff --git a/debian/patches/0003-Replace-calls-to-Object.timeout-with-calls-to-Timeou.patch b/debian/patches/0003-Replace-calls-to-Object.timeout-with-calls-to-Timeou.patch
deleted file mode 100644
index e3da2d7..0000000
--- a/debian/patches/0003-Replace-calls-to-Object.timeout-with-calls-to-Timeou.patch
+++ /dev/null
@@ -1,66 +0,0 @@
-From: Antonio Terceiro <terceiro at softwarelivre.org>
-Date: Sun, 8 May 2016 21:48:19 -0300
-Subject: Replace calls to Object.timeout with calls to Timeout.timeout
-
-The former is deprecated on Ruby 2.3
----
- lib/rerun/runner.rb | 4 ++--
- spec/functional_spec.rb | 2 +-
- spec/inc_process.rb | 4 ++--
- 3 files changed, 5 insertions(+), 5 deletions(-)
-
-diff --git a/lib/rerun/runner.rb b/lib/rerun/runner.rb
-index b085ff1..58511a7 100644
---- a/lib/rerun/runner.rb
-+++ b/lib/rerun/runner.rb
-@@ -251,13 +251,13 @@ module Rerun
- if @pid && (@pid != 0)
- notify "stopping", "All good things must come to an end." unless @restarting
- begin
-- timeout(5) do # todo: escalation timeout setting
-+ Timeout.timeout(5) do # todo: escalation timeout setting
- # start with a polite SIGTERM
- signal(default_signal) && Process.wait(@pid)
- end
- rescue Timeout::Error
- begin
-- timeout(5) do
-+ Timeout.timeout(5) do
- # escalate to SIGINT aka control-C since some foolish process may be ignoring SIGTERM
- signal("INT") && Process.wait(@pid)
- end
-diff --git a/spec/functional_spec.rb b/spec/functional_spec.rb
-index a2b8d61..1ad4a92 100644
---- a/spec/functional_spec.rb
-+++ b/spec/functional_spec.rb
-@@ -84,7 +84,7 @@ describe "the rerun command" do
- pid = @inc.inc_parent_pid
- # puts "test sending INT to #{pid}"
- Process.kill("INT", pid)
-- timeout(6) {
-+ Timeout.timeout(6) {
- # puts "test waiting for #{pid}"
- Process.wait(@inc.rerun_pid) rescue Errno::ESRCH
- }
-diff --git a/spec/inc_process.rb b/spec/inc_process.rb
-index 0d3fbc9..2b19a84 100644
---- a/spec/inc_process.rb
-+++ b/spec/inc_process.rb
-@@ -25,7 +25,7 @@ class IncProcess
- def kill
- begin
- pids = ([@inc_pid, @inc_parent_pid, @rerun_pid] - [Process.pid]).uniq
-- timeout(5) do
-+ Timeout.timeout(5) do
- pids.each do |pid|
- # puts "sending INT to #{pid}"
- Process.kill("INT", pid) rescue Errno::ESRCH
-@@ -51,7 +51,7 @@ class IncProcess
-
- def launch
- @rerun_pid = spawn(rerun_cmd)
-- timeout(10) { sleep 0.5 until File.exist?(@inc_output_file) }
-+ Timeout.timeout(10) { sleep 0.5 until File.exist?(@inc_output_file) }
- sleep 3 # let rerun's watcher get going
- read
- end
diff --git a/debian/patches/series b/debian/patches/series
index a16ea38..ea3aced 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -1,3 +1,3 @@
0001-Read-version-number-from-installed-gemspec.patch
0002-Turn-README-into-a-manpage.patch
-0003-Replace-calls-to-Object.timeout-with-calls-to-Timeou.patch
+0003-Fix-Object-timeout-deprecation-warning-in-Ruby-2.3.patch
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-ruby-extras/rerun.git
More information about the Pkg-ruby-extras-commits
mailing list