Gentoo Archives: gentoo-portage-dev

From: "Michał Górny" <mgorny@g.o>
To: gentoo-portage-dev@l.g.o
Cc: "Michał Górny" <mgorny@g.o>
Subject: [gentoo-portage-dev] [PATCH 4/4] Ban prepall in ebuild scope
Date: Sat, 15 Sep 2018 11:49:16
Message-Id: 20180915114854.30550-5-mgorny@gentoo.org
In Reply to: [gentoo-portage-dev] [PATCH 0/4] Unused prepall* removal by "Michał Górny"
1 ---
2 bin/ebuild-helpers/prepall | 28 ++--------------------------
3 bin/misc-functions.sh | 27 ++++++++++++++++++++++++++-
4 2 files changed, 28 insertions(+), 27 deletions(-)
5
6 diff --git a/bin/ebuild-helpers/prepall b/bin/ebuild-helpers/prepall
7 index 87e1ca20c..e23a6d410 100755
8 --- a/bin/ebuild-helpers/prepall
9 +++ b/bin/ebuild-helpers/prepall
10 @@ -4,29 +4,5 @@
11
12 source "${PORTAGE_BIN_PATH}"/isolated-functions.sh || exit 1
13
14 -if ! ___eapi_has_prefix_variables; then
15 - ED=${D}
16 -fi
17 -
18 -if has chflags $FEATURES ; then
19 - # Save all the file flags for restoration at the end of prepall.
20 - mtree -c -p "${ED}" -k flags > "${T}/bsdflags.mtree"
21 - # Remove all the file flags so that prepall can do anything necessary.
22 - chflags -R noschg,nouchg,nosappnd,nouappnd "${ED}"
23 - chflags -R nosunlnk,nouunlnk "${ED}" 2>/dev/null
24 -fi
25 -
26 -if ! ___eapi_has_docompress; then
27 - while IFS= read -r -d '' mandir ; do
28 - mandir=${mandir#${ED}}
29 - prepman "${mandir%/man}"
30 - done < <(find "${ED}" -type d -name man -print0)
31 -fi
32 -[[ -d ${ED%/}/usr/share/info ]] && prepinfo
33 -
34 -___eapi_has_dostrip || prepallstrip
35 -
36 -if has chflags $FEATURES ; then
37 - # Restore all the file flags that were saved at the beginning of prepall.
38 - mtree -U -e -p "${ED}" -k flags < "${T}/bsdflags.mtree" &> /dev/null
39 -fi
40 +die "'${0##*/}' is not allowed in ebuild scope"
41 +exit 1
42 diff --git a/bin/misc-functions.sh b/bin/misc-functions.sh
43 index 34492e086..7120717b7 100755
44 --- a/bin/misc-functions.sh
45 +++ b/bin/misc-functions.sh
46 @@ -162,6 +162,31 @@ prepcompress() {
47 return 0
48 }
49
50 +__prepall() {
51 + if has chflags $FEATURES ; then
52 + # Save all the file flags for restoration at the end of prepall.
53 + mtree -c -p "${ED}" -k flags > "${T}/bsdflags.mtree"
54 + # Remove all the file flags so that prepall can do anything necessary.
55 + chflags -R noschg,nouchg,nosappnd,nouappnd "${ED}"
56 + chflags -R nosunlnk,nouunlnk "${ED}" 2>/dev/null
57 + fi
58 +
59 + if ! ___eapi_has_docompress; then
60 + while IFS= read -r -d '' mandir ; do
61 + mandir=${mandir#${ED}}
62 + prepman "${mandir%/man}"
63 + done < <(find "${ED}" -type d -name man -print0)
64 + fi
65 + [[ -d ${ED%/}/usr/share/info ]] && prepinfo
66 +
67 + prepallstrip
68 +
69 + if has chflags $FEATURES ; then
70 + # Restore all the file flags that were saved at the beginning of prepall.
71 + mtree -U -e -p "${ED}" -k flags < "${T}/bsdflags.mtree" &> /dev/null
72 + fi
73 +}
74 +
75 install_qa_check() {
76 local d f i qa_var x paths qa_checks=() checks_run=()
77 if ! ___eapi_has_prefix_variables; then
78 @@ -219,7 +244,7 @@ install_qa_check() {
79 done < <(printf "%s\0" "${qa_checks[@]}" | LC_ALL=C sort -u -z)
80
81 export STRIP_MASK
82 - prepall
83 + __prepall
84 ___eapi_has_docompress && prepcompress
85 ecompressdir --dequeue
86 ecompress --dequeue
87 --
88 2.19.0