public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
From: "Sam James" <sam@gentoo.org>
To: gentoo-commits@lists.gentoo.org
Subject: [gentoo-commits] repo/gentoo:master commit in: app-arch/tar/
Date: Sun, 23 Apr 2023 19:16:55 +0000 (UTC)	[thread overview]
Message-ID: <1682277179.ef1e3dad5e18f887a56ae06c02eff74ab5c33a40.sam@gentoo> (raw)

commit:     ef1e3dad5e18f887a56ae06c02eff74ab5c33a40
Author:     Yifeng Li <tomli <AT> tomli <DOT> me>
AuthorDate: Sun Apr 23 16:43:02 2023 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> 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 <sam <AT> gentoo.org>
Signed-off-by: Yifeng Li <tomli <AT> tomli.me>
Closes: https://github.com/gentoo/gentoo/pull/30723
Signed-off-by: Sam James <sam <AT> 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
 }


             reply	other threads:[~2023-04-23 19:17 UTC|newest]

Thread overview: 108+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-04-23 19:16 Sam James [this message]
  -- strict thread matches above, loose matches on Subject: below --
2024-02-18  7:24 [gentoo-commits] repo/gentoo:master commit in: app-arch/tar/ Hans de Graaff
2024-01-18  3:22 Sam James
2023-09-24 14:22 Sam James
2023-08-20  8:11 Sam James
2023-08-19 11:38 Sam James
2023-08-19  7:23 Sam James
2023-08-19  6:35 Sam James
2023-07-18 21:08 Sam James
2023-07-18 21:07 Sam James
2023-05-15 18:49 Ulrich Müller
2023-05-02 19:10 Arthur Zamarin
2023-05-01  6:27 Sam James
2023-05-01  2:28 Sam James
2023-05-01  2:26 Sam James
2023-05-01  0:34 Sam James
2023-05-01  0:19 Sam James
2023-05-01  0:12 Sam James
2023-05-01  0:12 Sam James
2023-03-25  3:32 Sam James
2023-02-24 18:36 Sam James
2022-12-28  0:33 Sam James
2022-12-27 19:53 Sam James
2022-12-27 19:45 Sam James
2022-12-27 13:40 Sam James
2022-12-27 11:31 Sam James
2022-11-28 14:31 Michał Górny
2022-10-30 15:51 Sam James
2022-10-30  9:55 Sam James
2022-04-06 23:58 Sam James
2021-03-28 13:23 Sam James
2021-03-26 18:45 Sam James
2021-03-26 11:34 Sam James
2021-03-26 11:34 Sam James
2021-03-26  7:45 Agostino Sarubbo
2021-03-25 17:52 Sergei Trofimovich
2021-03-25 16:27 Agostino Sarubbo
2021-02-13 14:18 Lars Wendler
2021-01-07 17:37 Lars Wendler
2021-01-06 12:52 Fabian Groffen
2021-01-04 22:40 Mike Gilbert
2020-12-27 13:34 Fabian Groffen
2020-09-07 20:44 Mike Gilbert
2019-12-02  9:59 Lars Wendler
2019-05-03 23:17 Andreas K. Hüttel
2019-04-08  6:55 Mikle Kolyada
2019-04-08  6:55 Mikle Kolyada
2019-04-08  6:55 Mikle Kolyada
2019-04-08  4:32 Aaron Bauman
2019-04-07 21:00 Sergei Trofimovich
2019-04-02  9:51 Mikle Kolyada
2019-03-30 19:05 Mikle Kolyada
2019-03-29  4:41 Matt Turner
2019-03-29  4:41 Matt Turner
2019-03-27 23:44 Thomas Deutschmann
2019-03-26 21:09 Sergei Trofimovich
2019-03-25 21:33 Sergei Trofimovich
2019-03-25 21:13 Mikle Kolyada
2019-03-10 16:13 Mikle Kolyada
2019-02-23 19:15 Lars Wendler
2019-02-12  9:16 Mikle Kolyada
2019-02-12  9:16 Mikle Kolyada
2019-02-12  9:16 Mikle Kolyada
2019-01-30 18:51 Markus Meier
2019-01-22  7:16 Matt Turner
2019-01-06 22:18 Mart Raudsepp
2019-01-05 22:40 Sergei Trofimovich
2019-01-05 22:39 Sergei Trofimovich
2019-01-05 22:36 Sergei Trofimovich
2019-01-04 16:50 Thomas Deutschmann
2019-01-04 10:37 Mikle Kolyada
2019-01-04  0:02 Thomas Deutschmann
2019-01-03  0:20 Lars Wendler
2018-07-15 21:54 Mikle Kolyada
2018-07-09 19:06 Mikle Kolyada
2018-06-27  7:25 Tobias Klausmann
2018-06-25  6:21 Sergei Trofimovich
2018-06-24 20:25 Sergei Trofimovich
2018-06-23 14:59 Mart Raudsepp
2018-06-21 19:30 Sergei Trofimovich
2018-06-19 12:55 Thomas Deutschmann
2018-06-18 21:17 Mikle Kolyada
2018-06-18 18:31 Sergei Trofimovich
2018-05-06 13:20 Mart Raudsepp
2018-03-11  6:08 Matt Turner
2018-01-29 15:51 Tobias Klausmann
2018-01-10  6:19 Markus Meier
2017-12-21 10:33 Sergei Trofimovich
2017-12-21  8:48 Sergei Trofimovich
2017-12-19 22:20 Sergei Trofimovich
2017-12-19 15:46 Thomas Deutschmann
2017-12-19  4:41 Jason Zaman
2017-12-17 17:42 Lars Wendler
2017-12-17 17:42 Lars Wendler
2016-11-10 20:26 Mike Frysinger
2016-11-10 17:50 Markus Meier
2016-11-04 13:27 Jeroen Roovers
2016-11-04  8:24 Agostino Sarubbo
2016-11-04  8:21 Agostino Sarubbo
2016-11-01 11:05 Jeroen Roovers
2016-07-01  4:41 Jeroen Roovers
2016-06-04  4:58 Markus Meier
2016-06-01 13:32 Tobias Klausmann
2016-06-01  6:48 Jeroen Roovers
2016-05-27 12:46 Lars Wendler
2016-05-26 20:05 Lars Wendler
2016-05-16 21:08 Lars Wendler
2016-01-22 16:49 Fabian Groffen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1682277179.ef1e3dad5e18f887a56ae06c02eff74ab5c33a40.sam@gentoo \
    --to=sam@gentoo.org \
    --cc=gentoo-commits@lists.gentoo.org \
    --cc=gentoo-dev@lists.gentoo.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox