summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xbin/ebuild.sh9
-rw-r--r--doc/package/ebuild/eapi/2.docbook10
2 files changed, 19 insertions, 0 deletions
diff --git a/bin/ebuild.sh b/bin/ebuild.sh
index fe9adc02c..b7612a384 100755
--- a/bin/ebuild.sh
+++ b/bin/ebuild.sh
@@ -1373,12 +1373,21 @@ source_all_bashrcs() {
[[ $(type -t src_configure) = function ]] || \
src_configure() { _default_src_configure "$@" ; }
+ default() {
+ _default_${EBUILD_PHASE}
+ }
+
else
for x in $default_phases ; do
eval "default_$x() {
die \"default_$x() is not supported with EAPI='$EAPI'\"
}"
done
+
+ default() {
+ die "default() is not supported with EAPI='$EAPI'"
+ }
+
fi
local OCC="${CC}" OCXX="${CXX}"
diff --git a/doc/package/ebuild/eapi/2.docbook b/doc/package/ebuild/eapi/2.docbook
index dc2e0dc0a..275ab71ef 100644
--- a/doc/package/ebuild/eapi/2.docbook
+++ b/doc/package/ebuild/eapi/2.docbook
@@ -163,5 +163,15 @@
implementation.
</para>
</sect3>
+ <sect3 id='package-ebuild-eapi-2-phases-default-function-alias'>
+ <title>Default Phase Function Alias</title>
+ <para>
+ A function named "default" is redefined for each phase so that it
+ will call the default_* function corresponding to the current phase.
+ For example, a call to the function named "default" during the
+ src_compile phase is equivalent to a call to the function named
+ default_src_compile.
+ </para>
+ </sect3>
</sect2>
</sect1>