public inbox for gentoo-dev@lists.gentoo.org
 help / color / mirror / Atom feed
From: Mike Gilbert <floppym@gentoo.org>
To: gentoo-dev@lists.gentoo.org
Subject: [gentoo-dev] [PATCH] savedconfig.eclass: do not preserve symlink in restore_config
Date: Sun,  4 Jun 2023 13:31:32 -0400	[thread overview]
Message-ID: <20230604173132.390148-1-floppym@gentoo.org> (raw)

This allows users to maintain the saved config file in some other
location.

Also drop the recursive (-R) option; this cp command is only executed
when we are restoring a single regular file.

Closes: https://bugs.gentoo.org/907696
Signed-off-by: Mike Gilbert <floppym@gentoo.org>
---
 eclass/savedconfig.eclass | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/eclass/savedconfig.eclass b/eclass/savedconfig.eclass
index cc5748543078..a778dfba0245 100644
--- a/eclass/savedconfig.eclass
+++ b/eclass/savedconfig.eclass
@@ -124,8 +124,8 @@ restore_config() {
 
 	if [[ -f ${found} ]]; then
 		elog "Building using saved configfile \"${found}\""
-		if [ $# -gt 0 ]; then
-			cp -pPR	"${found}" "$1" || die "Failed to restore ${found} to $1"
+		if [[ $# -gt 0 ]]; then
+			cp -p "${found}" "$1" || die "Failed to restore ${found} to $1"
 		else
 			die "need to know the restoration filename"
 		fi
-- 
2.40.1



             reply	other threads:[~2023-06-04 17:31 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-06-04 17:31 Mike Gilbert [this message]
2023-06-04 18:03 ` [gentoo-dev] [PATCH] savedconfig.eclass: do not preserve symlink in restore_config Michael Orlitzky
2023-06-04 18:07   ` Mike Gilbert
2023-06-04 18:46   ` Arsen Arsenović
2023-06-04 23:52     ` Michael Orlitzky

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=20230604173132.390148-1-floppym@gentoo.org \
    --to=floppym@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