From nobody Sun Oct 01 13:07:17 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 4Rz49y0flHz4vGpR; Sun, 1 Oct 2023 13:07:18 +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 4Rz49y06dbz4NyD; Sun, 1 Oct 2023 13:07:18 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1696165638; 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=geFe3S4PGQUUYJewWC2StnHlHvkCVj/PlNUbLUOZ8lw=; b=xPWAazZEImvbH/WJ68rsHLxd/JeOqCsPbxZWvII+uNCrJYIsvdhq/SfLOjceTrAgOBtF8e Re7g8hVQn5g3DKlNmQ/OMjSkoPp+QOIHEatJk8NmapBRiwqTDRLGTBYKRX2PrH1Pt93Svn F8q50NWs0chEEB8JHc6e8WSOV330s+aG1du0CdqoH7sGc6pWTN3D1j60+aVVqPyO7Zulyo FLZ45HCZiJlRXTUd5jz7+b79uCKPc3HERAgaRWPlRnVmIYfOvjh5xpDn+TcDybhyskUsw1 /10Yss58x8ES+Ec4u4e+uJn42/sWAWpQXPxZJrCu/xES2xkx89ey3/0eT1BYjQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1696165638; a=rsa-sha256; cv=none; b=hBZqyR3SmP6N13acbN7+mrWld8w9qtAFI1gwa7fUxMq+5xkdfJ97IpKzI9GXMawKgsQl5J wIRRUU/876WYG0jSfxYbLRXg8ZAQ31IO+r2u379lyj4vEAR5Gt4Nu+p3ZP3MYccDF2c/bS /F9Ik5x+foZBHhdX7KC+OMRuZecvKDjKn0OuoN2WwtbkhIaY9EqVMa0WvDTx75lJQ5RVO/ 0JBB3Q7mQB2GWzsjxaMeWQCn0PX8aQ7eO+VwMxhRSVeG9lI5KeZUX/KsV3ysC1LCMQtomW 1irQoZdI/4KfeTuHtilagNWuW+DhIyvVolhYniK14zJc1eJ5y4hQgWV4Ks/VNw== 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=1696165638; 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=geFe3S4PGQUUYJewWC2StnHlHvkCVj/PlNUbLUOZ8lw=; b=KNhGpblp7wSu9dCrnkVu96MVBXJtJRsU0Z4hOy1YphjG6K5KmFYBVQV6vrxluAgXeUh2fX OuJ/iQ7jgN9MoGCwLrlp+sei172OU8s6/Je7/xOY7T07yuteZVRn8QdRgCQY7RCLCIx1Sj uG9Leh54N1dXe2iO6j903Hw1CXAAyT1YOp3Yifjx98UEE/oM4KqA3+B2kN3F9ASOm9eic/ quM1MqXF2DJBMlg4rgh7Th6lW0k+DS0ah+zpj1j2RV6cIXe7bT/3ej4S8E9U9JhV4NiCoT kjSrQTPoLacwQr/yyd4tUrRR6NdniPPI11v+v1KUkqqOSBo5QKZYvvhADCnVeQ== 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 4Rz49x6HHvzWNF; Sun, 1 Oct 2023 13:07:17 +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 391D7Hss058537; Sun, 1 Oct 2023 13:07:17 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 391D7Hta058534; Sun, 1 Oct 2023 13:07:17 GMT (envelope-from git) Date: Sun, 1 Oct 2023 13:07:17 GMT Message-Id: <202310011307.391D7Hta058534@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: bc412215646c - stable/14 - 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/14 X-Git-Reftype: branch X-Git-Commit: bc412215646cbb21529156d08fbbb7bbf5028c26 Auto-Submitted: auto-generated The branch stable/14 has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=bc412215646cbb21529156d08fbbb7bbf5028c26 commit bc412215646cbb21529156d08fbbb7bbf5028c26 Author: Ed Maste AuthorDate: 2023-09-27 13:36:33 +0000 Commit: Ed Maste CommitDate: 2023-10-01 13:06:44 +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 9cdff05c24e4..b9b277cca1c8 100644 --- a/usr.sbin/freebsd-update/freebsd-update.sh +++ b/usr.sbin/freebsd-update/freebsd-update.sh @@ -2903,7 +2903,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} ;;