/etc/rc.d/ldconfig: 113: Syntax error: ";;" unexpected (expecting "fi") during "pkg upgrade" on FreeBSD 14.2

Hello to everyone.

I've simply did : "pkg upgrade" on FreeBSD 14.2 and this is what happened :

Code:
Installed packages to be REINSTALLED:
    kdeconnect-kde-23.08.5_3 (direct dependency changed: kirigami-addons-qt5)
    kf5-kiconthemes-5.116.0 (direct dependency changed: kf6-breeze-icons)
    kwordquiz-23.08.5 (direct dependency changed: kirigami-addons-qt5)
    pkg-1.21.3

Number of packages to be removed: 3
Number of packages to be installed: 4
Number of packages to be upgraded: 130
Number of packages to be reinstalled: 4

The process will require 12 MiB more space.

Proceed with this action? [y/N]: y
[1/141] Upgrading gettext-runtime from 0.23 to 0.23.1...
[1/141] Extracting gettext-runtime-0.23.1: 100%
/etc/rc.d/ldconfig: 113: Syntax error: ";;" unexpected (expecting "fi")
pkg: POST-INSTALL script failed
....
[66/141] Upgrading miniupnpc from 2.2.8 to 2.3.0...
[66/141] Extracting miniupnpc-2.3.0: 100%
/etc/rc.d/ldconfig: 113: Syntax error: ";;" unexpected (expecting "fi")
pkg: POST-INSTALL script failed
[67/141] Upgrading e2fsprogs-libblkid from 1.47.1 to 1.47.2...
[67/141] Extracting e2fsprogs-libblkid-1.47.2: 100%
/etc/rc.d/ldconfig: 113: Syntax error: ";;" unexpected (expecting "fi")
pkg: POST-INSTALL script failed
[68/141] Upgrading gstreamer1-plugins-dts from 1.24.10 to 1.24.11...
[68/141] Extracting gstreamer1-plugins-dts-1.24.11: 100%
/etc/rc.d/ldconfig: 113: Syntax error: ";;" unexpected (expecting "fi")
pkg: POST-INSTALL script failed
[69/141] Upgrading gstreamer1-plugins-theora from 1.24.10 to 1.24.11...
[69/141] Extracting gstreamer1-plugins-theora-1.24.11: 100%
/etc/rc.d/ldconfig: 113: Syntax error: ";;" unexpected (expecting "fi")
pkg: POST-INSTALL script failed
[70/141] Upgrading gstreamer1-plugins-png from 1.24.10 to 1.24.11...
[70/141] Extracting gstreamer1-plugins-png-1.24.11: 100%
/etc/rc.d/ldconfig: 113: Syntax error: ";;" unexpected (expecting "fi")
pkg: POST-INSTALL script failed
[71/141] Upgrading gstreamer1-plugins-dvdread from 1.24.10 to 1.24.11...
[71/141] Extracting gstreamer1-plugins-dvdread-1.24.11: 100%
/etc/rc.d/ldconfig: 113: Syntax error: ";;" unexpected (expecting "fi")
pkg: POST-INSTALL script failed
[72/141] Upgrading vulkan-headers from 1.4.304 to 1.4.305...
[72/141] Extracting vulkan-headers-1.4.305: 100%
[73/141] Upgrading gettext-tools from 0.23 to 0.23.1...
[73/141] Extracting gettext-tools-0.23.1: 100%
/etc/rc.d/ldconfig: 113: Syntax error: ";;" unexpected (expecting "fi")
pkg: POST-INSTALL script failed
[74/141] Upgrading upower from 1.90.6 to 1.90.7...
[74/141] Extracting upower-1.90.7: 100%
/etc/rc.d/ldconfig: 113: Syntax error: ";;" unexpected (expecting "fi")
pkg: POST-INSTALL script failed
[75/141] Upgrading gstreamer1-plugins-gl from 1.24.10 to 1.24.11...
[75/141] Extracting gstreamer1-plugins-gl-1.24.11: 100%
/etc/rc.d/ldconfig: 113: Syntax error: ";;" unexpected (expecting "fi")
pkg: POST-INSTALL script failed
[76/141] Upgrading harfbuzz-icu from 10.1.0 to 10.2.0...
[76/141] Extracting harfbuzz-icu-10.2.0: 100%
/etc/rc.d/ldconfig: 113: Syntax error: ";;" unexpected (expecting "fi")
pkg: POST-INSTALL script failed
[77/141] Upgrading minizip-ng from 4.0.7 to 4.0.8...
[77/141] Extracting minizip-ng-4.0.8: 100%
/etc/rc.d/ldconfig: 113: Syntax error: ";;" unexpected (expecting "fi")
pkg: POST-INSTALL script failed
[78/141] Upgrading gvfs from 1.50.2_3 to 1.56.0...
[78/141] Extracting gvfs-1.56.0: 100%
/etc/rc.d/ldconfig: 113: Syntax error: ";;" unexpected (expecting "fi")
pkg: POST-INSTALL script failed
[79/141] Upgrading apcupsd from 3.14.14_5 to 3.14.14_6...
[79/141] Extracting apcupsd-3.14.14_6: 100%
[80/141] Upgrading ceres-solver from 2.2.0_10 to 2.2.0_11...
[80/141] Extracting ceres-solver-2.2.0_11: 100%
/etc/rc.d/ldconfig: 113: Syntax error: ";;" unexpected (expecting "fi")
pkg: POST-INSTALL script failed
[81/141] Upgrading toxic from 0.15.1_2 to 0.16.0...
[81/141] Extracting toxic-0.16.0: 100%
[82/141] Upgrading plasma6-kwrited from 6.2.4 to 6.2.5...
[82/141] Extracting plasma6-kwrited-6.2.5: 100%
[83/141] Upgrading py311-PyQt-builder from 1.17.0 to 1.17.1...
[83/141] Extracting py311-PyQt-builder-1.17.1: 100%
[84/141] Upgrading transmission-docs from 4.0.6_2 to 4.0.6_3...
[84/141] Extracting transmission-docs-4.0.6_3: 100%
[85/141] Reinstalling kwordquiz-23.08.5...
[85/141] Extracting kwordquiz-23.08.5: 100%
[86/141] Upgrading caddy from 2.9.0 to 2.9.1...
===> Creating groups
Using existing group 'www'
===> Creating users
Using existing user 'www'
[86/141] Extracting caddy-2.9.1: 100%
[87/141] Upgrading dotnet from 9.0.0_2 to 9.0.0_3...
[87/141] Extracting dotnet-9.0.0_3: 100%
[88/141] Upgrading gstreamer1-plugins-opus from 1.24.10 to 1.24.11...
[88/141] Extracting gstreamer1-plugins-opus-1.24.11: 100%
/etc/rc.d/ldconfig: 113: Syntax error: ";;" unexpected (expecting "fi")
pkg: POST-INSTALL script failed
[89/141] Upgrading plasma5-discover from 5.27.11_1 to 5.27.11_2...
[89/141] Extracting plasma5-discover-5.27.11_2: 100%
[90/141] Reinstalling kdeconnect-kde-23.08.5_3...
[90/141] Extracting kdeconnect-kde-23.08.5_3: 100%
/etc/rc.d/ldconfig: 113: Syntax error: ";;" unexpected (expecting "fi")
pkg: POST-INSTALL script failed
[91/141] Upgrading py39-numpy from 1.26.4_2,1 to 1.26.4_3,1...
[91/141] Extracting py39-numpy-1.26.4_3,1: 100%
[92/141] Upgrading libphonenumber from 8.13.51 to 8.13.53...
[92/141] Extracting libphonenumber-8.13.53: 100%
[93/141] Upgrading doxygen from 1.9.6_1,2 to 1.9.6_2,2...
[93/141] Extracting doxygen-1.9.6_2,2: 100%
[94/141] Upgrading benchmark from 1.9.0,1 to 1.9.1,1...
[94/141] Extracting benchmark-1.9.1,1: 100%
/etc/rc.d/ldconfig: 113: Syntax error: ";;" unexpected (expecting "fi")
pkg: POST-INSTALL script failed
[95/141] Upgrading yt-dlp from 2024.12.23 to 2025.01.15...
[95/141] Extracting yt-dlp-2025.01.15: 100%
[96/141] Upgrading blender from 4.2.0_4 to 4.2.0_5...
[96/141] Extracting blender-4.2.0_5: 100%
/etc/rc.d/ldconfig: 113: Syntax error: ";;" unexpected (expecting "fi")
pkg: POST-INSTALL script failed
[97/141] Upgrading kodi from 21.0_5 to 21.0_6...
[97/141] Extracting kodi-21.0_6: 100%
/etc/rc.d/ldconfig: 113: Syntax error: ";;" unexpected (expecting "fi")
pkg: POST-INSTALL script failed
[98/141] Upgrading plasma6-kwayland from 6.2.4 to 6.2.5...
[98/141] Extracting plasma6-kwayland-6.2.5: 100%
[99/141] Upgrading emacs-devel from 31.0.50.20241231_1,3 to 31.0.50.20250115,3...
[99/141] Extracting emacs-devel-31.0.50.20250115,3: 100%
[100/141] Upgrading gstreamer1-plugins-mpeg2dec from 1.24.10 to 1.24.11...
[100/141] Extracting gstreamer1-plugins-mpeg2dec-1.24.11: 100%
/etc/rc.d/ldconfig: 113: Syntax error: ";;" unexpected (expecting "fi")
pkg: POST-INSTALL script failed
[101/141] Upgrading handbrake from 1.7.2_2 to 1.9.0...
[101/141] Extracting handbrake-1.9.0: 100%
[102/141] Upgrading py311-certbot from 3.0.1,1 to 3.0.1_1,1...
[102/141] Extracting py311-certbot-3.0.1_1,1: 100%
[103/141] Upgrading luajit-devel from 2.1.0.20241114 to 2.1.0.20250113...
[103/141] Extracting luajit-devel-2.1.0.20250113: 100%
/etc/rc.d/ldconfig: 113: Syntax error: ";;" unexpected (expecting "fi")
pkg: POST-INSTALL script failed
[104/141] Upgrading vulkan-tools from 1.4.304 to 1.4.305...
[104/141] Extracting vulkan-tools-1.4.305: 100%
[105/141] Upgrading gstreamer1-plugins-flac from 1.24.10 to 1.24.11...
[105/141] Extracting gstreamer1-plugins-flac-1.24.11: 100%
/etc/rc.d/ldconfig: 113: Syntax error: ";;" unexpected (expecting "fi")
pkg: POST-INSTALL script failed
[106/141] Upgrading gstreamer1-plugins-x264 from 1.24.10 to 1.24.11...
[106/141] Extracting gstreamer1-plugins-x264-1.24.11: 100%
/etc/rc.d/ldconfig: 113: Syntax error: ";;" unexpected (expecting "fi")
pkg: POST-INSTALL script failed
[107/141] Upgrading py310-numpy from 1.26.4_2,1 to 1.26.4_3,1...
[107/141] Extracting py310-numpy-1.26.4_3,1: 100%
[108/141] Upgrading musicpd from 0.23.16 to 0.23.16_1...
===> Creating groups
Using existing group 'mpd'
===> Creating users
Using existing user 'mpd'
===> Creating homedir(s)
[108/141] Extracting musicpd-0.23.16_1: 100%
[109/141] Upgrading zsh from 5.9_4 to 5.9_5...
[109/141] Extracting zsh-5.9_5: 100%
[110/141] Upgrading sudo from 1.9.16p2 to 1.9.16p2_1...
[110/141] Extracting sudo-1.9.16p2_1: 100%
/etc/rc.d/ldconfig: 113: Syntax error: ";;" unexpected (expecting "fi")
pkg: POST-INSTALL script failed
[111/141] Upgrading bastille from 0.12.20241124 to 0.12.20250111...
[111/141] Extracting bastille-0.12.20250111: 100%
[112/141] Upgrading git from 2.47.1 to 2.48.1...
===> Creating groups
Using existing group 'git_daemon'
===> Creating users
Using existing user 'git_daemon'
[112/141] Extracting git-2.48.1: 100%
[113/141] Upgrading gstreamer1-plugins-wavpack from 1.24.10 to 1.24.11...
[113/141] Extracting gstreamer1-plugins-wavpack-1.24.11: 100%
/etc/rc.d/ldconfig: 113: Syntax error: ";;" unexpected (expecting "fi")
pkg: POST-INSTALL script failed
[114/141] Upgrading gstreamer1-plugins-pulse from 1.24.10 to 1.24.11...
[114/141] Extracting gstreamer1-plugins-pulse-1.24.11: 100%
/etc/rc.d/ldconfig: 113: Syntax error: ";;" unexpected (expecting "fi")
pkg: POST-INSTALL script failed
[115/141] Upgrading gstreamer1-plugins-lame from 1.24.10 to 1.24.11...
[115/141] Extracting gstreamer1-plugins-lame-1.24.11: 100%
/etc/rc.d/ldconfig: 113: Syntax error: ";;" unexpected (expecting "fi")
pkg: POST-INSTALL script failed
[116/141] Upgrading gstreamer1-plugins-openh264 from 1.24.10 to 1.24.11...
[116/141] Extracting gstreamer1-plugins-openh264-1.24.11: 100%
/etc/rc.d/ldconfig: 113: Syntax error: ";;" unexpected (expecting "fi")
pkg: POST-INSTALL script failed
[117/141] Upgrading gstreamer1-plugins-chromaprint from 1.24.10 to 1.24.11...
[117/141] Extracting gstreamer1-plugins-chromaprint-1.24.11: 100%
/etc/rc.d/ldconfig: 113: Syntax error: ";;" unexpected (expecting "fi")
pkg: POST-INSTALL script failed
[118/141] Upgrading transmission-web from 4.0.6_2 to 4.0.6_3...
===> Creating groups
Creating group 'transmission' with gid '921'
===> Creating users
Creating user 'transmission' with uid '921'
===> Creating homedir(s)
[118/141] Extracting transmission-web-4.0.6_3: 100%
[119/141] Upgrading libxine from 1.2.13_11 to 1.2.13_12...
[119/141] Extracting libxine-1.2.13_12: 100%
/etc/rc.d/ldconfig: 113: Syntax error: ";;" unexpected (expecting "fi")
pkg: POST-INSTALL script failed
[120/141] Upgrading py311-gstreamer1 from 1.24.10 to 1.24.11...
[120/141] Extracting py311-gstreamer1-1.24.11: 100%
[121/141] Upgrading plasma6-plasma-activities-stats from 6.2.4 to 6.2.5...
[121/141] Extracting plasma6-plasma-activities-stats-6.2.5: 100%
[122/141] Upgrading gstreamer1-plugins-curl from 1.24.10 to 1.24.11...
[122/141] Extracting gstreamer1-plugins-curl-1.24.11: 100%
/etc/rc.d/ldconfig: 113: Syntax error: ";;" unexpected (expecting "fi")
pkg: POST-INSTALL script failed
[123/141] Upgrading sdl3 from 3.1.6_1 to 3.1.8...
[123/141] Extracting sdl3-3.1.8: 100%
/etc/rc.d/ldconfig: 113: Syntax error: ";;" unexpected (expecting "fi")
pkg: POST-INSTALL script failed
[124/141] Upgrading gstreamer1-plugins-faac from 1.24.10 to 1.24.11...
[124/141] Extracting gstreamer1-plugins-faac-1.24.11: 100%
/etc/rc.d/ldconfig: 113: Syntax error: ";;" unexpected (expecting "fi")
pkg: POST-INSTALL script failed
[125/141] Upgrading flatbuffers from 24.3.25,1 to 24.12.23,1...
[125/141] Extracting flatbuffers-24.12.23,1: 100%
/etc/rc.d/ldconfig: 113: Syntax error: ";;" unexpected (expecting "fi")
pkg: POST-INSTALL script failed
[126/141] Upgrading gstreamer1-plugins-vpx from 1.24.10 to 1.24.11...
[126/141] Extracting gstreamer1-plugins-vpx-1.24.11: 100%
/etc/rc.d/ldconfig: 113: Syntax error: ";;" unexpected (expecting "fi")
pkg: POST-INSTALL script failed
[127/141] Upgrading openvpn from 2.6.12 to 2.6.13...
===> Creating groups
Using existing group 'openvpn'
===> Creating users
Using existing user 'openvpn'
[127/141] Extracting openvpn-2.6.13: 100%
[128/141] Upgrading gstreamer1-plugins-soup from 1.24.10 to 1.24.11...
[128/141] Extracting gstreamer1-plugins-soup-1.24.11: 100%
/etc/rc.d/ldconfig: 113: Syntax error: ";;" unexpected (expecting "fi")
pkg: POST-INSTALL script failed
[129/141] Upgrading cmake-core from 3.31.3 to 3.31.4...
[129/141] Extracting cmake-core-3.31.4: 100%
[130/141] Upgrading alacritty from 0.14.0_2 to 0.15.0...
[130/141] Extracting alacritty-0.15.0: 100%
[131/141] Upgrading uTox from 0.17.2_7 to 0.17.2_8...
[131/141] Extracting uTox-0.17.2_8: 100%
[132/141] Upgrading gstreamer1-plugins-core from 1.24.10 to 1.24.11...
[132/141] Extracting gstreamer1-plugins-core-1.24.11: 100%
[133/141] Upgrading plasma5-plasma-workspace from 5.27.11.1_2 to 5.27.11.1_3...
[133/141] Extracting plasma5-plasma-workspace-5.27.11.1_3: 100%
[134/141] Upgrading e2fsprogs-core from 1.47.1 to 1.47.2...
[134/141] Extracting e2fsprogs-core-1.47.2: 100%
/etc/rc.d/ldconfig: 113: Syntax error: ";;" unexpected (expecting "fi")
pkg: POST-INSTALL script failed
[135/141] Upgrading mesa-devel from 24.3.b.2416 to 24.3.b.3014...
[135/141] Extracting mesa-devel-24.3.b.3014: 100%
/etc/rc.d/ldconfig: 113: Syntax error: ";;" unexpected (expecting "fi")
pkg: POST-INSTALL script failed
[136/141] Upgrading qemu from 9.2.0 to 9.2.0_1...
[136/141] Extracting qemu-9.2.0_1: 100%
[137/141] Upgrading firefox from 134.0,2 to 134.0.1,2...
[137/141] Extracting firefox-134.0.1,2: 100%
[138/141] Upgrading libdatachannel from 0.22.3 to 0.22.4...
[138/141] Extracting libdatachannel-0.22.4: 100%
[139/141] Upgrading rsync from 3.3.0 to 3.4.1...
[139/141] Extracting rsync-3.4.1: 100%
[140/141] Upgrading hs-pandoc from 3.6.1 to 3.6.2...
[140/141] Extracting hs-pandoc-3.6.2: 100%
[141/141] Upgrading mate-base from 1.28.1_1 to 1.28.2...
[141/141] Extracting mate-base-1.28.2: 100%
==> Running trigger: desktop-file-utils.ucl
Building cache database of MIME types
==> Running trigger: gtk-update-icon-cache.ucl
Generating GTK icon cache for /usr/local/share/icons/oxygen
Generating GTK icon cache for /usr/local/share/icons/breeze-dark
Generating GTK icon cache for /usr/local/share/icons/breeze_cursors
Generating GTK icon cache for /usr/local/share/icons/breeze
Generating GTK icon cache for /usr/local/share/icons/hicolor
Generating GTK icon cache for /usr/local/share/icons/Breeze_Snow
==> Running trigger: gio-modules.ucl
Generating GIO modules cache
==> Running trigger: glib-schemas.ucl
Compiling glib schemas
Attenzione: lo schema «org.gnome.crypto.cache» ha un percorso «/desktop/gnome/crypto/cache/»; i percorsi che iniziano con «/apps/», «/desktop/» o «/system/» non sono più supportati.
Attenzione: lo schema «org.gnome.crypto.pgp» ha un percorso «/desktop/gnome/crypto/pgp/»; i percorsi che iniziano con «/apps/», «/desktop/» o «/system/» non sono più supportati.
Attenzione: lo schema «org.gnome.system.locale» ha un percorso «/system/locale/»; i percorsi che iniziano con «/apps/», «/desktop/» o «/system/» non sono più supportati.
Attenzione: lo schema «org.gnome.system.proxy» ha un percorso «/system/proxy/»; i percorsi che iniziano con «/apps/», «/desktop/» o «/system/» non sono più supportati.
Attenzione: lo schema «org.gnome.system.proxy.http» ha un percorso «/system/proxy/http/»; i percorsi che iniziano con «/apps/», «/desktop/» o «/system/» non sono più supportati.
Attenzione: lo schema «org.gnome.system.proxy.https» ha un percorso «/system/proxy/https/»; i percorsi che iniziano con «/apps/», «/desktop/» o «/system/» non sono più supportati.
Attenzione: lo schema «org.gnome.system.proxy.ftp» ha un percorso «/system/proxy/ftp/»; i percorsi che iniziano con «/apps/», «/desktop/» o «/system/» non sono più supportati.
Attenzione: lo schema «org.gnome.system.proxy.socks» ha un percorso «/system/proxy/socks/»; i percorsi che iniziano con «/apps/», «/desktop/» o «/system/» non sono più supportati.
=====
Message from caddy-2.9.1:

