toolchain.eclass: drop info/dir index, bug #672408
authorSergei Trofimovich <slyfox@gentoo.org>
Tue, 4 Dec 2018 09:05:17 +0000 (09:05 +0000)
committerSergei Trofimovich <slyfox@gentoo.org>
Tue, 4 Dec 2018 11:05:57 +0000 (11:05 +0000)
As explained by Zac in #672408 prepinfo() was used to drop 'info/dir'
index to allow portage regenerate it.

gcc package does not always install 'info/dir' files (USE-dependent).
This causes nondeterminism for 'info/dir' to be owned or be an orphan
file.

This change drops 'info/dir' unconditionally to avoid owned/orphan
collisions and always make it an orphan file.

Reported-by: Michal Jakubowski
Bug: https://bugs.gentoo.org/672408
Bug: https://bugs.gentoo.org/587316
Signed-off-by: Sergei Trofimovich <slyfox@gentoo.org>
eclass/toolchain.eclass

index 94f2d3369af8b866449b5fb20a642564c757b557..19564a0652eb741c714f1c0d179d7731546f4de5 100644 (file)
@@ -1851,6 +1851,14 @@ toolchain_src_install() {
                        fi
                fi
        fi
+
+       # portage regenerates 'dir' files on it's own: bug #672408
+       # Drop 'dir' files to avoid collisions.
+       if [[ -f "${D}${DATAPATH}"/info/dir ]]; then
+               einfo "Deleting '${D}${DATAPATH}/info/dir'"
+               rm "${D}${DATAPATH}"/info/dir || die
+       fi
+
        # prune empty dirs left behind
        find "${ED}" -depth -type d -delete 2>/dev/null