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 07/10] Ban dolib/libopts for EAPI 7
Date: Mon, 26 Feb 2018 16:01:21
Message-Id: 20180226155942.9148-8-mgorny@gentoo.org
In Reply to: [gentoo-portage-dev] [PATCH 00/10] EAPI 7, part one by "Michał Górny"
1 Bug: https://bugs.gentoo.org/630416
2 ---
3 bin/eapi.sh | 4 ++++
4 bin/ebuild-helpers/dolib | 7 ++++++-
5 bin/ebuild-helpers/dolib.a | 4 ++--
6 bin/ebuild-helpers/dolib.so | 4 ++--
7 bin/phase-helpers.sh | 6 +++++-
8 5 files changed, 19 insertions(+), 6 deletions(-)
9
10 diff --git a/bin/eapi.sh b/bin/eapi.sh
11 index 964e19d7d..b8b493f45 100644
12 --- a/bin/eapi.sh
13 +++ b/bin/eapi.sh
14 @@ -60,6 +60,10 @@ ___eapi_has_dohtml_deprecated() {
15 [[ ${1-${EAPI-0}} == 6 ]]
16 }
17
18 +___eapi_has_dolib_libopts() {
19 + [[ ${1-${EAPI-0}} =~ ^(0|1|2|3|4|4-python|4-slot-abi|5|5-hdepend|5-progress|6)$ ]]
20 +}
21 +
22 ___eapi_has_docompress() {
23 [[ ! ${1-${EAPI-0}} =~ ^(0|1|2|3)$ ]]
24 }
25 diff --git a/bin/ebuild-helpers/dolib b/bin/ebuild-helpers/dolib
26 index a11bad463..62e04b385 100755
27 --- a/bin/ebuild-helpers/dolib
28 +++ b/bin/ebuild-helpers/dolib
29 @@ -1,9 +1,14 @@
30 #!/bin/bash
31 -# Copyright 1999-2012 Gentoo Foundation
32 +# Copyright 1999-2018 Gentoo Foundation
33 # Distributed under the terms of the GNU General Public License v2
34
35 source "${PORTAGE_BIN_PATH}"/isolated-functions.sh || exit 1
36
37 +if [[ -z ${PORTAGE_INTERNAL_DOLIB} ]] && ! ___eapi_has_dolib_libopts; then
38 + die "'${0##*/}' has been banned for EAPI '$EAPI'"
39 + exit 1
40 +fi
41 +
42 if ! ___eapi_has_prefix_variables; then
43 ED=${D}
44 fi
45 diff --git a/bin/ebuild-helpers/dolib.a b/bin/ebuild-helpers/dolib.a
46 index 61961e4ed..5ea126b5d 100755
47 --- a/bin/ebuild-helpers/dolib.a
48 +++ b/bin/ebuild-helpers/dolib.a
49 @@ -1,5 +1,5 @@
50 #!/bin/bash
51 -# Copyright 1999-2006 Gentoo Foundation
52 +# Copyright 1999-2018 Gentoo Foundation
53 # Distributed under the terms of the GNU General Public License v2
54
55 -LIBOPTIONS='-m0644' exec dolib "$@"
56 +LIBOPTIONS='-m0644' PORTAGE_INTERNAL_DOLIB=1 exec dolib "$@"
57 diff --git a/bin/ebuild-helpers/dolib.so b/bin/ebuild-helpers/dolib.so
58 index eab8c9110..a3b579e5e 100755
59 --- a/bin/ebuild-helpers/dolib.so
60 +++ b/bin/ebuild-helpers/dolib.so
61 @@ -1,5 +1,5 @@
62 #!/bin/bash
63 -# Copyright 1999-2006 Gentoo Foundation
64 +# Copyright 1999-2018 Gentoo Foundation
65 # Distributed under the terms of the GNU General Public License v2
66
67 -LIBOPTIONS='-m0755' exec dolib "$@"
68 +LIBOPTIONS='-m0755' PORTAGE_INTERNAL_DOLIB=1 exec dolib "$@"
69 diff --git a/bin/phase-helpers.sh b/bin/phase-helpers.sh
70 index 49dad234d..12ccf6716 100644
71 --- a/bin/phase-helpers.sh
72 +++ b/bin/phase-helpers.sh
73 @@ -1,5 +1,5 @@
74 #!/bin/bash
75 -# Copyright 1999-2017 Gentoo Foundation
76 +# Copyright 1999-2018 Gentoo Foundation
77 # Distributed under the terms of the GNU General Public License v2
78
79 export DESTTREE=/usr
80 @@ -111,6 +111,10 @@ exeopts() {
81 }
82
83 libopts() {
84 + if ! ___eapi_has_dolib_libopts; then
85 + die "'${FUNCNAME}' has been banned for EAPI '$EAPI'"
86 + fi
87 +
88 export LIBOPTIONS="$@"
89
90 # `install` should never be called with '-s' ...
91 --
92 2.16.2