--
It is STRONGLY RECOMMENDED to run Caddy as an unprivileged user, such as
www:www, rather than the current default of root:wheel.

If you have relied upon earlier defaults:

- Use security/portacl-rc to enable privileged port binding:

  # pkg install security/portacl-rc
  # sysrc portacl_users+=www
  # sysrc portacl_user_www_tcp="http https"
  # sysrc portacl_user_www_udp="https"
  # service portacl enable
  # service portacl start

- Stop the server, and update ownership on Caddy runtime files:

  # service caddy stop
  # chown -R www:www /var/db/caddy /var/log/caddy /var/run/caddy

Other changes may be necessary depending on your exact Caddy
configuration.

- Change the default runtime user, and restart the server:

  # sysrc caddy_user=www caddy_group=www
  # service caddy start
=====
Message from emacs-devel-31.0.50.20250115,3:

--
Emacs is now built with native compilation enabled by default, which
requires GCC version 11 or later.  However, it is known that some
elisp applications don't work correctly when compiled.  You can work
around any such issues by disabling native compilation using the
following steps.

1. Add the following lines at the top of your Emacs configuration:

(setq native-comp-deferred-compilation nil
comp-enable-subr-trampolines nil)

2. Exit emacs

3. rm -rf ~/.emacs.d/eln-cache

