Date: Fri, 6 Nov 2020 11:30:33 +0000 (UTC) From: Sunpoet Po-Chuan Hsieh <sunpoet@FreeBSD.org> To: ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org Subject: svn commit: r554271 - in head/devel/rubygem-rb-kqueue: . files Message-ID: <202011061130.0A6BUXBM001000@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: sunpoet Date: Fri Nov 6 11:30:33 2020 New Revision: 554271 URL: https://svnweb.freebsd.org/changeset/ports/554271 Log: Use local patch file instead of PATCHFILES Added: head/devel/rubygem-rb-kqueue/files/ head/devel/rubygem-rb-kqueue/files/patch-pull-12 (contents, props changed) Modified: head/devel/rubygem-rb-kqueue/Makefile head/devel/rubygem-rb-kqueue/distinfo Modified: head/devel/rubygem-rb-kqueue/Makefile ============================================================================== --- head/devel/rubygem-rb-kqueue/Makefile Fri Nov 6 11:30:28 2020 (r554270) +++ head/devel/rubygem-rb-kqueue/Makefile Fri Nov 6 11:30:33 2020 (r554271) @@ -6,8 +6,6 @@ PORTVERSION= 0.2.5 PORTREVISION= 1 CATEGORIES= devel rubygems MASTER_SITES= RG -PATCH_SITES= https://github.com/mat813/rb-kqueue/commit/ -PATCHFILES= 144ee7bb7963c77fc219ba736df7ee952d50ab19.patch:-p1 MAINTAINER= sunpoet@FreeBSD.org COMMENT= Ruby wrapper for BSD kqueue, using FFI Modified: head/devel/rubygem-rb-kqueue/distinfo ============================================================================== --- head/devel/rubygem-rb-kqueue/distinfo Fri Nov 6 11:30:28 2020 (r554270) +++ head/devel/rubygem-rb-kqueue/distinfo Fri Nov 6 11:30:33 2020 (r554271) @@ -1,5 +1,3 @@ -TIMESTAMP = 1603017810 +TIMESTAMP = 1604480798 SHA256 (rubygem/rb-kqueue-0.2.5.gem) = 3c33aca20c6e12570298d1519da10606359bc42718876886dc8348a161feb092 SIZE (rubygem/rb-kqueue-0.2.5.gem) = 18944 -SHA256 (rubygem/144ee7bb7963c77fc219ba736df7ee952d50ab19.patch) = ea3a1b2e6e0ab48490fcd55357f4b4ff34a8fbc5e9e70234bee521d82a67f5f8 -SIZE (rubygem/144ee7bb7963c77fc219ba736df7ee952d50ab19.patch) = 2951 Added: head/devel/rubygem-rb-kqueue/files/patch-pull-12 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/devel/rubygem-rb-kqueue/files/patch-pull-12 Fri Nov 6 11:30:33 2020 (r554271) @@ -0,0 +1,66 @@ +Obtained from: https://github.com/mat813/rb-kqueue/pull/12 + +--- lib/rb-kqueue/event.rb.orig ++++ lib/rb-kqueue/event.rb +@@ -3,6 +3,11 @@ module KQueue + # Each {Watcher} can fire many events, + # which are passed to that Watcher's callback. + class Event ++ ++ # Exception raised on an attempt to construct an {Event} ++ # from a native event with unexpected field values. ++ class UnexpectedEvent < Exception; end ++ + # Some integer data, the interpretation of which + # is specific to each individual {Watcher}. + # For specifics, see the individual Watcher subclasses. +@@ -64,7 +69,11 @@ def initialize(native, queue) + @native = native + @queue = queue + @data = @native[:data] +- @filter = KQueue::Native::Flags.from_flag("EVFILT", @native[:filter]) ++ begin ++ @filter = KQueue::Native::Flags.from_flag("EVFILT", @native[:filter]) ++ rescue Native::Flags::FlagNotFound ++ raise UnexpectedEvent ++ end + @flags = Native::Flags.from_mask("EV", @native[:flags]) + + KQueue.handle_error @native[:data] if @flags.include?(:error) +--- lib/rb-kqueue/native/flags.rb.orig ++++ lib/rb-kqueue/native/flags.rb +@@ -97,6 +97,9 @@ module Flags + NOTE_TIMER_NSECONDS = 0x00000004 # data is nanoseconds + NOTE_TIMER_ABSOLUTE = 0x00000008 # absolute timeout + ++ # Exception raised when a function fails to find a flag satisfying ++ # its given query. ++ class FlagNotFound < Exception; end + + # Converts a list of flags to the bitmask that the C API expects. + # +@@ -143,6 +146,7 @@ def self.from_flag(prefix, flag) + next unless c =~ re + return c.to_s.sub("#{prefix}_", "").downcase.to_sym if const_get(c) == flag + end ++ raise FlagNotFound + end + end + end +--- lib/rb-kqueue/queue.rb.orig ++++ lib/rb-kqueue/queue.rb +@@ -359,7 +359,13 @@ def read_events(blocking = true) + res = Native.kevent(@fd, nil, 0, eventlist, size, timeout) + + KQueue.handle_error if res < 0 +- (0...res).map {|i| KQueue::Event.new(Native::KEvent.new(eventlist[i]), self)} ++ (0...res).map do |i| ++ begin ++ KQueue::Event.new(Native::KEvent.new(eventlist[i]), self) ++ rescue KQueue::Event::UnexpectedEvent ++ nil ++ end ++ end.compact + end + end + end
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202011061130.0A6BUXBM001000>