public inbox for gentoo-portage-dev@lists.gentoo.org
 help / color / mirror / Atom feed
From: "Ulrich Müller" <ulm@gentoo.org>
To: gentoo-portage-dev@lists.gentoo.org
Cc: "Ulrich Müller" <ulm@gentoo.org>
Subject: [gentoo-portage-dev] [PATCH 1/3] misc-functions.sh: Inline prepinfo code in install_qa_check()
Date: Tue,  4 Apr 2023 23:46:28 +0200	[thread overview]
Message-ID: <20230404214630.28673-1-ulm@gentoo.org> (raw)

Add a deprecation warning. Presumably, subdirs of /usr/share/info have
never been used by any package except app-editors/emacs.

Remove duplicate rm statement at the end of the function.

Bug: https://bugs.gentoo.org/899898
Signed-off-by: Ulrich Müller <ulm@gentoo.org>
---
 bin/misc-functions.sh | 24 +++++++++++++++++++-----
 1 file changed, 19 insertions(+), 5 deletions(-)

diff --git a/bin/misc-functions.sh b/bin/misc-functions.sh
index 55c4afe73..235823afc 100755
--- a/bin/misc-functions.sh
+++ b/bin/misc-functions.sh
@@ -1,5 +1,5 @@
 #!/usr/bin/env bash
-# Copyright 1999-2018 Gentoo Authors
+# Copyright 1999-2023 Gentoo Authors
 # Distributed under the terms of the GNU General Public License v2
 #
 # Miscellaneous shell functions that make use of the ebuild env but don't need
@@ -143,7 +143,24 @@ install_qa_check() {
 		chflags -R nosunlnk,nouunlnk "${ED}" 2>/dev/null
 	fi
 
-	[[ -d ${ED%/}/usr/share/info ]] && prepinfo
+	if [[ -d ${ED%/}/usr/share/info ]]; then
+		# Portage regenerates this on the installed system.
+		rm -f "${ED%/}"/usr/share/info/dir{,.info}{,.Z,.gz,.bz2,.lzma,.lz,.xz,.zst} \
+			|| die "rm failed"
+		# Recurse into subdirs. Remove this code after 2023-12-31. #899898
+		while read -r -d '' x; do
+			( shopt -s failglob; : "${x}"/.keepinfodir* ) 2>/dev/null \
+				&& continue
+			for f in "${x}"/dir{,.info}{,.Z,.gz,.bz2,.lzma,.lz,.xz,.zst}; do
+				if [[ -e ${f} ]]; then
+					eqawarn "QA Notice: Removing Info directory file '${f}'."
+					eqawarn "Relying on this behavior is deprecated and may"
+					eqawarn "cause file collisions in future."
+					rm -f "${f}" || die "rm failed"
+				fi
+			done
+		done < <(find "${ED%/}"/usr/share/info -mindepth 1 -type d -print0)
+	fi
 
 	# If binpkg-docompress is enabled, apply compression before creating
 	# the binary package.
@@ -251,9 +268,6 @@ install_qa_check() {
 			prepallstrip
 		fi
 	fi
-
-	# Portage regenerates this on the installed system.
-	rm -f "${ED%/}"/usr/share/info/dir{,.Z,.gz,.bz2,.lzma,.lz,.xz,.zst} || die "rm failed!"
 }
 
 __dyn_instprep() {
-- 
2.40.0



             reply	other threads:[~2023-04-04 21:46 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-04-04 21:46 Ulrich Müller [this message]
2023-04-04 21:46 ` [gentoo-portage-dev] [PATCH 2/3] prepinfo: Deprecate it Ulrich Müller
2023-04-04 21:46 ` [gentoo-portage-dev] [PATCH 3/3] prepman: " Ulrich Müller

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=20230404214630.28673-1-ulm@gentoo.org \
    --to=ulm@gentoo.org \
    --cc=gentoo-portage-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