4. Start emacs again

Whereas all elisp files included in the Emacs source archive are
native compiled at build time, 3rd party elisp files (for example,
from elisp ports/packages) are native compiled at run time. This will
result in high CPU usage when they are compiled. If this annoys you,
you can throttle the number of jobs by changing the value of the
variable 'native-comp-async-jobs-number' in your emacs
configuration. See the output of `C-h v native-comp-async-jobs-number`
for details.
You may need to manually remove /usr/local/etc/sudoers if it is no longer needed.
=====
Message from libxine-1.2.13_12:

--
===>   NOTICE:

The libxine port currently does not have a maintainer. As a result, it is
more likely to have unresolved issues, not be up-to-date, or even be removed in
the future. To volunteer to maintain this port, please create an issue at:

https://bugs.freebsd.org/bugzilla

More information about port maintainership is available at:

https://docs.freebsd.org/en/articles/contributing/#ports-contributing
--
===>   NOTICE:

This port is deprecated; you may wish to reconsider installing it:

Depends on expired multimedia/libfame.

It is scheduled to be removed on or after 2025-02-01.
=====
Message from openvpn-2.6.13:

--
Note that OpenVPN now configures a separate user and group "openvpn",
which should be used instead of the NFS user "nobody"
when an unprivileged user account is desired.

