Index: head/devel/rubygem-rb-kqueue/Makefile =================================================================== --- head/devel/rubygem-rb-kqueue/Makefile (revision 554270) +++ head/devel/rubygem-rb-kqueue/Makefile (revision 554271) @@ -1,25 +1,23 @@ # Created by: Sunpoet Po-Chuan Hsieh # $FreeBSD$ PORTNAME= rb-kqueue 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 LICENSE= MIT LICENSE_FILE= ${WRKSRC}/MIT-LICENSE RUN_DEPENDS= rubygem-ffi>=0.5.0:devel/rubygem-ffi USES= gem USE_RUBY= yes NO_ARCH= yes .include Index: head/devel/rubygem-rb-kqueue/distinfo =================================================================== --- head/devel/rubygem-rb-kqueue/distinfo (revision 554270) +++ head/devel/rubygem-rb-kqueue/distinfo (revision 554271) @@ -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 Index: head/devel/rubygem-rb-kqueue/files/patch-pull-12 =================================================================== --- head/devel/rubygem-rb-kqueue/files/patch-pull-12 (nonexistent) +++ head/devel/rubygem-rb-kqueue/files/patch-pull-12 (revision 554271) @@ -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 Property changes on: head/devel/rubygem-rb-kqueue/files/patch-pull-12 ___________________________________________________________________ Added: fbsd:nokeywords ## -0,0 +1 ## +yes \ No newline at end of property Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:mime-type ## -0,0 +1 ## +text/plain \ No newline at end of property