public inbox for gentoo-portage-dev@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-portage-dev] [PATCH 1/3] misc-functions.sh: Inline prepinfo code in install_qa_check()
@ 2023-04-04 21:46 Ulrich Müller
  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
  0 siblings, 2 replies; 3+ messages in thread
From: Ulrich Müller @ 2023-04-04 21:46 UTC (permalink / raw
  To: gentoo-portage-dev; +Cc: Ulrich Müller

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



^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2023-04-04 21:46 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-04-04 21:46 [gentoo-portage-dev] [PATCH 1/3] misc-functions.sh: Inline prepinfo code in install_qa_check() Ulrich Müller
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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox