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