From nobody Wed Sep 27 19:23:50 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 4RwmkG5qcQz4ts8h; Wed, 27 Sep 2023 19:23:50 +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 4RwmkG5FTvz4Flq; Wed, 27 Sep 2023 19:23:50 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1695842630; 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=nSuzEkxLLEmgoSGP+GdLjIm+BFt5XVtei1fBphyXzKQ=; b=j86GbXso3DALbYL56GqRVmMz2COgP63+isjx5Xj30pgAN/i+GAhZgBrZDMLfZ3aVoyyeYg HcpU3ocqAcjcuU7uSX+PDtQeMg9nH+YkWz/ssDc11VhxKI3jlVQt46l7IDza67zTEX5T4Q RYlKuUi7Bf4KYEGpJXyRETiWvx/i7oMT2cs21qKmOl3P4KCBRSRF3wRmgPpzTpx64cGRFp OWYuacqmK4YlT9Sz1OaVwPTQOoH4c58ao+jSbxixCeQQaSh8+C18/R0RBo8TPKAjFe5eRI 49qL2SDAvNb8AGluevZOS0buU1WBVsRQ23PnGibJifRudM8CbK2V11Bd1jyS/w== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1695842630; a=rsa-sha256; cv=none; b=cjXcp4MEg4ELeKb4nSKtKe+DGiPGLCl4tQPv2pY7lIOrqLh7rFmFONEVKTuYMtmljGMjoQ e90tY2999kUHHnldyU3YhJgDutERQhowygOg1QPuDkc+1GdXzuagCkXYfx7Y7pbx2luWZA wjXdJdMPGKbtX9gbEti35hHGFPAWnMCars7Tdn59Y1H2h4hW92EAVY1nd2Zqgi9oNb4Ly8 LmU4U3Mly3wAFgDUCPudF+YroXwU+Xe/TTpIxSe/9xPW63NuxNFcQ5tdOVh+i+watMFJXF eOsbh5BoKV61VVYZjTM7jOrrSuhjs4TyPGOYV3n1yyBqa06pmL2SIDrurqpAtQ== 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=1695842630; 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=nSuzEkxLLEmgoSGP+GdLjIm+BFt5XVtei1fBphyXzKQ=; b=KJMbnf4keUBOJ6Y/5DlsBOfiA+JJu/m/d1rayVSD08eyH1+tl3c30IQeHesenPMiyc0weY ZGViegMUz6d3v7GtU47PGS8N0lakXb2U/Wbd/mQTwuI23m3cG1h2Vz37SC0dY842ru9ZDR ofh4FYZ/zfiyoW33xuOF0LSEi/yHsctaNGOdeHV6KBbq/ZKfNd1OSdMqnz2xSBy3JTrY+D pWCkLOsELKpjL10qXdTgypJvBWAIVp2RQwvbLTPNmMQROIFFnu2oF+tnW2xrZRFJBjT5CW yho8zZapAQcBAlTugUeJpwjxqzDaShS+VyVR99Cd5IYpasPL8NQ+CVI8t3G/0g== 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 4RwmkG4Bx6zrvc; Wed, 27 Sep 2023 19:23:50 +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 38RJNoGA076078; Wed, 27 Sep 2023 19:23:50 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 38RJNo0L076075; Wed, 27 Sep 2023 19:23:50 GMT (envelope-from git) Date: Wed, 27 Sep 2023 19:23:50 GMT Message-Id: <202309271923.38RJNo0L076075@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Ed Maste Subject: git: f6d37c9ca13f - main - 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/main X-Git-Reftype: branch X-Git-Commit: f6d37c9ca13f8ab0ef32cf5344daecb8122d1e85 Auto-Submitted: auto-generated The branch main has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=f6d37c9ca13f8ab0ef32cf5344daecb8122d1e85 commit f6d37c9ca13f8ab0ef32cf5344daecb8122d1e85 Author: Ed Maste AuthorDate: 2023-09-27 13:36:33 +0000 Commit: Ed Maste CommitDate: 2023-09-27 19:23:08 +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 --- 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 29633b51b26c..c6432dcd6b0e 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} ;;