It is advisable to review existing configuration files and
to consider adding/changing user openvpn and group openvpn.
=====
Message from uTox-0.17.2_8:

--
===>   NOTICE:

The uTox port currently does not have a maintainer. As a result, it is
more likely to have unresolved issues, not be up-to-date, or even be removed in
the future. To volunteer to maintain this port, please create an issue at:

https://bugs.freebsd.org/bugzilla

More information about port maintainership is available at:

https://docs.freebsd.org/en/articles/contributing/#ports-contributing
=====
Message from e2fsprogs-core-1.47.2:

--
Note: this is a modified version of the e2fsprogs package, not the official
package. Report all building and run-time trouble that originates in the
package to the port maintainer, mandree@FreeBSD.org.

and now ? I suspect that the syntax error occurred will make my system unstable. What should I do ?
 
Code:
# kate /etc/rc.d/ldconfig

#!/bin/sh
#
# $FreeBSD$
#

# PROVIDE: ldconfig
# REQUIRE: FILESYSTEMS
# BEFORE:  DAEMON

. /etc/rc.subr

name="ldconfig"
desc="Configure the shared library cache"
ldconfig_command="/sbin/ldconfig"
start_cmd="ldconfig_start"
stop_cmd=":"

ldconfig_paths()
{
    local _dirs _files _ii _ldpaths _paths

    _dirs="${1}"
    _paths="${2}"
    _ldpaths="${3}"

    for _ii in ${_dirs}; do
        if [ -d "${_ii}" ]; then
            _files=`find ${_ii} -type f`
            if [ -n "${_files}" ]; then
                _paths="${_paths} `cat ${_files} | sort -u`"
            fi
        fi
    done
    for _ii in ${_paths}; do
        if [ -r "${_ii}" ]; then
            _ldpaths="${_ldpaths} ${_ii}"
        fi
    done

    echo "${_ldpaths}"
}

