From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id B3EFD15ACFB for ; Sun, 23 Apr 2023 19:17:00 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 91CF8E09F7; Sun, 23 Apr 2023 19:16:59 +0000 (UTC) Received: from smtp.gentoo.org (woodpecker.gentoo.org [140.211.166.183]) (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) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 5B3E9E09F7 for ; Sun, 23 Apr 2023 19:16:59 +0000 (UTC) Received: from oystercatcher.gentoo.org (oystercatcher.gentoo.org [148.251.78.52]) (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) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id AFD1333FD24 for ; Sun, 23 Apr 2023 19:16:57 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id 5072B7DE for ; Sun, 23 Apr 2023 19:16:55 +0000 (UTC) From: "Sam James" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Sam James" Message-ID: <1682277179.ef1e3dad5e18f887a56ae06c02eff74ab5c33a40.sam@gentoo> Subject: [gentoo-commits] repo/gentoo:master commit in: app-arch/tar/ X-VCS-Repository: repo/gentoo X-VCS-Files: app-arch/tar/tar-1.34-r2.ebuild app-arch/tar/tar-1.34-r3.ebuild X-VCS-Directories: app-arch/tar/ X-VCS-Committer: sam X-VCS-Committer-Name: Sam James X-VCS-Revision: ef1e3dad5e18f887a56ae06c02eff74ab5c33a40 X-VCS-Branch: master Date: Sun, 23 Apr 2023 19:16:55 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-Archives-Salt: b57d89d5-e88c-4122-9b59-db18fbb63901 X-Archives-Hash: 8b972f1996168cd0cc4c83b5fc69a257 commit: ef1e3dad5e18f887a56ae06c02eff74ab5c33a40 Author: Yifeng Li tomli me> AuthorDate: Sun Apr 23 16:43:02 2023 +0000 Commit: Sam James gentoo org> CommitDate: Sun Apr 23 19:12:59 2023 +0000 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=ef1e3dad app-arch/tar: adapt pkg_postinst for prefix bootstrapping This commit allows Portage to overwrite the binary executable "tar" with a symbolic link, this situation is encountered during Gentoo prefix bootstrap. If left unhandled, it causes the bootstrap to fail with the error message: ln: failed to create symbolic link '/Users/ec2-user/gentoo/tmp/bin/tar': File exists The original binary is renamed to tar.bak. [sam: This is analogous to sys-devel/bison's hack too.] Bug: https://bugs.gentoo.org/886123 Closes: https://bugs.gentoo.org/904887 Suggested-by: Sam James gentoo.org> Signed-off-by: Yifeng Li tomli.me> Closes: https://github.com/gentoo/gentoo/pull/30723 Signed-off-by: Sam James gentoo.org> app-arch/tar/tar-1.34-r2.ebuild | 7 +++++++ app-arch/tar/tar-1.34-r3.ebuild | 7 +++++++ 2 files changed, 14 insertions(+) diff --git a/app-arch/tar/tar-1.34-r2.ebuild b/app-arch/tar/tar-1.34-r2.ebuild index 86fdc8e05e20..805941b1f61c 100644 --- a/app-arch/tar/tar-1.34-r2.ebuild +++ b/app-arch/tar/tar-1.34-r2.ebuild @@ -90,6 +90,13 @@ pkg_postinst() { # ensure to preserve the symlink before app-alternatives/tar # is installed if [[ ! -h ${EROOT}/bin/tar ]]; then + if [[ -e ${EROOT}/usr/bin/tar ]] ; then + # bug #904887 + ewarn "${EROOT}/usr/bin/tar exists but is not a symlink." + ewarn "This is expected during Prefix bootstrap and unsual otherwise." + ewarn "Moving away unexpected ${EROOT}/usr/bin/tar to .bak." + mv "${EROOT}/usr/bin/tar" "${EROOT}/usr/bin/tar.bak" || die + fi ln -s gtar "${EROOT}/bin/tar" || die fi } diff --git a/app-arch/tar/tar-1.34-r3.ebuild b/app-arch/tar/tar-1.34-r3.ebuild index f92891dceff1..da958a84470e 100644 --- a/app-arch/tar/tar-1.34-r3.ebuild +++ b/app-arch/tar/tar-1.34-r3.ebuild @@ -94,6 +94,13 @@ pkg_postinst() { # ensure to preserve the symlink before app-alternatives/tar # is installed if [[ ! -h ${EROOT}/bin/tar ]]; then + if [[ -e ${EROOT}/usr/bin/tar ]] ; then + # bug #904887 + ewarn "${EROOT}/usr/bin/tar exists but is not a symlink." + ewarn "This is expected during Prefix bootstrap and unsual otherwise." + ewarn "Moving away unexpected ${EROOT}/usr/bin/tar to .bak." + mv "${EROOT}/usr/bin/tar" "${EROOT}/usr/bin/tar.bak" || die + fi ln -s gtar "${EROOT}/bin/tar" || die fi }