From nobody Tue Oct 03 22:14:10 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 4S0XD30cbWz4w4Bm; Tue, 3 Oct 2023 22:14:11 +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 4S0XD26WG1z4s7n; Tue, 3 Oct 2023 22:14:10 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1696371251; 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=BR/p81fNWkPFFZ9ELo3+l2Jr25F8ZKnEggakkoOf6dA=; b=pgA7XNxmyL5t5Z4REuCd6+Q7VOENGxzKtSRWJscTi5opAmrXhR+QKShGyO/E2liaxPEKWR S+DgR7LEC98pNLQ71OaHnwKIHG8s88s8sjVZNG/OJqqqkMvye+9xZNMn/p6Ib98zkfBq4P QVgEZza1sAsVKlPFl8/kOICOOKag7A3bydUpYX4kxnB7JWgjqDBnqBzXnjhW6ABQDMBWr+ q6p/Za+lFEP2KSz6JiWBJqI3NEDUL3aAV3nHMod5cCnJbgqerzM6/zjsLeteEJIVn9dHCm SrskP0w931Iemtm1F24v/7TzyNNNY4ddLHs4XP8MiWgCelG313HdOJGr2Vf5Ww== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1696371251; a=rsa-sha256; cv=none; b=QsxVYoBUtwFfkegC7nrrsl7odglfW6rtw6HWg9MAZlXDY9qzpGdCsPGqlPkDvlVqZz0fFy +18Apa8QBDd8T4Gfm117Pz0QsjxSZxyThokC12HevgPGLdLf0KdJXaDu/3EDCHBRImkh4U wC9ph4GqHg2ztU04u6kWoFiLW7T1YauDT+rgQC55/NdSz7XI/5IM4zZyGs7MHMX87eVZTt 46gWxhUKzkD2KrQsurOIzlXWu3qfySJwTnPdQrtdcMzRcdIizlQBM4TB2/YszAAg9NF+RD rxieA7Zxqw9U2mQO62/XGMJr+IlTHWrqOVkopn1guESaU+gImn+KCWJqan+tWw== 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=1696371251; 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=BR/p81fNWkPFFZ9ELo3+l2Jr25F8ZKnEggakkoOf6dA=; b=fFySlpNIXsfo8qoT5K/iGAsjgK+Jobu03O/E17e1br4qT/J1Lctc6EwdrYYaDmadWbNzc+ w8cAFFOKlg/wrgvehEpOxeF4RiU/4b2bQAbyqiwYIp3jo7P8Xu7FF+BRcW90xNryMtK00i rU5tlT6/Eu0pxPczs/zPn7V01Pl6rRD5DRjuAFeEuSH4WjgUEiuC5j2YUJW+sp/jpBOdDP c2dy6lgMckpQ14c0BzKqhcvvvDs3XnGyl4b7yICFmwfbnaO9WPUGACXNBxs5Rsx1Qgo+6k QdxQDOK2RrAHWtrfuBN3id6PVPzACt82taDNrlCExoPDYjD+nf60OIDbAZa87g== 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 4S0XD25ZjFz1BrD; Tue, 3 Oct 2023 22:14:10 +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 393MEA4f071374; Tue, 3 Oct 2023 22:14:10 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 393MEAxG071371; Tue, 3 Oct 2023 22:14:10 GMT (envelope-from git) Date: Tue, 3 Oct 2023 22:14:10 GMT Message-Id: <202310032214.393MEAxG071371@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Gordon Tetlow Subject: git: 0eb6c273622d - releng/12.4 - 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: gordon X-Git-Repository: src X-Git-Refname: refs/heads/releng/12.4 X-Git-Reftype: branch X-Git-Commit: 0eb6c273622d77a89115e7d4f01609eefc50b33c Auto-Submitted: auto-generated The branch releng/12.4 has been updated by gordon: URL: https://cgit.FreeBSD.org/src/commit/?id=0eb6c273622d77a89115e7d4f01609eefc50b33c commit 0eb6c273622d77a89115e7d4f01609eefc50b33c Author: Ed Maste AuthorDate: 2023-09-27 13:36:33 +0000 Commit: Gordon Tetlow CommitDate: 2023-10-03 21:10:42 +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 Approved by: so Security: FreeBSD-EN-23:12.freebsd-update Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D41893 (cherry picked from commit f6d37c9ca13f8ab0ef32cf5344daecb8122d1e85) (cherry picked from commit 274281864fc03c62443677751bf3036fbbf9d778) --- 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 57d94a25881a..324e838fd8a7 100644 --- a/usr.sbin/freebsd-update/freebsd-update.sh +++ b/usr.sbin/freebsd-update/freebsd-update.sh @@ -2892,7 +2892,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} ;;