From nobody Sun Oct 01 16:33:11 2023 X-Original-To: dev-commits-src-branches@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 4Rz8lW6fKYz4vWlB; Sun, 1 Oct 2023 16:33: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 4Rz8lW688rz3Qt6; Sun, 1 Oct 2023 16:33:11 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1696177991; 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=oVoyy+9NOVuV1ro0IGc7AI55uL8P08OY/EdaF4yK/ak=; b=ZZ0192LcCbJa1Clifn82mubqWLPb7mh9ki0Zq2b53wcbRlY3mgbWvdf4WfsMRkltwIFZ2H ACmHE6Gpa/A9P7kIxsQJ+ovC2eNy/s8DGERNdQD03Uu3PvQ7DOio3kLbzlZN8HkjYZd5cz bfrfW4Z8XgasRI8DOU/vJpk9YUGwcxebww4+k7KH2jihoXLn8dCUG1o9cQGuAkhfSPLPGz 6kG6S6W3VNo48qe4u+4xT10u8S7xyjnbVi/SzTiuBjQlfXDUhGuS4YFrM6IIEmUmRWMokk hnU1bjipJbJe6Lqpo3EaHFxpXdcBZSqKgHGxkSlamblIZXBJK6+igkEwITWfQQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1696177991; a=rsa-sha256; cv=none; b=xWjJifABfUZJi5O9XcnFvQ93Urvi1vrury8HCQ6clm3GZ/j4TLRU4XegdXphnDEFP7maEj O45rqVyfkhdB8XImQLfErwNGYmhLdOR28EUSLLKBHZnlks9+NIYogz46SYRzT8fLPEv5Ke iGfSNbfDyFIyM8etvDNj6yQ1uQktUqVHW54EV5mC0NODLz10lhtM9mhGqct4oKfBt8vUsT APbs0PsOi9UJbLTCWhU/cany9JWNpk2Yj4GVNEqgaT/HRato+yCxR9wAUby2yEwlxgEFhF /h9sg+gMJ1o+4nclNkemTachPFUICQBLrfCggCu4W3tgvnNKeUMSxJ6SoIZdPA== 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=1696177991; 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=oVoyy+9NOVuV1ro0IGc7AI55uL8P08OY/EdaF4yK/ak=; b=HjLPkKdX4w3F/TQgZUTlzmUSMCsn30jwudZFGmWcYGYaABrWhfe2dVNXZGjEvb4MDFHCRH hjzrkqiJGfRY0+FjuMUXFrDTBZk2UUzf6aIyvRu6nGrdlnMwEcck/LycJ9U+XvID5jmhdP RwoEwaowW+SRXkf5BuQV0pynNRJ9ETfDspL9NmL3Rn5wAshkc9ultOlTZbdyTaWHEv5K/e PoS6tyLWi9ADLOyVYMsmIClhluKsZX7yzTMgAwJpoKCiITw/NUWuvuv8vTolF7AR9gFaNq nHDv2xFLITCuoJdNi0qVboPkVQkUqrGJid4HjXx+n925C6MQt6N02fOgHMEAPg== 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 4Rz8lW5BdJzcvn; Sun, 1 Oct 2023 16:33:11 +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 391GXBV7005681; Sun, 1 Oct 2023 16:33:11 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 391GXBtg005678; Sun, 1 Oct 2023 16:33:11 GMT (envelope-from git) Date: Sun, 1 Oct 2023 16:33:11 GMT Message-Id: <202310011633.391GXBtg005678@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: 774cc6348a50 - stable/13 - freebsd-update: handle file -> directory on upgrade List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@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/13 X-Git-Reftype: branch X-Git-Commit: 774cc6348a50c13b952e9f36ef8395f9b48733db Auto-Submitted: auto-generated The branch stable/13 has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=774cc6348a50c13b952e9f36ef8395f9b48733db commit 774cc6348a50c13b952e9f36ef8395f9b48733db Author: Ed Maste AuthorDate: 2023-09-27 13:36:33 +0000 Commit: Ed Maste CommitDate: 2023-10-01 16:33:03 +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} ;;