From a767839a30338317251e4460d73225f5cbb480c2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADt=20Ondruch?= Date: Fri, 8 Feb 2019 12:01:20 +0100 Subject: [PATCH] Update to rb-inotify 0.10.0. --- .gitignore | 1 + ...9.7-Avoid-crashing-when-fd-is-closed.patch | 23 ------- ...n-closing-notifier-in-watch-callback.patch | 22 ------- rubygem-rb-inotify.spec | 60 +++++++++++-------- sources | 2 +- 5 files changed, 37 insertions(+), 71 deletions(-) delete mode 100644 rubygem-rb-inotify-0.9.7-Avoid-crashing-when-fd-is-closed.patch delete mode 100644 rubygem-rb-inotify-0.9.7-Prevent-error-when-closing-notifier-in-watch-callback.patch diff --git a/.gitignore b/.gitignore index 1dacfb6..b3400d4 100644 --- a/.gitignore +++ b/.gitignore @@ -2,3 +2,4 @@ /rb-inotify-0.8.8.gem /rb-inotify-0.9.5.gem /rb-inotify-0.9.7.gem +/rb-inotify-0.10.0.gem diff --git a/rubygem-rb-inotify-0.9.7-Avoid-crashing-when-fd-is-closed.patch b/rubygem-rb-inotify-0.9.7-Avoid-crashing-when-fd-is-closed.patch deleted file mode 100644 index f7f80f8..0000000 --- a/rubygem-rb-inotify-0.9.7-Avoid-crashing-when-fd-is-closed.patch +++ /dev/null @@ -1,23 +0,0 @@ -From 99d2101eaa71adc40737ae45cb03d3ae86fdad4a Mon Sep 17 00:00:00 2001 -From: Cezary Baginski -Date: Fri, 29 Jul 2016 13:26:22 +0200 -Subject: [PATCH] avoid crashing on Ruby 2.3.1 when fd is closed - ---- - lib/rb-inotify/notifier.rb | 3 +++ - 1 file changed, 3 insertions(+) - -diff --git a/lib/rb-inotify/notifier.rb b/lib/rb-inotify/notifier.rb -index c2f6ddc..516e78f 100644 ---- a/lib/rb-inotify/notifier.rb -+++ b/lib/rb-inotify/notifier.rb -@@ -302,6 +302,9 @@ def readpartial(size) - # If the IO has already been closed, reading from it will cause - # Errno::EBADF. - return nil -+ rescue IOError => ex -+ return nil if ex.message =~ /stream closed/ -+ raise - end - - tries = 0 diff --git a/rubygem-rb-inotify-0.9.7-Prevent-error-when-closing-notifier-in-watch-callback.patch b/rubygem-rb-inotify-0.9.7-Prevent-error-when-closing-notifier-in-watch-callback.patch deleted file mode 100644 index 952aef6..0000000 --- a/rubygem-rb-inotify-0.9.7-Prevent-error-when-closing-notifier-in-watch-callback.patch +++ /dev/null @@ -1,22 +0,0 @@ -From a3ff7cc8cd7c4e57a4e6d5a885d515946081239f Mon Sep 17 00:00:00 2001 -From: Cezary Baginski -Date: Tue, 3 May 2016 00:03:50 +0200 -Subject: [PATCH] Avoid crashing after fd is closed (fix: #41) - ---- - lib/rb-inotify/event.rb | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/lib/rb-inotify/event.rb b/lib/rb-inotify/event.rb -index f6e9551..11701ac 100644 ---- a/lib/rb-inotify/event.rb -+++ b/lib/rb-inotify/event.rb -@@ -125,7 +125,7 @@ def initialize(data, notifier) - # - # @private - def callback! -- watcher.callback!(self) -+ watcher && watcher.callback!(self) - end - - # Returns the size of this event object in bytes, diff --git a/rubygem-rb-inotify.spec b/rubygem-rb-inotify.spec index 5be0faf..14bcd5f 100644 --- a/rubygem-rb-inotify.spec +++ b/rubygem-rb-inotify.spec @@ -1,27 +1,23 @@ %global gem_name rb-inotify Name: rubygem-%{gem_name} -Version: 0.9.7 -Release: 7%{?dist} -Summary: A Ruby wrapper for Linux's inotify, using FFI +Version: 0.10.0 +Release: 1%{?dist} +Summary: A Ruby wrapper for Linux inotify, using FFI License: MIT -URL: http://github.com/nex3/rb-inotify +URL: https://github.com/guard/rb-inotify Source0: https://rubygems.org/gems/%{gem_name}-%{version}.gem -# The following two patches make rubygem-rerun test suite passing. -# When closing a notifier from within the callback-block of a watch, then -# the process call on the notifier will fail. -# https://github.com/nex3/rb-inotify/issues/41 -Patch0: rubygem-rb-inotify-0.9.7-Prevent-error-when-closing-notifier-in-watch-callback.patch -# Avoid crashing on Ruby 2.3.1 when fd is closed. -# https://github.com/nex3/rb-inotify/pull/59 -Patch1: rubygem-rb-inotify-0.9.7-Avoid-crashing-when-fd-is-closed.patch BuildRequires: ruby(release) BuildRequires: rubygems-devel BuildRequires: ruby +BuildRequires: rubygem(ffi) +BuildRequires: %{_bindir}/rspec +BuildRequires: rubygem(concurrent-ruby) +BuildRequires: rubygem(rspec-expectations) BuildArch: noarch %description -A Ruby wrapper for Linux's inotify, using FFI. +A Ruby wrapper for Linux inotify, using FFI. %package doc @@ -33,39 +29,53 @@ BuildArch: noarch Documentation for %{name}. %prep -%setup -q -c -T -%gem_install -n %{SOURCE0} - -pushd .%{gem_instdir} -%patch0 -p1 -%patch1 -p1 -popd +%setup -q -n %{gem_name}-%{version} %build +# Create the gem as gem install only works on a gem file +gem build ../%{gem_name}-%{version}.gemspec + +# %%gem_install compiles any C extensions and installs the gem into ./%%gem_dir +# by default, so that we can move it into the buildroot in %%install +%gem_install %install mkdir -p %{buildroot}%{gem_dir} cp -a .%{gem_dir}/* \ %{buildroot}%{gem_dir}/ + + +%check +pushd .%{gem_instdir} +# Bundler is not necessary. +sed -i "/bundler\/setup/ s/^/#/" spec/spec_helper.rb + +# Bunler needs "Pathname" for its functionality, but we are not using Bundler, +# therefore we need to load it explicitly. +rspec -rpathname spec +popd + %files %dir %{gem_instdir} %exclude %{gem_instdir}/.* -%license %{gem_instdir}/MIT-LICENSE +%license %{gem_instdir}/LICENSE.md %{gem_libdir} %exclude %{gem_cache} %{gem_spec} %files doc %doc %{gem_docdir} +%{gem_instdir}/Gemfile %doc %{gem_instdir}/README.md -%doc %{gem_instdir}/VERSION %{gem_instdir}/Rakefile -%{gem_instdir}/%{gem_name}.gemspec - - +%{gem_instdir}/rb-inotify.gemspec +%{gem_instdir}/spec %changelog +* Fri Feb 08 2019 Vít Ondruch - 0.10.0-1 +- Update to rb-inotify 0.10.0. + * Sat Feb 02 2019 Fedora Release Engineering - 0.9.7-7 - Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild diff --git a/sources b/sources index 3b85440..ebb0848 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -9f960a580af3cc0cabb006eb52d854a5 rb-inotify-0.9.7.gem +SHA512 (rb-inotify-0.10.0.gem) = 16aa7fb21e5ed713335e583299cfc72676e3ef66de3d349f74a14885b88020b79e031839b193dc140036a0b6539a45ef3a0c3c6027a7211508d388137d22a13b