ldconfig_start()
{
    local _files _ins

    _ins=
    ldconfig=${ldconfig_command}
    checkyesno ldconfig_insecure && _ins="-i"
    if [ -x "${ldconfig_command}" ]; then
#<<<<<<< current version
        _LDC="/lib /usr/lib"
        for i in ${ldconfig_local_dirs}; do
            if [ -d "${i}" ]; then
                _files=`find ${i} -type f`
                if [ -n "${_files}" ]; then
                    ldconfig_paths="${ldconfig_paths} `cat ${_files} | sort -u`"
                fi
            fi
        done
        for i in ${ldconfig_paths} /etc/ld-elf.so.conf; do
            if [ -r "${i}" ]; then
                _LDC="${_LDC} ${i}"
            fi
        done
        check_startmsgs && echo 'ELF ldconfig path:' ${_LDC}
#=======
        _LDC=$(/libexec/ld-elf.so.1 -v | sed -n -e '/^Default lib path /s///p' | tr : ' ')
        _LDC=$(ldconfig_paths "${ldconfig_local_dirs}" \
            "${ldconfig_paths} /etc/ld-elf.so.conf" "$_LDC")
        startmsg 'ELF ldconfig path:' ${_LDC}
#>>>>>>> 14.2-RELEASE
        ${ldconfig} -elf ${_ins} ${_LDC}

#<<<<<<< current version
        machine_arch=$(sysctl -n hw.machine_arch)

        case ${machine_arch} in
        amd64|mips64|powerpc64)
            for i in ${ldconfig_local32_dirs}; do
                if [ -d "${i}" ]; then
                    _files=`find ${i} -type f`
                    if [ -n "${_files}" ]; then
                        ldconfig32_paths="${ldconfig32_paths} `cat ${_files} | sort -u`"
                    fi
                fi
            done
