git: 08a80171eb5c - main - x11-wm/subtle: unbreak the port's build against new Ruby versions

From: Alexey Dokuchaev <danfe_at_FreeBSD.org>
Date: Sat, 28 Jan 2023 04:36:26 UTC
The branch main has been updated by danfe:

URL: https://cgit.FreeBSD.org/ports/commit/?id=08a80171eb5c57b3c767028ca9989650702e2f6e

commit 08a80171eb5c57b3c767028ca9989650702e2f6e
Author:     Alexey Dokuchaev <danfe@FreeBSD.org>
AuthorDate: 2023-01-28 04:31:32 +0000
Commit:     Alexey Dokuchaev <danfe@FreeBSD.org>
CommitDate: 2023-01-28 04:31:32 +0000

    x11-wm/subtle: unbreak the port's build against new Ruby versions
    
    File.exists? method has been deprecated and removed in Ruby 3.2.0,
    adjust the code accordingly.
    
    PR:     269177
---
 x11-wm/subtle/Makefile             | 2 ++
 x11-wm/subtle/files/patch-Rakefile | 9 +++++++++
 2 files changed, 11 insertions(+)

diff --git a/x11-wm/subtle/Makefile b/x11-wm/subtle/Makefile
index 726512f04195..8b3515300900 100644
--- a/x11-wm/subtle/Makefile
+++ b/x11-wm/subtle/Makefile
@@ -21,6 +21,8 @@ ALL_TARGET=	build
 
 post-patch:
 	@${REINPLACE_CMD} -e 1d ${WRKSRC}/data/subtler/runner.rb
+	@${REINPLACE_CMD} -e 's,File\.exists\?,File.exist?,' \
+		${WRKSRC}/data/sur/server.rb
 	@${REINPLACE_CMD} -e 's,/etc/xdg,${LOCALBASE}&,' \
 		${WRKSRC}/src/subtle/ruby.c
 
diff --git a/x11-wm/subtle/files/patch-Rakefile b/x11-wm/subtle/files/patch-Rakefile
index ce3585b55d07..a004dede2c5a 100644
--- a/x11-wm/subtle/files/patch-Rakefile
+++ b/x11-wm/subtle/files/patch-Rakefile
@@ -42,6 +42,15 @@
      end
  
      checksums
+@@ -282,7 +282,7 @@ task(:config) do
+     end
+ 
+     # Get revision
+-    if File.exists?(".hg") and (hg = find_executable0("hg"))
++    if File.exist?(".hg") and (hg = find_executable0("hg"))
+       match = `#{hg} tip`.match(/^[^:]+:\s*(\d+).*/)
+ 
+       if !match.nil? and 2 == match.size
 @@ -396,7 +396,10 @@ task(:config) do
        checking_for("X11/Xft/Xft.h") do
          ret = false