From nobody Sun Oct 01 16:34:08 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Rz8mc2DKzz4vX2K; Sun, 1 Oct 2023 16:34:08 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Rz8mc1jvHz3RJk; Sun, 1 Oct 2023 16:34:08 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1696178048; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=HQ28zKlhBJhFiBAzN0GVRdVXY/CND/wUEHCVsB3AVa0=; b=S7Olr1aex417ncn+69FJoubtNWU1Cvl5T8LVpUTiJShabSjS7/VDlD5XZMrajWmHWYkq4m hJjueTOBaWkZP9vpuidTkeJ9IBLg7zthdg6a25t56IpQrpMeSeNvF26ByJ79k7z1fUUIIv yBtKyV+SJtdcLqVjpAFtLbfmwDYsVbI9o+/5P9v1DOHPN4x07RKdeDUfQSYUbuM3jsBpxE D0QYmuzoFH1gIXhkP/hxAOmxV/q2a97ZeokAbZAnXtctrScyjC7ZZPEZV1IqbIfTV51hjE ec6rW6nNYkha5hEJKAT1XNHVsUrupi00ibK8ZZVkszCzNMuuKLZmnhWCMI2qBw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1696178048; a=rsa-sha256; cv=none; b=DwPJaUG8JpQX19SqI+3+2N7liwUHFLxXkPLNZqrK3p7F6/IP2Yq26gTx5DKPtHs+l9k2ut uZN/xCSF9ClELtdYtS4Bu8tsT/9ID7rJjCpRLnULoclviv20vTY0kMXV7S7a54UZ070dAU wKxxxiayBgnNbti/6UxJEB/PGFiKVkSEIQL0OGGNElF+FloccPpC8lSQIHcz64g+rQUIdV jxS9wDMIMYzY/UWKhjGGJ1pUzuVt1W5Jxo+mFCpSDa681uTy/qzpbxrKi+Yqm6/A5kvQak gAr5j8mxiAR9bd2PJM2eQt/QVIcx0j18d6fDkzyFpi6dOXcofAxSNZN7ojercg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1696178048; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=HQ28zKlhBJhFiBAzN0GVRdVXY/CND/wUEHCVsB3AVa0=; b=ff7gK+UZuSDWqQk72VQVYgly3dFmPIca0s16j0FarQwTJXL40VryqtqFIaREf4zAF355m6 1nac6zYeEkLFMc4anvetVLXIzBlyd0a4Yy7AnUtkNdfCBJbBXVqZLskO/E6ujoWV5kYAZ/ 5ZDBWzMsYmpoJb+kfuuhbvJGKvkxegIQ6q85gMMxunPTUUFer8TPcJzTSTosxFaWY8ELLc PdVTXi4i+aOrLHrDRsjmT3eplBJVWmSxRQPknmuPiM5CUbbCFXR+3/saqJxKdV6t+bXW0R zqLSWrCGSC7sXVyKRdsC6rW64NZo2WHzYbH45XK9u0oL7lujghKvcyy9jjFxAg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Rz8mc0mZhzcmC; Sun, 1 Oct 2023 16:34:08 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 391GY8Pd005939; Sun, 1 Oct 2023 16:34:08 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 391GY8qh005936; Sun, 1 Oct 2023 16:34:08 GMT (envelope-from git) Date: Sun, 1 Oct 2023 16:34:08 GMT Message-Id: <202310011634.391GY8qh005936@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Ed Maste Subject: git: 274281864fc0 - stable/12 - freebsd-update: handle file -> directory on upgrade List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: emaste X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: 274281864fc03c62443677751bf3036fbbf9d778 Auto-Submitted: auto-generated The branch stable/12 has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=274281864fc03c62443677751bf3036fbbf9d778 commit 274281864fc03c62443677751bf3036fbbf9d778 Author: Ed Maste AuthorDate: 2023-09-27 13:36:33 +0000 Commit: Ed Maste CommitDate: 2023-10-01 16:33:56 +0000 freebsd-update: handle file -> directory on upgrade Upgrading from FreeBSD 13.2 to 14.0 failed with install: ///usr/include/c++/v1/__string exists but is not a directory because __string changed from a file to a directory with an LLVM upgrade. Now, remove the existing file when the type conflicts. Note that this is only an interim fix to facilitate upgrades from 13.2 for 14.0 BETA testing. This change does not handle the directory -> file case and further work is needed. PR: 273661 Reviewed by: dim, gordon Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D41893 (cherry picked from commit f6d37c9ca13f8ab0ef32cf5344daecb8122d1e85) --- usr.sbin/freebsd-update/freebsd-update.sh | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/usr.sbin/freebsd-update/freebsd-update.sh b/usr.sbin/freebsd-update/freebsd-update.sh index 0641aa41921c..a01e81d7be49 100644 --- a/usr.sbin/freebsd-update/freebsd-update.sh +++ b/usr.sbin/freebsd-update/freebsd-update.sh @@ -2905,7 +2905,13 @@ install_from_index () { while read FPATH TYPE OWNER GROUP PERM FLAGS HASH LINK; do case ${TYPE} in d) - # Create a directory + # Create a directory. A file may change to a directory + # on upgrade (PR273661). If that happens, remove the + # file first. + if [ -e "${BASEDIR}/${FPATH}" ] && \ + ! [ -d "${BASEDIR}/${FPATH}" ]; then + rm -f -- "${BASEDIR}/${FPATH}" + fi install -d -o ${OWNER} -g ${GROUP} \ -m ${PERM} ${BASEDIR}/${FPATH} ;;