#=======
        if check_kern_features compat_freebsd32; then
#>>>>>>> 14.2-RELEASE
            _LDC=""
#<<<<<<< current version
            for i in ${ldconfig32_paths}; do
                if [ -r "${i}" ]; then
                    _LDC="${_LDC} ${i}"
                fi
            done
            check_startmsgs &&
                echo '32-bit compatibility ldconfig path:' ${_LDC}
#=======
            if [ -x /libexec/ld-elf32.so.1 ]; then
                for x in $(/libexec/ld-elf32.so.1 -v | sed -n -e '/^Default lib path /s///p' | tr : ' '); do
                    if [ -d "${x}" ]; then
                        _LDC="${_LDC} ${x}"
                    fi
                done
            fi
            _LDC=$(ldconfig_paths "${ldconfig_local32_dirs}" \
                "${ldconfig32_paths}" "$_LDC")
            startmsg '32-bit compatibility ldconfig path:' ${_LDC}
#>>>>>>> 14.2-RELEASE
            ${ldconfig} -32 ${_ins} ${_LDC}
            ;;
        esac

        case ${machine_arch} in
        armv[67])
            for i in ${ldconfig_localsoft_dirs}; do
                if [ -d "${i}" ]; then
                    _files=`find ${i} -type f`
                    if [ -n "${_files}" ]; then
                        ldconfigsoft_paths="${ldconfigsoft_paths} `cat ${_files} | sort -u`"
                    fi
                fi
            done
            _LDC=""
            for i in ${ldconfigsoft_paths}; do
                if [ -r "${i}" ]; then
                    _LDC="${_LDC} ${i}"
                fi
            done
            check_startmsgs &&
                echo 'Soft Float compatibility ldconfig path:' ${_LDC}
            ${ldconfig} -soft ${_ins} ${_LDC}
            ;;
        esac
    fi
}

load_rc_config $name
run_rc_command "$1"
 
So you have a bunch of unresolved merge issues in /etc/rc.d/ldconfig.
 
I'm not sure what to do when there are differences between versions. Let's take the example showed on post #2.
How should I merge the differences ? using method A) or B) showed below ? thanks.

A)

Code:
#!/bin/sh
#
# $FreeBSD$
#

# PROVIDE: ldconfig
# REQUIRE: FILESYSTEMS
# BEFORE:  DAEMON

. /etc/rc.subr

name="ldconfig"
desc="Configure the shared library cache"
ldconfig_command="/sbin/ldconfig"
start_cmd="ldconfig_start"
stop_cmd=":"

ldconfig_paths()
{
    local _dirs _files _ii _ldpaths _paths

    _dirs="${1}"
    _paths="${2}"
    _ldpaths="${3}"

    for _ii in ${_dirs}; do
        if [ -d "${_ii}" ]; then
            _files=`find ${_ii} -type f`
            if [ -n "${_files}" ]; then
                _paths="${_paths} `cat ${_files} | sort -u`"
            fi
        fi
    done
    for _ii in ${_paths}; do
        if [ -r "${_ii}" ]; then
            _ldpaths="${_ldpaths} ${_ii}"
        fi
    done

    echo "${_ldpaths}"
}

ldconfig_start()
{
    local _files _ins

    _ins=
    ldconfig=${ldconfig_command}
    checkyesno ldconfig_insecure && _ins="-i"
    if [ -x "${ldconfig_command}" ]; then
        _LDC=$(/libexec/ld-elf.so.1 -v | sed -n -e '/^Default lib path /s///p' | tr : ' ')
        _LDC=$(ldconfig_paths "${ldconfig_local_dirs}" \
            "${ldconfig_paths} /etc/ld-elf.so.conf" "$_LDC")
        startmsg 'ELF ldconfig path:' ${_LDC}
        ${ldconfig} -elf ${_ins} ${_LDC}
        if check_kern_features compat_freebsd32; then
            _LDC=""
            if [ -x /libexec/ld-elf32.so.1 ]; then
                for x in $(/libexec/ld-elf32.so.1 -v | sed -n -e '/^Default lib path /s///p' | tr : ' '); do
                    if [ -d "${x}" ]; then
                        _LDC="${_LDC} ${x}"
                    fi
                done
            fi
            _LDC=$(ldconfig_paths "${ldconfig_local32_dirs}" \
                "${ldconfig32_paths}" "$_LDC")
            startmsg '32-bit compatibility ldconfig path:' ${_LDC}
            ${ldconfig} -32 ${_ins} ${_LDC}
            ;;
        esac

        case ${machine_arch} in
        armv[67])
            for i in ${ldconfig_localsoft_dirs}; do
                if [ -d "${i}" ]; then
                    _files=`find ${i} -type f`
                    if [ -n "${_files}" ]; then
                        ldconfigsoft_paths="${ldconfigsoft_paths} `cat ${_files} | sort -u`"
                    fi
                fi
            done
            _LDC=""
            for i in ${ldconfigsoft_paths}; do
                if [ -r "${i}" ]; then
                    _LDC="${_LDC} ${i}"
                fi
            done
            check_startmsgs &&
                echo 'Soft Float compatibility ldconfig path:' ${_LDC}
            ${ldconfig} -soft ${_ins} ${_LDC}
            ;;
        esac
    fi
}

