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

Replies