[Bug 277410] After upgrading ruby31 to ruby32, portupgrade broke.

From: <bugzilla-noreply_at_freebsd.org>
Date: Fri, 01 Mar 2024 07:45:18 UTC
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=277410

Stanislav Sedov <stas@FreeBSD.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |stas@FreeBSD.org

--- Comment #3 from Stanislav Sedov <stas@FreeBSD.org> ---
It looks like File::exists? method got deprecated.

Wonder if you can try the following patch to see if that works for you?


You can patch the installed files in /usr/local/bin/portsclean and
/usr/local/lib/ruby/site_ruby/3.2/pkgtools/pkgtools.rb if that's easier.

---------------------------------------------------------------------------

diff --git a/bin/portsclean b/bin/portsclean
index 322fdb9..dbf2c11 100755
--- a/bin/portsclean
+++ b/bin/portsclean
@@ -282,7 +282,7 @@ def ldconfig_m(*dirs)
   msg = " --> Running ldconfig -m"

   dirs.each do |d|
-    dirs.delete(d) if ! (File.exists?(d) && File.stat(d).directory?)
+    dirs.delete(d) if ! (File.exist?(d) && File.stat(d).directory?)
   end

   case dirs.size
diff --git a/lib/pkgtools/pkgtools.rb b/lib/pkgtools/pkgtools.rb
index 97e156b..8300e6a 100644
--- a/lib/pkgtools/pkgtools.rb
+++ b/lib/pkgtools/pkgtools.rb
@@ -524,7 +524,7 @@ def script_path
   # If a fixed/custom script(1) is installed by the port, use that version.
   # See #8
   custom_script = "#{PREFIX}/libexec/pkgtools/script"
-  if File.exists?(custom_script)
+  if File.exist?(custom_script)
     $script_path = custom_script
   else
     $script_path = '/usr/bin/script'

-- 
You are receiving this mail because:
You are on the CC list for the bug.