load_rc_config $name
run_rc_command "$1"

B)

Code:
#!/bin/sh
#
# $FreeBSD$
#

# PROVIDE: ldconfig
# REQUIRE: FILESYSTEMS
# BEFORE:  DAEMON

. /etc/rc.subr

name="ldconfig"
desc="Configure the shared library cache"
ldconfig_command="/sbin/ldconfig"
start_cmd="ldconfig_start"
stop_cmd=":"

ldconfig_paths()
{
    local _dirs _files _ii _ldpaths _paths

    _dirs="${1}"
    _paths="${2}"
    _ldpaths="${3}"

    for _ii in ${_dirs}; do
        if [ -d "${_ii}" ]; then
            _files=`find ${_ii} -type f`
            if [ -n "${_files}" ]; then
                _paths="${_paths} `cat ${_files} | sort -u`"
            fi
        fi
    done
    for _ii in ${_paths}; do
        if [ -r "${_ii}" ]; then
            _ldpaths="${_ldpaths} ${_ii}"
        fi
    done

    echo "${_ldpaths}"
}

ldconfig_start()
{
    local _files _ins

    _ins=
    ldconfig=${ldconfig_command}
    checkyesno ldconfig_insecure && _ins="-i"
    if [ -x "${ldconfig_command}" ]; then
        _LDC="/lib /usr/lib"
        for i in ${ldconfig_local_dirs}; do
            if [ -d "${i}" ]; then
                _files=`find ${i} -type f`
                if [ -n "${_files}" ]; then
                    ldconfig_paths="${ldconfig_paths} `cat ${_files} | sort -u`"
                fi
            fi
        done
        for i in ${ldconfig_paths} /etc/ld-elf.so.conf; do
            if [ -r "${i}" ]; then
                _LDC="${_LDC} ${i}"
            fi
        done
        check_startmsgs && echo 'ELF ldconfig path:' ${_LDC}
        _LDC=$(/libexec/ld-elf.so.1 -v | sed -n -e '/^Default lib path /s///p' | tr : ' ')
        _LDC=$(ldconfig_paths "${ldconfig_local_dirs}" \
            "${ldconfig_paths} /etc/ld-elf.so.conf" "$_LDC")
        startmsg 'ELF ldconfig path:' ${_LDC}
        ${ldconfig} -elf ${_ins} ${_LDC}
        machine_arch=$(sysctl -n hw.machine_arch)

        case ${machine_arch} in
        amd64|mips64|powerpc64)
            for i in ${ldconfig_local32_dirs}; do
                if [ -d "${i}" ]; then
                    _files=`find ${i} -type f`
                    if [ -n "${_files}" ]; then
                        ldconfig32_paths="${ldconfig32_paths} `cat ${_files} | sort -u`"
                    fi
                fi
            done
        if check_kern_features compat_freebsd32; then
            _LDC=""
            for i in ${ldconfig32_paths}; do
                if [ -r "${i}" ]; then
                    _LDC="${_LDC} ${i}"
                fi
            done
            check_startmsgs &&
                echo '32-bit compatibility ldconfig path:' ${_LDC}
            if [ -x /libexec/ld-elf32.so.1 ]; then
                for x in $(/libexec/ld-elf32.so.1 -v | sed -n -e '/^Default lib path /s///p' | tr : ' '); do
                    if [ -d "${x}" ]; then
                        _LDC="${_LDC} ${x}"
                    fi
                done
            fi
            _LDC=$(ldconfig_paths "${ldconfig_local32_dirs}" \
                "${ldconfig32_paths}" "$_LDC")
            startmsg '32-bit compatibility ldconfig path:' ${_LDC}
            ${ldconfig} -32 ${_ins} ${_LDC}
            ;;
        esac

        case ${machine_arch} in
        armv[67])
            for i in ${ldconfig_localsoft_dirs}; do
                if [ -d "${i}" ]; then
                    _files=`find ${i} -type f`
                    if [ -n "${_files}" ]; then
                        ldconfigsoft_paths="${ldconfigsoft_paths} `cat ${_files} | sort -u`"
                    fi
                fi
            done
            _LDC=""
            for i in ${ldconfigsoft_paths}; do
                if [ -r "${i}" ]; then
                    _LDC="${_LDC} ${i}"
                fi
            done
            check_startmsgs &&
                echo 'Soft Float compatibility ldconfig path:' ${_LDC}
            ${ldconfig} -soft ${_ins} ${_LDC}
            ;;
        esac
    fi
}

load_rc_config $name
run_rc_command "$1"
 
Fully replace /etc/rc.d/ldconfig with the newer version. If you use FreeBSD 14.2, for example, take the file from official install images for FreeBSD 14.2.

Very few users have a valid reason to have custom modifications to that file.
 
Fully replace /etc/rc.d/ldconfig with the newer version. If you use FreeBSD 14.2, for example, take the file from official install images for FreeBSD 14.2.

Very few users have a valid reason to have custom modifications to that file.

I need to understand what to do everytime that I see some parts of the code with mixed differences between versions. If cut or keep the code of the previous version.
 
