Gentoo Archives: gentoo-commits

From: Zac Medico <zmedico@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] proj/portage:master commit in: bin/install-qa-check.d/
Date: Sat, 06 Oct 2018 01:15:46
Message-Id: 1538788454.dd605b1aa574fc035d3319d954be1ca0d2cdde19.zmedico@gentoo
1 commit: dd605b1aa574fc035d3319d954be1ca0d2cdde19
2 Author: Zac Medico <zmedico <AT> gentoo <DOT> org>
3 AuthorDate: Sat Oct 6 01:11:02 2018 +0000
4 Commit: Zac Medico <zmedico <AT> gentoo <DOT> org>
5 CommitDate: Sat Oct 6 01:14:14 2018 +0000
6 URL: https://gitweb.gentoo.org/proj/portage.git/commit/?id=dd605b1a
7
8 Revert "install-qa-checks.d: Add a check for Gentoo path policies (FHS-y)"
9
10 This reverts commit d5f97eaa464736a454c8ad410f4acd4fccdf2324.
11 Until this QA check has adjustable whitelist support, we can consider
12 it an unstable work in progress. Therefore, I'd like for the QA team
13 to move it gentoo/metadata/install-qa-check.d/08gentoo-paths until
14 it has matured. It's safe to commit it to the gentoo repository now,
15 and it will become active when portage's internal copy is removed.
16
17 Bug: https://bugs.gentoo.org/667604
18 Closes: https://bugs.gentoo.org/667378
19 Closes: https://github.com/gentoo/portage/pull/373
20 Signed-off-by: Zac Medico <zmedico <AT> gentoo.org>
21
22 bin/install-qa-check.d/08gentoo-paths | 77 -----------------------------------
23 1 file changed, 77 deletions(-)
24
25 diff --git a/bin/install-qa-check.d/08gentoo-paths b/bin/install-qa-check.d/08gentoo-paths
26 deleted file mode 100644
27 index 3ee887df0..000000000
28 --- a/bin/install-qa-check.d/08gentoo-paths
29 +++ /dev/null
30 @@ -1,77 +0,0 @@
31 -# Check whether ebuilds are not installing new, non-Gentoo-ey paths.
32 -
33 -gentoo_path_check() {
34 - # allowed path definitions
35 - # ------------------------
36 -
37 - # directories common to / and /usr
38 - local allowed_common_dirs=(
39 - bin lib lib32 lib64 libx32 sbin
40 - )
41 -
42 - # toplevel directories which can be installed to by ebuilds
43 - # /home is not included as no ebuilds should install files there
44 - local allowed_paths_toplevel=(
45 - "${allowed_common_dirs[@]}"
46 - boot dev etc opt srv usr var
47 - )
48 -
49 - # directories in /usr which can be installed to by ebuilds
50 - # /usr/games is not included as it is banned nowadays
51 - local allowed_paths_usr=(
52 - "${allowed_common_dirs[@]}"
53 - include libexec share src
54 - # toolchain stuff
55 - "${CHOST}" "${CTARGET}"
56 - )
57 -
58 -
59 - # the logic
60 - # ---------
61 - local bad_paths=()
62 - local x
63 -
64 - local shopt_save=$(shopt -p nullglob)
65 - shopt -s nullglob
66 -
67 - # 1. check for unexpected top-level directories
68 - local toplevel_dirs=( "${ED%/}"/* )
69 - for x in "${toplevel_dirs[@]##*/}"; do
70 - if ! has "${x}" "${allowed_paths_toplevel[@]}"; then
71 - bad_paths+=( "/${x}" )
72 - fi
73 - done
74 -
75 - # 2. check for unexpected /usr subdirectories
76 - local usr_dirs=( "${ED%/}"/usr/* )
77 - for x in "${usr_dirs[@]##*/}"; do
78 - if ! has "${x}" "${allowed_paths_usr[@]}"; then
79 - bad_paths+=( "/usr/${x}" )
80 - fi
81 - done
82 -
83 - # 3. check for unexpected /usr/share/doc subdirectories
84 - local doc_dirs=( "${ED%/}"/usr/share/doc/* )
85 - for x in "${doc_dirs[@]##*/}"; do
86 - if [[ ${x} != ${PF} ]]; then
87 - bad_paths+=( "/usr/share/doc/${x}" )
88 - fi
89 - done
90 -
91 - ${shopt_save}
92 -
93 - # report
94 - # ------
95 - if [[ -n ${bad_paths[@]} ]]; then
96 - eqawarn "The ebuild is installing to one or more unexpected paths:"
97 - eqawarn
98 - eqatag -v non-gentoo-paths "${bad_paths[@]}"
99 - eqawarn
100 - eqawarn "Please fix the ebuild to use correct FHS/Gentoo policy paths."
101 - fi
102 -}
103 -
104 -gentoo_path_check
105 -: # guarantee successful exit
106 -
107 -# vim:ft=sh