aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2009-04-27 18:11:21 +0100
committerAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2009-04-27 18:11:21 +0100
commita950df5854eef2dc6286deec2931d0d68f9a7b92 (patch)
treec9587349875fe4d01707c72b5667d282b4405b8c
parent4ae48a93d3cff78807ee86bc13302d3ac410e2fa (diff)
downloadpaludis-a950df5854eef2dc6286deec2931d0d68f9a7b92.tar.gz
paludis-a950df5854eef2dc6286deec2931d0d68f9a7b92.tar.xz
EBUILD_PHASE is sometimes EXHERES_PHASE
-rw-r--r--paludis/repositories/e/eapi.cc1
-rw-r--r--paludis/repositories/e/eapi.hh2
-rw-r--r--paludis/repositories/e/eapis/0.conf1
-rw-r--r--paludis/repositories/e/eapis/exheres-0.conf1
-rw-r--r--paludis/repositories/e/eapis/paludis-1.conf1
-rw-r--r--paludis/repositories/e/ebuild.cc6
-rw-r--r--paludis/repositories/e/ebuild/0/build_functions.bash6
-rw-r--r--paludis/repositories/e/ebuild/0/eclass_functions.bash4
-rw-r--r--paludis/repositories/e/ebuild/2/eclass_functions.bash8
-rwxr-xr-xpaludis/repositories/e/ebuild/ebuild.bash6
-rw-r--r--paludis/repositories/e/ebuild/exheres-0/build_functions.bash12
-rw-r--r--paludis/repositories/e/ebuild/exheres-0/exlib_functions.bash8
12 files changed, 34 insertions, 22 deletions
diff --git a/paludis/repositories/e/eapi.cc b/paludis/repositories/e/eapi.cc
index 0d0ff62..2ee23c8 100644
--- a/paludis/repositories/e/eapi.cc
+++ b/paludis/repositories/e/eapi.cc
@@ -79,6 +79,7 @@ namespace
value_for<n::env_arch>(check_get(k, "env_arch")),
value_for<n::env_d>(check_get(k, "env_d")),
value_for<n::env_distdir>(check_get(k, "env_distdir")),
+ value_for<n::env_ebuild_phase>(check_get(k, "env_ebuild_phase")),
value_for<n::env_filesdir>(check_get(k, "env_filesdir")),
value_for<n::env_kv>(check_get(k, "env_kv")),
value_for<n::env_p>(check_get(k, "env_p")),
diff --git a/paludis/repositories/e/eapi.hh b/paludis/repositories/e/eapi.hh
index b68741e..30372e3 100644
--- a/paludis/repositories/e/eapi.hh
+++ b/paludis/repositories/e/eapi.hh
@@ -81,6 +81,7 @@ namespace paludis
struct env_arch;
struct env_d;
struct env_distdir;
+ struct env_ebuild_phase;
struct env_filesdir;
struct env_kv;
struct env_p;
@@ -273,6 +274,7 @@ namespace paludis
NamedValue<n::env_arch, std::string> env_arch;
NamedValue<n::env_d, std::string> env_d;
NamedValue<n::env_distdir, std::string> env_distdir;
+ NamedValue<n::env_ebuild_phase, std::string> env_ebuild_phase;
NamedValue<n::env_filesdir, std::string> env_filesdir;
NamedValue<n::env_kv, std::string> env_kv;
NamedValue<n::env_p, std::string> env_p;
diff --git a/paludis/repositories/e/eapis/0.conf b/paludis/repositories/e/eapis/0.conf
index 0a48e71..b500917 100644
--- a/paludis/repositories/e/eapis/0.conf
+++ b/paludis/repositories/e/eapis/0.conf
@@ -234,6 +234,7 @@ env_p = P
env_pf = PF
env_filesdir = FILESDIR
env_a = A
+env_ebuild_phase = EBUILD_PHASE
dependency_labels =
diff --git a/paludis/repositories/e/eapis/exheres-0.conf b/paludis/repositories/e/eapis/exheres-0.conf
index 72eda34..30836e1 100644
--- a/paludis/repositories/e/eapis/exheres-0.conf
+++ b/paludis/repositories/e/eapis/exheres-0.conf
@@ -262,6 +262,7 @@ env_filesdir = FILES
env_a = ARCHIVES
env_replacing_ids = REPLACING_IDS
env_replaced_by_id = REPLACED_BY_ID
+env_ebuild_phase = EXHERES_PHASE
uri_labels = \
default = URIListedThenMirrorsLabel ; \
diff --git a/paludis/repositories/e/eapis/paludis-1.conf b/paludis/repositories/e/eapis/paludis-1.conf
index f7d81a1..ccbfb58 100644
--- a/paludis/repositories/e/eapis/paludis-1.conf
+++ b/paludis/repositories/e/eapis/paludis-1.conf
@@ -237,6 +237,7 @@ env_p = P
env_pf = PF
env_filesdir = FILESDIR
env_a = A
+env_ebuild_phase = EBUILD_PHASE
uri_labels = \
default = URIListedThenMirrorsLabel ; \
diff --git a/paludis/repositories/e/ebuild.cc b/paludis/repositories/e/ebuild.cc
index 3aa5e39..84c20a2 100644
--- a/paludis/repositories/e/ebuild.cc
+++ b/paludis/repositories/e/ebuild.cc
@@ -213,6 +213,8 @@ EbuildCommand::operator() ()
params.package_id()->eapi()->supported()->ebuild_environment_variables()->env_t())
.with_setenv("PALUDIS_NAME_VERSION_REVISION_VAR",
params.package_id()->eapi()->supported()->ebuild_environment_variables()->env_pf())
+ .with_setenv("PALUDIS_EBUILD_PHASE_VAR",
+ params.package_id()->eapi()->supported()->ebuild_environment_variables()->env_ebuild_phase())
.with_setenv("PALUDIS_PIPE_COMMANDS_SUPPORTED", "yes")
.with_setenv("PALUDIS_PIPE_COMMAND_DELIM", "\2")
)
@@ -892,6 +894,8 @@ WriteVDBEntryCommand::operator() ()
params.package_id()->eapi()->supported()->ebuild_options()->ignore_pivot_env_variables())
.with_setenv("PALUDIS_EBUILD_MODULE_SUFFIXES",
params.package_id()->eapi()->supported()->ebuild_options()->ebuild_module_suffixes())
+ .with_setenv("PALUDIS_EBUILD_PHASE_VAR",
+ params.package_id()->eapi()->supported()->ebuild_environment_variables()->env_ebuild_phase())
.with_pipe_command_handler(std::tr1::bind(&pipe_command_handler, params.environment(),
params.package_id(), _1, params.maybe_output_manager()))
);
@@ -1115,6 +1119,8 @@ WriteBinaryEbuildCommand::operator() ()
+ params.package_id()->eapi()->exported_name())->supported()->ebuild_environment_variables()->env_distdir())
.with_setenv("PALUDIS_EBUILD_MODULE_SUFFIXES",
params.package_id()->eapi()->supported()->ebuild_options()->ebuild_module_suffixes())
+ .with_setenv("PALUDIS_EBUILD_PHASE_VAR",
+ params.package_id()->eapi()->supported()->ebuild_environment_variables()->env_ebuild_phase())
.with_pipe_command_handler(std::tr1::bind(&pipe_command_handler, params.environment(),
params.package_id(), _1, params.maybe_output_manager()))
);
diff --git a/paludis/repositories/e/ebuild/0/build_functions.bash b/paludis/repositories/e/ebuild/0/build_functions.bash
index c1c3577..9863b7a 100644
--- a/paludis/repositories/e/ebuild/0/build_functions.bash
+++ b/paludis/repositories/e/ebuild/0/build_functions.bash
@@ -1,7 +1,7 @@
#!/usr/bin/env bash
# vim: set sw=4 sts=4 et :
-# Copyright (c) 2006, 2007 Ciaran McCreesh
+# Copyright (c) 2006, 2007, 2009 Ciaran McCreesh
#
# Based in part upon ebuild.sh from Portage, which is Copyright 1995-2005
# Gentoo Foundation and distributed under the terms of the GNU General
@@ -24,8 +24,8 @@ econf()
{
local phase
has src_configure ${PALUDIS_EBUILD_FUNCTIONS} && phase=configure
- if [[ "${EBUILD_PHASE}" != "${phase:-compile}" ]]; then
- ebuild_notice "qa" "econf called in EBUILD_PHASE ${EBUILD_PHASE}. It should not be run outside src_${phase} for this EAPI."
+ if [[ "${PALUDIS_EBUILD_PHASE_VAR}" != "${phase:-compile}" ]]; then
+ ebuild_notice "qa" "econf called in EBUILD_PHASE ${!PALUDIS_EBUILD_PHASE_VAR}. It should not be run outside src_${phase} for this EAPI."
fi
local LOCAL_EXTRA_ECONF="${EXTRA_ECONF}"
diff --git a/paludis/repositories/e/ebuild/0/eclass_functions.bash b/paludis/repositories/e/ebuild/0/eclass_functions.bash
index 3085ab0..4949b43 100644
--- a/paludis/repositories/e/ebuild/0/eclass_functions.bash
+++ b/paludis/repositories/e/ebuild/0/eclass_functions.bash
@@ -1,7 +1,7 @@
#!/usr/bin/env bash
# vim: set sw=4 sts=4 et :
-# Copyright (c) 2006, 2007 Ciaran McCreesh
+# Copyright (c) 2006, 2007, 2009 Ciaran McCreesh
#
# Based in part upon ebuild.sh from Portage, which is Copyright 1995-2005
# Gentoo Foundation and distributed under the terms of the GNU General
@@ -26,7 +26,7 @@ EXPORT_FUNCTIONS()
local e
for e in "$@" ; do
- if [[ ${EBUILD_PHASE} != metadata ]] && { [[ "${e}" == builtin_* ]] || ! has "${e}" ${PALUDIS_EBUILD_FUNCTIONS}; }; then
+ if [[ ${!PALUDIS_EBUILD_PHASE_VAR} != metadata ]] && { [[ "${e}" == builtin_* ]] || ! has "${e}" ${PALUDIS_EBUILD_FUNCTIONS}; }; then
ebuild_notice "qa" "$e should not be in EXPORT_FUNCTIONS for ${ECLASS}"
fi
eval "${e}() { ${ECLASS}_${e} \"\$@\" ; }"
diff --git a/paludis/repositories/e/ebuild/2/eclass_functions.bash b/paludis/repositories/e/ebuild/2/eclass_functions.bash
index bd78f5d..2b85b8f 100644
--- a/paludis/repositories/e/ebuild/2/eclass_functions.bash
+++ b/paludis/repositories/e/ebuild/2/eclass_functions.bash
@@ -1,7 +1,7 @@
#!/usr/bin/env bash
# vim: set sw=4 sts=4 et :
-# Copyright (c) 2007, 2008 Ciaran McCreesh
+# Copyright (c) 2007, 2008, 2009 Ciaran McCreesh
# Copyright (c) 2008 David Leverton
#
# This file is part of the Paludis package manager. Paludis is free software;
@@ -21,7 +21,7 @@ ebuild_load_module 0/eclass_functions
default()
{
- [[ $(type -t "default_$(paludis_phase_to_function_name "${EBUILD_PHASE}")" ) == "function" ]] || \
- die "default_$(paludis_phase_to_function_name "${EBUILD_PHASE}") is not a function"
- default_$(paludis_phase_to_function_name "${EBUILD_PHASE}") "$@"
+ [[ $(type -t "default_$(paludis_phase_to_function_name "${!PALUDIS_EBUILD_PHASE_VAR}")" ) == "function" ]] || \
+ die "default_$(paludis_phase_to_function_name "${!PALUDIS_EBUILD_PHASE_VAR}") is not a function"
+ default_$(paludis_phase_to_function_name "${!PALUDIS_EBUILD_PHASE_VAR}") "$@"
}
diff --git a/paludis/repositories/e/ebuild/ebuild.bash b/paludis/repositories/e/ebuild/ebuild.bash
index 90d9dce..1953c64 100755
--- a/paludis/repositories/e/ebuild/ebuild.bash
+++ b/paludis/repositories/e/ebuild/ebuild.bash
@@ -1,7 +1,7 @@
#!/usr/bin/env bash
# vim: set sw=4 sts=4 et :
-# Copyright (c) 2006, 2007, 2008 Ciaran McCreesh
+# Copyright (c) 2006, 2007, 2008, 2009 Ciaran McCreesh
#
# Based in part upon ebuild.sh from Portage, which is Copyright 1995-2005
# Gentoo Foundation and distributed under the terms of the GNU General
@@ -484,7 +484,7 @@ ebuild_main()
if [[ $1 == metadata ]] || [[ $1 == variable ]] || [[ $1 == pretend ]] || \
[[ $1 == bad_options ]] ; then
- export EBUILD_PHASE="${1}"
+ export ${PALUDIS_EBUILD_PHASE_VAR}="${1}"
perform_hook ebuild_${action}_pre
if [[ $1 == metadata ]]; then
for f in cut tr date ; do
@@ -504,7 +504,7 @@ ebuild_main()
perform_hook ebuild_${action}_post
else
for action in $@ ; do
- export EBUILD_PHASE="${action}"
+ export ${PALUDIS_EBUILD_PHASE_VAR}="${action}"
perform_hook ebuild_${action}_pre
if ! ${PALUDIS_F_FUNCTION_PREFIX:-ebuild_f}_${action} ; then
perform_hook ebuild_${action}_fail
diff --git a/paludis/repositories/e/ebuild/exheres-0/build_functions.bash b/paludis/repositories/e/ebuild/exheres-0/build_functions.bash
index 4b1811f..6c6b36b 100644
--- a/paludis/repositories/e/ebuild/exheres-0/build_functions.bash
+++ b/paludis/repositories/e/ebuild/exheres-0/build_functions.bash
@@ -37,8 +37,8 @@ is_nonfatal()
expatch()
{
- if [[ "${EBUILD_PHASE}" != "prepare" ]] ; then
- die "expatch called in EBUILD_PHASE ${EBUILD_PHASE}"
+ if [[ "${!PALUDIS_EBUILD_PHASE_VAR}" != "prepare" ]] ; then
+ die "expatch called in phase ${!PALUDIS_EBUILD_PHASE_VAR}"
fi
local recognise= patchlevel= options=() cmd= appliedpatches=0 dirpatches=()
@@ -97,8 +97,8 @@ expatch()
econf()
{
- if [[ "${EBUILD_PHASE}" != "configure" ]] ; then
- die "econf called in EBUILD_PHASE ${EBUILD_PHASE}"
+ if [[ "${!PALUDIS_EBUILD_PHASE_VAR}" != "configure" ]] ; then
+ die "econf called in phase ${!PALUDIS_EBUILD_PHASE_VAR}"
fi
local LOCAL_EXTRA_ECONF="${EXTRA_ECONF}"
@@ -168,8 +168,8 @@ econf()
einstall()
{
- if [[ "${EBUILD_PHASE}" != "install" ]] ; then
- die "einstall called in EBUILD_PHASE ${EBUILD_PHASE}"
+ if [[ "${!PALUDIS_EBUILD_PHASE_VAR}" != "install" ]] ; then
+ die "einstall called in phase ${!PALUDIS_EBUILD_PHASE_VAR}"
fi
if [[ -f Makefile ]] || [[ -f makefile ]] || [[ -f GNUmakefile ]] ; then
diff --git a/paludis/repositories/e/ebuild/exheres-0/exlib_functions.bash b/paludis/repositories/e/ebuild/exheres-0/exlib_functions.bash
index b72fe4e..769a9cd 100644
--- a/paludis/repositories/e/ebuild/exheres-0/exlib_functions.bash
+++ b/paludis/repositories/e/ebuild/exheres-0/exlib_functions.bash
@@ -1,7 +1,7 @@
#!/usr/bin/env bash
# vim: set sw=4 sts=4 et :
-# Copyright (c) 2007, 2008 Ciaran McCreesh
+# Copyright (c) 2007, 2008, 2009 Ciaran McCreesh
# Copyright (c) 2009 Bo ├śrsted Andresen
#
# This file is part of the Paludis package manager. Paludis is free software;
@@ -227,7 +227,7 @@ require()
default()
{
- [[ $(type -t "default_$(paludis_phase_to_function_name "${EBUILD_PHASE}")" ) == "function" ]] || \
- die "default_$(paludis_phase_to_function_name "${EBUILD_PHASE}") is not a function"
- default_$(paludis_phase_to_function_name "${EBUILD_PHASE}") "$@"
+ [[ $(type -t "default_$(paludis_phase_to_function_name "${!PALUDIS_EBUILD_PHASE_VAR}")" ) == "function" ]] || \
+ die "default_$(paludis_phase_to_function_name "${!PALUDIS_EBUILD_PHASE_VAR}") is not a function"
+ default_$(paludis_phase_to_function_name "${!PALUDIS_EBUILD_PHASE_VAR}") "$@"
}