I need to understand what to do everytime that I see some parts of the code with mixed differences between versions. If cut or keep the code of the previous version.
The "rule" should be: if you have changes that you made to keep, than keep them, and if the OS upgrade obliges you to update the changes you made, then do it. Otherwise, go with the default.

That said, I never had merge conflicts with /etc/rc.d/ldconfig. Why it was modified in the first place?
 
I need to understand what to do everytime that I see some parts of the code with mixed differences between versions. If cut or keep the code of the previous version.
Usually, etcupdate(8) does the right things if the first preparation is done correctly, but some exceptions.

etcupdate(8) uses diff3(1) to compare previous/current defaults and what actually in-place. So to work correctly, requires multiple matching lines before and after differences.

This means, for example, if the difference exists at the near-top that cannot get necessary matching lines before differences, etcupdate(8) cannot be sure enough that the differences found is correct or not.
This quite often happened for version strings at almost the top of files and etcupdate(8) has an option -F to ignore FreeBSD ID string, and recently these version strings are going to be deleted (on the way) to avoid the problem as much as possible.

Another case is conflicts. If current default and in-place file modifies previous default differently, etcupdate(8) cannot decide which change is correct. The most recent example I can recall is the switch of default shell for root from (t)csh(1) to sh(1).
As the comparisons are done per-line and entries in /etc/master.passwd is per-line, too, and sane admins always surely set password for root, unless the admin is NOT crazy, conflict happened 100% and a plenty of screams are found in this forums with multiple almost identical threads are created. An example how conflicts are marked can be seen here, section 8.2.
These marks are placed in in-place files, so if any, you must fix all of them manually.
 
The "rule" should be: if you have changes that you made to keep, than keep them, and if the OS upgrade obliges you to update the changes you made, then do it. Otherwise, go with the default.

That said, I never had merge conflicts with /etc/rc.d/ldconfig. Why it was modified in the first place?
Not sure in his case, but typical cases are differences in FreeBSD ID strings, if at least the previous version was old enough that had one.
 
Not sure in his case, but typical cases are differences in FreeBSD ID strings, if at least the previous version was old enough that had one.
Right, I dealt with some of them myself, but according to his post the changes are not so trivial.
 
Right, I dealt with some of them myself, but according to his post the changes are not so trivial.
Another trivial possibility is that missingly and un-noticedly edited the file when he opened the file with some kind of editors as enough-priviledged user, not pagers/viewers.
 
My system totally broken after replacing ldconfig with a fresh version of the same,taken from 14.2 source. Don't know how to fix it because I don't know where the broken parts are. I think that I should perform an heavy reinstallation of the whole system.
 
No error messages. Every desktop environment I tried was not able to work properly. I saw icons containing labels with strange characters and abnormal panels that opened where they shouldn't. Anyway it was not even able to boot. I'm dd'ing an old backup. The broken OS is died bringing with it all the problems it had.
 
I'm upgrading 14.1-RELEASE to 14.2-RELEASE using freebsd-update. It proposed some differences that I have accepted by default and that I have stored here :


can someone give a look ? For sure I don't want that the 14.2 in the future will break again because I have accepted some wrong statement.
 
That /etc/rc.d/ldconfig still contains evidence of merge markers. copy that file from an install image. It also looks like you've been modifying /etc/defaults/rc.conf, which is specifically recommended against. Local customizations for that file go in /etc/rc.conf.
 
I'm upgrading 14.1-RELEASE to 14.2-RELEASE using freebsd-update. It proposed some differences that I have accepted by default and that I have stored here :


can someone give a look ? For sure I don't want that the 14.2 in the future will break again because I have accepted some wrong statement.
Not looked into in detail/thoroughly, but there's a merge conflict near the top.
Code:
+#<<<<<<< current version
 # $FreeBSD$
 hint.fdc.0.at="isa"
 hint.fdc.0.port="0x3F0"
 hint.fdc.0.irq="6"
 hint.fdc.0.drq="2"
 hint.fd.0.at="fdc0"
 hint.fd.0.drive="0"
 hint.fd.1.at="fdc0"
 hint.fd.1.drive="1"
+#=======
+#>>>>>>> 14.2-RELEASE

Would be more.
At least all of these needs to be resolved.
 
I don't know if it is correct or not,but I've replaced all the files that should be resolved with the same files stored inside the files called base.txz and kernel.txz and I've replaced the old / unresolved files with these ones and I've understood that to resolve a file I should remove the part of the code that starts with :

Code:
<<<<<<< current version

and ends with :

Code:
=======

in other words,I should keep only the code that's written under this label :

Code:
>>>>>>> 14.2-RELEASE
 
I don't know if it is correct or not,but I've replaced all the files that should be resolved with the same files stored inside the files called base.txz and kernel.txz and I've replaced the old / unresolved files with these ones and I've understood that to resolve a file I should remove the part of the code that starts with :

<<<<<<< current version

and ends with :

=======

in other words,I should keep only the code that's under this label :

>>>>>>> 14.2-RELEASE
It depends.
If you're 100% sure you've untouched (directly by editors and/or tools like adduser(8)), you're right (don't forget to remove the markers itself).

But it it's anything you modified (i.e.,/etc/master.passwd, /etc/group,...), you must be careful not to lose the modifications (by added user, switched shell, installing ports/pkgs, ...).

You'll find tons of posts/threads here related with etcupdate(8), especially about recent switch of root's default shell from (t)csh to sh.
 
Back
Top