commit:     4fa1129e290e654c815d9f6783741d8e8b787a7c
Author:     Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Wed Jun 29 16:58:43 2022 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Wed Jun 29 17:49:24 2022 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=4fa1129e

distutils-r1.eclass: make QA check conditional on 'diff' presence

We get trouble when bootstrapping Prefix otherwise as diffutils
may not be installed yet. This is a bit less churn than
adding the BDEPEND, not that there's a strong argument either way.

Signed-off-by: Sam James <sam <AT> gentoo.org>

 eclass/distutils-r1.eclass | 31 ++++++++++++++++++-------------
 1 file changed, 18 insertions(+), 13 deletions(-)

diff --git a/eclass/distutils-r1.eclass b/eclass/distutils-r1.eclass
index 85d6c8ae5080..612db00e36b7 100644
--- a/eclass/distutils-r1.eclass
+++ b/eclass/distutils-r1.eclass
@@ -1590,20 +1590,25 @@ distutils-r1_python_install() {
 
                # remove files that we've created explicitly
                rm "${reg_scriptdir}"/{"${EPYTHON}",python3,python,pyvenv.cfg} 
|| die
-               # verify that scriptdir & wrapped_scriptdir both contain
-               # the same files
-               (
-                       cd "${reg_scriptdir}" && find . -mindepth 1
-               ) | sort > "${T}"/.distutils-files-bin
-               assert "listing ${reg_scriptdir} failed"
-               (
-                       if [[ -d ${wrapped_scriptdir} ]]; then
-                               cd "${wrapped_scriptdir}" && find . -mindepth 1
+
+               # Automagically do the QA check to avoid issues when 
bootstrapping
+               # prefix.
+               if type diff &>/dev/null ; then
+                       # verify that scriptdir & wrapped_scriptdir both contain
+                       # the same files
+                       (
+                               cd "${reg_scriptdir}" && find . -mindepth 1
+                       ) | sort > "${T}"/.distutils-files-bin
+                       assert "listing ${reg_scriptdir} failed"
+                       (
+                               if [[ -d ${wrapped_scriptdir} ]]; then
+                                       cd "${wrapped_scriptdir}" && find . 
-mindepth 1
+                               fi
+                       ) | sort > "${T}"/.distutils-files-wrapped
+                       assert "listing ${wrapped_scriptdir} failed"
+                       if ! diff -U 0 "${T}"/.distutils-files-{bin,wrapped}; 
then
+                               die "File lists for ${reg_scriptdir} and 
${wrapped_scriptdir} differ (see diff above)"
                        fi
-               ) | sort > "${T}"/.distutils-files-wrapped
-               assert "listing ${wrapped_scriptdir} failed"
-               if ! diff -U 0 "${T}"/.distutils-files-{bin,wrapped}; then
-                       die "File lists for ${reg_scriptdir} and 
${wrapped_scriptdir} differ (see diff above)"
                fi
 
                # remove the altered bindir, executables from the package

Reply via email to