aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAvatar Benedikt Morbach <moben@exherbo.org> 2016-12-19 01:28:01 +0100
committerAvatar Bo ├śrsted Andresen <zlin@exherbo.org> 2017-05-23 14:31:14 +0000
commitc37bdeabc544999e03b5f2185aae3c0a9bc566aa (patch)
tree682e764e8d517e817060b1b61d3acb7f455ec9d5
parentaf60798be93c2178ec61ba7bf8a622522085a23f (diff)
downloadpaludis-c37bdeabc544999e03b5f2185aae3c0a9bc566aa.tar.gz
paludis-c37bdeabc544999e03b5f2185aae3c0a9bc566aa.tar.xz
disallow unexported phases
avoids bugs and confusion that happen occasionally when phases are accidentally left around but not exported so they don't do anything. This is also the first step if we want to make the exporting automatic in the future to make sure that doesn't suddenly activate previously unexported phases. Change-Id: I4f7c5de4974e547c2596d138839dd41738d61e68
-rwxr-xr-xpaludis/repositories/e/e_repository_TEST_exlibs_setup.sh2
-rw-r--r--paludis/repositories/e/ebuild/exheres-0/exlib_functions.bash10
2 files changed, 9 insertions, 3 deletions
diff --git a/paludis/repositories/e/e_repository_TEST_exlibs_setup.sh b/paludis/repositories/e/e_repository_TEST_exlibs_setup.sh
index c9db490..031491d 100755
--- a/paludis/repositories/e/e_repository_TEST_exlibs_setup.sh
+++ b/paludis/repositories/e/e_repository_TEST_exlibs_setup.sh
@@ -615,6 +615,8 @@ src_unpack() {
END
mkdir -p "packages/cat/called-cross-phase-exlib"
cat <<'END' > packages/cat/called-cross-phase-exlib/verify.exlib || exit 1
+export_exlib_phases pkg_setup
+
verify_pkg_setup() {
:
}
diff --git a/paludis/repositories/e/ebuild/exheres-0/exlib_functions.bash b/paludis/repositories/e/ebuild/exheres-0/exlib_functions.bash
index 3808272..0dd5255 100644
--- a/paludis/repositories/e/ebuild/exheres-0/exlib_functions.bash
+++ b/paludis/repositories/e/ebuild/exheres-0/exlib_functions.bash
@@ -266,9 +266,13 @@ require()
has ${v} ${!a_v} || die "${CURRENT_EXLIB}.exlib takes no ${v} parameter"
done
- # die on exported exlib phases which don't get defined
- for v in ${PALUDIS_CHECK_EXPORTED_PHASES} ; do
- type -t ${v} >/dev/null || die "exported phase function ${v} does not exist"
+ for v in ${PALUDIS_EBUILD_FUNCTIONS} ; do
+ c_v=${CURRENT_EXLIB}_${v}
+ if has ${c_v} ${PALUDIS_CHECK_EXPORTED_PHASES}; then
+ type -t ${c_v} >/dev/null || die "exported phase function ${v} does not exist"
+ else
+ type -t ${c_v} >/dev/null && die "phase function ${c_v} exists but was not exported"
+ fi
done
export PALUDIS_CHECK_EXPORTED_PHASES="${old_PALUDIS_CHECK_EXPORTED_PHASES}"