Gentoo Archives: gentoo-commits

From: Sam James <sam@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: eclass/
Date: Wed, 29 Jun 2022 17:49:39
Message-Id: 1656524964.4fa1129e290e654c815d9f6783741d8e8b787a7c.sam@gentoo
1 commit: 4fa1129e290e654c815d9f6783741d8e8b787a7c
2 Author: Sam James <sam <AT> gentoo <DOT> org>
3 AuthorDate: Wed Jun 29 16:58:43 2022 +0000
4 Commit: Sam James <sam <AT> gentoo <DOT> org>
5 CommitDate: Wed Jun 29 17:49:24 2022 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=4fa1129e
7
8 distutils-r1.eclass: make QA check conditional on 'diff' presence
9
10 We get trouble when bootstrapping Prefix otherwise as diffutils
11 may not be installed yet. This is a bit less churn than
12 adding the BDEPEND, not that there's a strong argument either way.
13
14 Signed-off-by: Sam James <sam <AT> gentoo.org>
15
16 eclass/distutils-r1.eclass | 31 ++++++++++++++++++-------------
17 1 file changed, 18 insertions(+), 13 deletions(-)
18
19 diff --git a/eclass/distutils-r1.eclass b/eclass/distutils-r1.eclass
20 index 85d6c8ae5080..612db00e36b7 100644
21 --- a/eclass/distutils-r1.eclass
22 +++ b/eclass/distutils-r1.eclass
23 @@ -1590,20 +1590,25 @@ distutils-r1_python_install() {
24
25 # remove files that we've created explicitly
26 rm "${reg_scriptdir}"/{"${EPYTHON}",python3,python,pyvenv.cfg} || die
27 - # verify that scriptdir & wrapped_scriptdir both contain
28 - # the same files
29 - (
30 - cd "${reg_scriptdir}" && find . -mindepth 1
31 - ) | sort > "${T}"/.distutils-files-bin
32 - assert "listing ${reg_scriptdir} failed"
33 - (
34 - if [[ -d ${wrapped_scriptdir} ]]; then
35 - cd "${wrapped_scriptdir}" && find . -mindepth 1
36 +
37 + # Automagically do the QA check to avoid issues when bootstrapping
38 + # prefix.
39 + if type diff &>/dev/null ; then
40 + # verify that scriptdir & wrapped_scriptdir both contain
41 + # the same files
42 + (
43 + cd "${reg_scriptdir}" && find . -mindepth 1
44 + ) | sort > "${T}"/.distutils-files-bin
45 + assert "listing ${reg_scriptdir} failed"
46 + (
47 + if [[ -d ${wrapped_scriptdir} ]]; then
48 + cd "${wrapped_scriptdir}" && find . -mindepth 1
49 + fi
50 + ) | sort > "${T}"/.distutils-files-wrapped
51 + assert "listing ${wrapped_scriptdir} failed"
52 + if ! diff -U 0 "${T}"/.distutils-files-{bin,wrapped}; then
53 + die "File lists for ${reg_scriptdir} and ${wrapped_scriptdir} differ (see diff above)"
54 fi
55 - ) | sort > "${T}"/.distutils-files-wrapped
56 - assert "listing ${wrapped_scriptdir} failed"
57 - if ! diff -U 0 "${T}"/.distutils-files-{bin,wrapped}; then
58 - die "File lists for ${reg_scriptdir} and ${wrapped_scriptdir} differ (see diff above)"
59 fi
60
61 # remove the altered bindir, executables from the package