From nobody Sun Oct 01 16:31:00 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 4Rz8j05VhGz4vWKD; Sun, 1 Oct 2023 16:31:00 +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 4Rz8j053hZz3QWV; Sun, 1 Oct 2023 16:31:00 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1696177860; 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=hJIxSNctamg7y0/LwFUfKzkfOLkEjzHa8ml4051FfQo=; b=u8IRKd2W4Rg9jieBb/cM5NK4sxGhMq4Ln/UUv5Ua7FDsfWwP3uPSH4U5jsBxdDOqTtvlZp bWUVVO/2A8waiPB5oMklAuiR0l9IaSU+usRLm6/tY+19dNiUnWMzOoUTOACH0JrhAyybCr 1F7OplDBhH8EzSBaVgNE85N9dAzXhJnV3kKc0J8Nlhr0VW+f16MO0s08a/+R35QBo/AMel JdTokiuK+2O/XGo3Uf9MMW6mkUrY9y3tt99ePc2Fg9pE7W5hVcgeF8Out5XZgfrpJSLsGZ 9IPUWDd2BXfd87dxxDlysyhBIlD20HsjlBF8Rwqw5j5f6+DQFXTg+FIblT17nw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1696177860; a=rsa-sha256; cv=none; b=cZPIu89ACYzTLyO+0yTHA86hcehiW2OSrwi0bBL8ilLVCCmAl3JuU13DeB2KRz1qFzdPIf hsxdDQTRZI0p1esaSqbSqycEq/ebglJbo03U2V4A5gXZwWVdR0Xr0YKBSai42kZSv+ZSRg uBPg7Ljhtc71gOFNpLn3QjAsHLDjJuxPyl/jPR+tzU9T4uHinbaYIbOTmdYzrq6nY1HkDK PmpHgNy2ktggixelN/wROzPKO/xwCj5wliJrpOWslRZRoeQZg6hoWD8W/nEqIly+8243Ge LKFTGdEkrl0a4QOSak080OL+uspVvUmZ1qVQwsYql8lAtzUuLD2rPYkSs85UBg== 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=1696177860; 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=hJIxSNctamg7y0/LwFUfKzkfOLkEjzHa8ml4051FfQo=; b=yz9xErM5JrmZjGy0dB+mstx2HMSiz0KyP7Sa+W5mnvE5JGAgz+I7KzcYD78LtxLZs5ZrB3 jjbve0QCkfsUwffYgJWazaUXbpgR1buM+SBta9/65J8VZri2ZXXC6jX+NpYoCWbZAsCVlR KK9w6ubiGYfwZfF7RFU4HTCHSF0v4fzpVxPApqSYdN/CPfwKR11PFtioEJgSv8G41APxY3 N97Z1f+sAXE6PWfub+vlhtaEGb3g+6YPIJ+gY64x+iFqnq73SY8TjeBvAmf9MUb8Y4xYiX IJA3wrs//+uzfFsys6PSRoXjgUXALenW7ly8RCXXn2m11g7TPY+VJZUFrONnLw== 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 4Rz8j0476wzcF3; Sun, 1 Oct 2023 16:31:00 +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 391GV0VW098853; Sun, 1 Oct 2023 16:31:00 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 391GV0Ow098850; Sun, 1 Oct 2023 16:31:00 GMT (envelope-from git) Date: Sun, 1 Oct 2023 16:31:00 GMT Message-Id: <202310011631.391GV0Ow098850@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: 4719202d8cff - releng/14.0 - 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/releng/14.0 X-Git-Reftype: branch X-Git-Commit: 4719202d8cffdcae1645b2bf508ba6097e912b77 Auto-Submitted: auto-generated The branch releng/14.0 has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=4719202d8cffdcae1645b2bf508ba6097e912b77 commit 4719202d8cffdcae1645b2bf508ba6097e912b77 Author: Ed Maste AuthorDate: 2023-09-27 13:36:33 +0000 Commit: Ed Maste CommitDate: 2023-10-01 16:28:04 +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) (cherry picked from commit bc412215646cbb21529156d08fbbb7bbf5028c26) Approved by: re (gjb) --- 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} ;;