aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2007-06-05 22:36:09 +0000
committerAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2007-06-05 22:36:09 +0000
commit9b99270189b5504b848265f1616b9a226fe11187 (patch)
tree234a7a745a015c6c82b955e1e60856ce87de2ab5
parent41e6de161a3701068edf7373e4869da494db1ee3 (diff)
downloadpaludis-9b99270189b5504b848265f1616b9a226fe11187.tar.gz
paludis-9b99270189b5504b848265f1616b9a226fe11187.tar.xz
r3316@snowflake: ciaranm | 2007-06-05 23:34:23 +0100
More exheres work
-rw-r--r--configure.ac1
-rw-r--r--paludis/eapi-fwd.hh1
-rw-r--r--paludis/eapi.cc33
-rw-r--r--paludis/eapi.sr42
-rw-r--r--paludis/eapis/0.conf23
-rw-r--r--paludis/eapis/exheres-0.conf25
-rw-r--r--paludis/eapis/paludis-1.conf23
-rw-r--r--paludis/repositories/gentoo/ebuild.cc31
-rw-r--r--paludis/repositories/gentoo/ebuild.sr1
-rw-r--r--paludis/repositories/gentoo/ebuild/builtin_init.bash8
-rw-r--r--paludis/repositories/gentoo/ebuild/builtin_metadata.bash4
-rwxr-xr-xpaludis/repositories/gentoo/ebuild/ebuild.bash46
-rw-r--r--paludis/repositories/gentoo/ebuild/eclass_functions.bash33
-rw-r--r--paludis/repositories/gentoo/ebuild/utils/Makefile.am1
-rw-r--r--paludis/repositories/gentoo/ebuild/utils/exheres-0/Makefile.am49
-rwxr-xr-xpaludis/repositories/gentoo/ebuild/utils/exheres-0/banned_in_eapi_exheres-025
-rw-r--r--paludis/repositories/gentoo/ebuild_entries.cc54
-rw-r--r--paludis/repositories/gentoo/portage_repository.cc5
-rw-r--r--paludis/repositories/gentoo/portage_repository_TEST.cc17
-rwxr-xr-xpaludis/repositories/gentoo/portage_repository_TEST_setup.sh6
-rw-r--r--paludis/repositories/gentoo/vdb_repository.cc3
21 files changed, 364 insertions, 67 deletions
diff --git a/configure.ac b/configure.ac
index 58bb5b4..5f13813 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1152,6 +1152,7 @@ AC_OUTPUT(
paludis/repositories/gentoo/ebuild/Makefile
paludis/repositories/gentoo/ebuild/digests/Makefile
paludis/repositories/gentoo/ebuild/utils/Makefile
+ paludis/repositories/gentoo/ebuild/utils/exheres-0/Makefile
paludis/repositories/gentoo/ebuild/echo_functions.bash
paludis/repositories/gentoo/ebuild/work_around_broken_utilities.bash
paludis/repositories/virtuals/Makefile
diff --git a/paludis/eapi-fwd.hh b/paludis/eapi-fwd.hh
index 7523fa3..b5ef381 100644
--- a/paludis/eapi-fwd.hh
+++ b/paludis/eapi-fwd.hh
@@ -28,6 +28,7 @@ namespace paludis
class EAPIConfigurationError;
class EAPIEbuildPhases;
class EAPIEbuildMetadataVariables;
+ class EAPIEbuildOptions;
}
#endif
diff --git a/paludis/eapi.cc b/paludis/eapi.cc
index 1dd2be3..60d0c2a 100644
--- a/paludis/eapi.cc
+++ b/paludis/eapi.cc
@@ -80,10 +80,25 @@ namespace paludis
k.get("strict_iuse_flag_parse_mode")))
.breaks_portage(destringify<bool>(k.get("breaks_portage")))
.uri_supports_arrow(destringify<bool>(k.get("uri_supports_arrow")))
- .want_aa_var(destringify<bool>(k.get("want_aa_var")))
- .want_arch_var(destringify<bool>(k.get("want_arch_var")))
- .want_portage_emulation_vars(destringify<bool>(k.get("want_portage_emulation_vars")))
- .require_use_expand_in_iuse(destringify<bool>(k.get("require_use_expand_in_iuse")))
+
+ .ebuild_options(make_shared_ptr(new EAPIEbuildOptions(
+ EAPIEbuildOptions::create()
+ .want_aa_var(destringify<bool>(k.get("want_aa_var")))
+ .want_kv_var(destringify<bool>(k.get("want_kv_var")))
+ .want_arch_var(destringify<bool>(k.get("want_arch_var")))
+ .want_portage_emulation_vars(destringify<bool>(k.get("want_portage_emulation_vars")))
+ .require_use_expand_in_iuse(destringify<bool>(k.get("require_use_expand_in_iuse")))
+ .rdepend_defaults_to_depend(destringify<bool>(k.get("rdepend_defaults_to_depend")))
+ .non_empty_variables(k.get("non_empty_variables"))
+ .directory_variables(k.get("directory_variables"))
+ .directory_if_exists_variables(k.get("directory_if_exists_variables"))
+ .ebuild_must_not_set_variables(k.get("ebuild_must_not_set_variables"))
+ .source_merged_variables(k.get("source_merged_variables"))
+ .must_not_change_variables(k.get("must_not_change_variables"))
+ .support_eclasses(destringify<bool>(k.get("support_eclasses")))
+ .support_exlibs(destringify<bool>(k.get("support_exlibs")))
+ .utility_path_suffixes(k.get("utility_path_suffixes"))
+ )))
.ebuild_phases(make_shared_ptr(new EAPIEbuildPhases(
EAPIEbuildPhases::create()
@@ -132,10 +147,7 @@ namespace paludis
.strict_iuse_flag_parse_mode(iuse_pm_permissive)
.breaks_portage(true)
.uri_supports_arrow(false)
- .want_aa_var(false)
- .want_arch_var(false)
- .want_portage_emulation_vars(false)
- .require_use_expand_in_iuse(false)
+ .ebuild_options(tr1::shared_ptr<EAPIEbuildOptions>())
.ebuild_metadata_variables(tr1::shared_ptr<EAPIEbuildMetadataVariables>())
.ebuild_phases(tr1::shared_ptr<EAPIEbuildPhases>())
))))));
@@ -150,10 +162,7 @@ namespace paludis
.strict_iuse_flag_parse_mode(iuse_pm_permissive)
.breaks_portage(true)
.uri_supports_arrow(false)
- .want_aa_var(false)
- .want_arch_var(false)
- .want_portage_emulation_vars(false)
- .require_use_expand_in_iuse(false)
+ .ebuild_options(tr1::shared_ptr<EAPIEbuildOptions>())
.ebuild_metadata_variables(tr1::shared_ptr<EAPIEbuildMetadataVariables>())
.ebuild_phases(tr1::shared_ptr<EAPIEbuildPhases>())
))))));
diff --git a/paludis/eapi.sr b/paludis/eapi.sr
index 0a55054..3778063 100644
--- a/paludis/eapi.sr
+++ b/paludis/eapi.sr
@@ -59,6 +59,42 @@ make_class_EAPIEbuildMetadataVariables()
END
}
+make_class_EAPIEbuildOptions()
+{
+ visible
+ allow_named_args cc
+
+ key want_aa_var bool
+ key want_kv_var bool
+ key want_arch_var bool
+ key want_portage_emulation_vars bool
+ key require_use_expand_in_iuse bool
+ key rdepend_defaults_to_depend bool
+
+ key support_eclasses bool
+ key support_exlibs bool
+
+ key utility_path_suffixes std::string
+
+ key non_empty_variables std::string
+ key directory_variables std::string
+ key directory_if_exists_variables std::string
+ key ebuild_must_not_set_variables std::string
+ key source_merged_variables std::string
+ key must_not_change_variables std::string
+
+ doxygen_comment << "END"
+ /**
+ * Information about a supported EAPI's ebuild options.
+ *
+ * \see EAPIData
+ * \see EAPI
+ * \ingroup grpeapi
+ * \nosubgrouping
+ */
+END
+}
+
make_class_SupportedEAPI()
{
visible
@@ -73,11 +109,7 @@ make_class_SupportedEAPI()
key breaks_portage bool
- key want_aa_var bool
- key want_arch_var bool
- key want_portage_emulation_vars bool
- key require_use_expand_in_iuse bool
-
+ key ebuild_options "tr1::shared_ptr<const EAPIEbuildOptions>"
key ebuild_phases "tr1::shared_ptr<const EAPIEbuildPhases>"
key ebuild_metadata_variables "tr1::shared_ptr<const EAPIEbuildMetadataVariables>"
diff --git a/paludis/eapis/0.conf b/paludis/eapis/0.conf
index d92c2e7..cc04867 100644
--- a/paludis/eapis/0.conf
+++ b/paludis/eapis/0.conf
@@ -8,10 +8,33 @@ iuse_flag_parse_mode = eapi_0
strict_iuse_flag_parse_mode = eapi_0_strict
breaks_portage = false
uri_supports_arrow = false
+rdepend_defaults_to_depend = true
+
want_aa_var = true
+want_kv_var = true
want_arch_var = true
want_portage_emulation_vars = true
require_use_expand_in_iuse = false
+support_eclasses = true
+support_exlibs = false
+utility_path_suffixes =
+
+non_empty_variables = \
+ P PV PR PN PVR PF CATEGORY FILESDIR ECLASSDIR PORTDIR \
+ DISTDIR KV PALUDIS_TMPDIR PALUDIS_EBUILD_LOG_LEVEL PALUDIS_EBUILD_DIR \
+ USERLAND KERNEL ARCH CHOST PALUDIS_COMMAND ROOT
+
+directory_variables = \
+ ECLASSDIR PORTDIR DISTDIR
+
+directory_if_exists_variables = \
+ FILESDIR
+
+ebuild_must_not_set_variables =
+
+source_merged_variables = IUSE DEPEND RDEPEND PDEPEND KEYWORDS
+
+must_not_change_variables = SLOT
ebuild_install = \
: prepare ; \
diff --git a/paludis/eapis/exheres-0.conf b/paludis/eapis/exheres-0.conf
index eb95b36..1f5be04 100644
--- a/paludis/eapis/exheres-0.conf
+++ b/paludis/eapis/exheres-0.conf
@@ -7,10 +7,35 @@ dependency_spec_tree_parse_mode = exheres_0
iuse_flag_parse_mode = exheres_0
breaks_portage = true
want_aa_var = false
+want_kv_var = false
want_arch_var = false
want_portage_emulation_vars = false
uri_supports_arrow = true
require_use_expand_in_iuse = true
+rdepend_defaults_to_depend = false
+support_eclasses = false
+support_exlibs = true
+utility_path_suffixes = exheres-0
+
+non_empty_variables = \
+ P PV PR PN PVR PF CATEGORY FILESDIR EXLIBSDIRS PORTDIR \
+ DISTDIR PALUDIS_TMPDIR PALUDIS_EBUILD_LOG_LEVEL PALUDIS_EBUILD_DIR \
+ PALUDIS_COMMAND ROOT
+
+directory_variables = \
+ DISTDIR
+
+directory_if_exists_variables = \
+ FILESDIR
+
+ebuild_must_not_set_variables = \
+ DEPEND RDEPEND PDEPEND PROVIDE
+
+ebuild_must_not_set_variables =
+
+source_merged_variables = IUSE KEYWORDS
+
+must_not_change_variables = SLOT EAPI
ebuild_install = \
: prepare ; \
diff --git a/paludis/eapis/paludis-1.conf b/paludis/eapis/paludis-1.conf
index 299a7e3..6617db7 100644
--- a/paludis/eapis/paludis-1.conf
+++ b/paludis/eapis/paludis-1.conf
@@ -8,10 +8,33 @@ iuse_flag_parse_mode = permissive
breaks_portage = true
has_pkg_pretend = true
want_aa_var = false
+want_kv_var = false
want_arch_var = true
uri_supports_arrow = true
+rdepend_defaults_to_depend = false
want_portage_emulation_vars = false
require_use_expand_in_iuse = false
+support_eclasses = true
+support_exlibs = false
+utility_path_suffixes =
+non_empty_variables = \
+ P PV PR PN PVR PF CATEGORY FILESDIR ECLASSDIR PORTDIR \
+ DISTDIR PALUDIS_TMPDIR PALUDIS_EBUILD_LOG_LEVEL PALUDIS_EBUILD_DIR \
+ USERLAND KERNEL ARCH CHOST PALUDIS_COMMAND ROOT
+
+directory_variables = \
+ ECLASSDIR PORTDIR DISTDIR
+
+directory_if_exists_variables = \
+ FILESDIR
+
+ebuild_must_not_set_variables =
+
+ebuild_must_not_set_variables =
+
+source_merged_variables = IUSE DEPEND RDEPEND PDEPEND KEYWORDS
+
+must_not_change_variables = SLOT
ebuild_install = \
: prepare ; \
diff --git a/paludis/repositories/gentoo/ebuild.cc b/paludis/repositories/gentoo/ebuild.cc
index 85c34c2..77adf04 100644
--- a/paludis/repositories/gentoo/ebuild.cc
+++ b/paludis/repositories/gentoo/ebuild.cc
@@ -93,9 +93,6 @@ EbuildCommand::operator() ()
.with_setenv("CATEGORY", stringify(params.db_entry->name.category))
.with_setenv("REPOSITORY", stringify(params.db_entry->repository))
.with_setenv("FILESDIR", stringify(params.files_dir))
- .with_setenv("ECLASSDIR", stringify(*params.eclassdirs->begin()))
- .with_setenv("ECLASSDIRS", join(params.eclassdirs->begin(),
- params.eclassdirs->end(), " "))
.with_setenv("PORTDIR", stringify(params.portdir))
.with_setenv("DISTDIR", stringify(params.distdir))
.with_setenv("EAPI", stringify(params.eapi->name))
@@ -113,11 +110,33 @@ EbuildCommand::operator() ()
.with_setenv("PALUDIS_COMMAND", params.environment->paludis_command())
.with_setenv("PALUDIS_REDUCED_GID", stringify(params.environment->reduced_gid()))
.with_setenv("PALUDIS_REDUCED_UID", stringify(params.environment->reduced_uid()))
- .with_setenv("KV", kernel_version())
.with_setenv("PALUDIS_EBUILD_LOG_LEVEL", stringify(Log::get_instance()->log_level()))
- .with_setenv("PALUDIS_EBUILD_DIR", getenv_with_default("PALUDIS_EBUILD_DIR", LIBEXECDIR "/paludis")));
+ .with_setenv("PALUDIS_EBUILD_DIR", getenv_with_default("PALUDIS_EBUILD_DIR", LIBEXECDIR "/paludis"))
+ .with_setenv("PALUDIS_UTILITY_PATH_SUFFIXES", params.eapi->supported->ebuild_options->utility_path_suffixes)
+ .with_setenv("PALUDIS_NON_EMPTY_VARIABLES", params.eapi->supported->ebuild_options->non_empty_variables)
+ .with_setenv("PALUDIS_DIRECTORY_VARIABLES", params.eapi->supported->ebuild_options->directory_variables)
+ .with_setenv("PALUDIS_EBUILD_MUST_NOT_SET_VARIABLES", params.eapi->supported->ebuild_options->ebuild_must_not_set_variables)
+ .with_setenv("PALUDIS_DIRECTORY_IF_EXISTS_VARIABLES", params.eapi->supported->ebuild_options->directory_if_exists_variables)
+ .with_setenv("PALUDIS_SOURCE_MERGED_VARIABLES", params.eapi->supported->ebuild_options->source_merged_variables)
+ .with_setenv("PALUDIS_MUST_NOT_CHANGE_VARIABLES", params.eapi->supported->ebuild_options->must_not_change_variables)
+ .with_setenv("PALUDIS_RDEPEND_DEFAULTS_TO_DEPEND", params.eapi->supported->ebuild_options->rdepend_defaults_to_depend ? "yes" : "")
+ );
+
+ if (params.eapi->supported->ebuild_options->want_kv_var)
+ cmd.with_setenv("KV", kernel_version());
+
+ if (params.eapi->supported->ebuild_options->support_eclasses)
+ cmd
+ .with_setenv("ECLASSDIR", stringify(*params.eclassdirs->begin()))
+ .with_setenv("ECLASSDIRS", join(params.eclassdirs->begin(),
+ params.eclassdirs->end(), " "));
+
+ if (params.eapi->supported->ebuild_options->support_exlibs)
+ cmd
+ .with_setenv("EXLIBSDIRS", join(params.exlibsdirs->begin(),
+ params.exlibsdirs->end(), " "));
- if (params.eapi->supported->want_portage_emulation_vars)
+ if (params.eapi->supported->ebuild_options->want_portage_emulation_vars)
cmd = add_portage_vars(cmd);
if (do_run_command(cmd))
diff --git a/paludis/repositories/gentoo/ebuild.sr b/paludis/repositories/gentoo/ebuild.sr
index f2e8e7f..e45a8db 100644
--- a/paludis/repositories/gentoo/ebuild.sr
+++ b/paludis/repositories/gentoo/ebuild.sr
@@ -10,6 +10,7 @@ make_class_EbuildCommandParams()
key ebuild_file FSEntry
key files_dir FSEntry
key eclassdirs "tr1::shared_ptr<const FSEntryCollection>"
+ key exlibsdirs "tr1::shared_ptr<const FSEntryCollection>"
key portdir FSEntry
key distdir FSEntry
key buildroot FSEntry
diff --git a/paludis/repositories/gentoo/ebuild/builtin_init.bash b/paludis/repositories/gentoo/ebuild/builtin_init.bash
index 2e7b873..4a3836b 100644
--- a/paludis/repositories/gentoo/ebuild/builtin_init.bash
+++ b/paludis/repositories/gentoo/ebuild/builtin_init.bash
@@ -21,18 +21,16 @@ builtin_init()
export ROOT="${ROOT//+(\/)//}"
local a
- for a in P PV PR PN PVR PF CATEGORY FILESDIR ECLASSDIR PORTDIR \
- DISTDIR KV PALUDIS_TMPDIR PALUDIS_EBUILD_LOG_LEVEL PALUDIS_EBUILD_DIR \
- USERLAND KERNEL ARCH CHOST PALUDIS_COMMAND ROOT ; do
+ for a in PALUDIS_NON_EMPTY_VARIABLES ${PALUDIS_NON_EMPTY_VARIABLES} ; do
[[ -z "${!a}" ]] && die "\$${a} unset or empty"
declare -r ${a}="${!a}"
done
- for a in ECLASSDIR PORTDIR DISTDIR ; do
+ for a in ${PALUDIS_DIRECTORY_VARIABLES} ; do
[[ -d "${!a}" ]] || die "\$${a} (\"${!a}\") not a directory"
done
- for a in FILESDIR ; do
+ for a in ${PALUDIS_DIRECTORY_IF_EXISTS_VARIABLES} ; do
[[ -e "${!a}" ]] && [[ ! -d "${!a}" ]] && \
die "\$${a} (\"${!a}\") exists but is not a directory"
done
diff --git a/paludis/repositories/gentoo/ebuild/builtin_metadata.bash b/paludis/repositories/gentoo/ebuild/builtin_metadata.bash
index a23ee94..30753e1 100644
--- a/paludis/repositories/gentoo/ebuild/builtin_metadata.bash
+++ b/paludis/repositories/gentoo/ebuild/builtin_metadata.bash
@@ -24,6 +24,10 @@ ebuild_f_metadata()
{
local key
+ for a in ${PALUDIS_EBUILD_MUST_NOT_SET_VARIABLES} ; do
+ [[ -z "${!a}" ]] || die "\$${a} must not be set"
+ done
+
# The list below should include all variables from all EAPIs
for key in DEPEND RDEPEND PDEPEND IUSE SLOT SRC_URI RESTRICT LICENSE \
KEYWORDS INHERITED PROVIDE EAPI HOMEPAGE DESCRIPTION DEPENDENCIES \
diff --git a/paludis/repositories/gentoo/ebuild/ebuild.bash b/paludis/repositories/gentoo/ebuild/ebuild.bash
index d63e903..d0e6678 100755
--- a/paludis/repositories/gentoo/ebuild/ebuild.bash
+++ b/paludis/repositories/gentoo/ebuild/ebuild.bash
@@ -48,6 +48,9 @@ if [[ -n "${PALUDIS_EBUILD_DIR_FALLBACK}" ]] ; then
export PATH="${PALUDIS_EBUILD_DIR_FALLBACK}/utils:${PATH}"
fi
export PATH="${PALUDIS_EBUILD_DIR}/utils:${PATH}"
+for p in ${PALUDIS_UTILITY_PATH_SUFFIXES} ; do
+ export PATH="${PALUDIS_EBUILD_DIR}/utils/${p}:${PATH}"
+done
EBUILD_MODULES_DIR=$(canonicalise $(dirname $0 ) )
if ! [[ -d ${EBUILD_MODULES_DIR} ]] ; then
echo "${EBUILD_MODULES_DIR} is not a directory" 1>&2
@@ -156,6 +159,7 @@ ebuild_scrub_environment()
-e '/^\(EU\|PP\|U\)ID=/d'
-e '/^BASH_\(ARGC\|ARGV\|LINENO\|SOURCE\|VERSINFO\)=/d'
-e '/^BASH_COMPLETION\(_DIR\)\?=/d'
+ -e '/^PALUDIS_SOURCE_MERGED_VARIABLES=/d'
-e '/^bash[0-9]\+[a-z]\?=/d'
-e '/^\(FUNCNAME\|GROUPS\|SHELLOPTS\)=/d'
-e '/^\(declare -x \|export \)\?SANDBOX_ACTIVE=/d'
@@ -182,7 +186,11 @@ ebuild_scrub_environment()
unset -v PALUDIS_HOME PALUDIS_PID EBUILD_KILL_PID ROOT
unset -v CATEGORY PN PV P PVR PF ${!LD_*}
- unset -v ebuild EBUILD E_DEPEND E_RDEPEND E_IUSE E_PDEPEND E_KEYWORDS
+ unset -v ebuild EBUILD
+ for v in ${PALUDIS_SOURCE_MERGED_VARIABLES} ; do
+ e_v=E_${v}
+ unset -v ${e_v}
+ done
for v in ${!SANDBOX*}; do
[[ "${v}" == SANDBOX_ACTIVE ]] || unset "${v}"
@@ -251,26 +259,36 @@ ebuild_load_environment()
ebuild_load_ebuild()
{
export EBUILD="${1}"
- unset IUSE DEPEND RDEPEND PDEPEND KEYWORDS
- local saved_SLOT="${SLOT}"
+ unset ${SOURCE_MERGED_VARIABLES}
+
+ local v e_v
+ for v in ${PALUDIS_MUST_NOT_CHANGE_VARIABLES} ; do
+ e_v=saved_${v}
+ local ${e_v}="${!v}"
+ done
[[ -f "${1}" ]] || die "Ebuild '${1}' is not a file"
source ${1} || die "Error sourcing ebuild '${1}'"
- [[ ${RDEPEND-unset} == "unset" ]] && RDEPEND="${DEPEND}"
+ if [[ -n "${PALUDIS_RDEPEND_DEFAULTS_TO_DEPEND}" ]] ; then
+ [[ ${RDEPEND-unset} == "unset" ]] && RDEPEND="${DEPEND}"
+ fi
+
+ for v in ${PALUDIS_SOURCE_MERGED_VARIABLES} ; do
+ e_v=E_${v}
+ export ${v}="${!v} ${!e_v}"
+ done
- IUSE="${IUSE} ${E_IUSE}"
- DEPEND="${DEPEND} ${E_DEPEND}"
- RDEPEND="${RDEPEND} ${E_RDEPEND}"
- PDEPEND="${PDEPEND} ${E_PDEPEND}"
- KEYWORDS="${KEYWORDS} ${E_KEYWORDS}"
[[ ${EAPI-unset} == "unset" ]] && EAPI="0"
- if [[ -n "${saved_SLOT}" ]] && [[ "${SLOT}" != "${saved_SLOT}" ]] ; then
- ebuild_notice "qa" \
- "Ebuild ${1} illegally tried to change SLOT from '${saved_SLOT}' to '${SLOT}'"
- export SLOT=${saved_SLOT}
- fi
+ for v in ${PALUDIS_MUST_NOT_CHANGE_VARIABLES} ; do
+ s_v="saved_${v}"
+ if [[ -n "${!s_v}" ]] && [[ "${!v}" != "${!s_v}" ]] ; then
+ ebuild_notice "qa" \
+ "Ebuild ${1} illegally tried to change SLOT from '${!s_v}' to '${!v}'"
+ export ${v}="${!s_v}"
+ fi
+ done
}
perform_hook()
diff --git a/paludis/repositories/gentoo/ebuild/eclass_functions.bash b/paludis/repositories/gentoo/ebuild/eclass_functions.bash
index 9c6334d..93e6151 100644
--- a/paludis/repositories/gentoo/ebuild/eclass_functions.bash
+++ b/paludis/repositories/gentoo/ebuild/eclass_functions.bash
@@ -47,7 +47,7 @@ inherit()
{
[[ -n "${PALUDIS_SKIP_INHERIT}" ]] && return
- local e ee location=
+ local e ee location= v
for e in "$@" ; do
for ee in ${ECLASSDIRS:-${ECLASSDIR}} ; do
[[ -f "${ee}/${e}.eclass" ]] && location="${ee}/${e}.eclass"
@@ -55,29 +55,26 @@ inherit()
local old_ECLASS="${ECLASS}"
export ECLASS="${e}"
- local current_IUSE="${IUSE}" unset_IUSE="${IUSE-unset}"
- local current_DEPEND="${DEPEND}" unset_DEPEND="${DEPEND-unset}"
- local current_RDEPEND="${RDEPEND}" unset_RDEPEND="${RDEPEND-unset}"
- local current_PDEPEND="${PDEPEND}" unset_PDEPEND="${PDEPEND-unset}"
- local current_KEYWORDS="${KEYWORDS}" unset_KEYWORDS="${KEYWORDS-unset}"
-
- unset IUSE DEPEND RDEPEND PDEPEND KEYWORDS
+ for v in ${PALUDIS_SOURCE_MERGED_VARIABLES} ; do
+ local c_v="current_${v}" u_v="unset_${v}"
+ local ${c_v}="${!v}"
+ local ${u_v}="${!v-unset}"
+ unset ${v}
+ done
[[ -z "${location}" ]] && die "Error finding eclass ${e}"
source "${location}" || die "Error sourcing eclass ${e}"
hasq "${ECLASS}" ${INHERITED} || export INHERITED="${INHERITED} ${ECLASS}"
- E_IUSE="${E_IUSE} ${IUSE}"
- E_PDEPEND="${E_PDEPEND} ${PDEPEND}"
- E_RDEPEND="${E_RDEPEND} ${RDEPEND}"
- E_DEPEND="${E_DEPEND} ${DEPEND}"
- E_KEYWORDS="${KEYWORDS:+${KEYWORDS} }${E_KEYWORDS}"
+ for v in ${PALUDIS_SOURCE_MERGED_VARIABLES} ; do
+ local e_v="E_${v}"
+ export ${e_v}="${!e_v} ${!v}"
+ done
- [[ "unset" == "${unset_IUSE}" ]] && unset IUSE || IUSE="${current_IUSE}"
- [[ "unset" == "${unset_DEPEND}" ]] && unset DEPEND || DEPEND="${current_DEPEND}"
- [[ "unset" == "${unset_RDEPEND}" ]] && unset RDEPEND || RDEPEND="${current_RDEPEND}"
- [[ "unset" == "${unset_PDEPEND}" ]] && unset PDEPEND || PDEPEND="${current_PDEPEND}"
- [[ "unset" == "${unset_KEYWORDS}" ]] && unset KEYWORDS || KEYWORDS="${current_KEYWORDS}"
+ for v in ${PALUDIS_SOURCE_MERGED_VARIABLES} ; do
+ local c_v="current_${v}" u_v="unset_${v}"
+ [[ "unset" == ${!u_v} ]] && unset ${v} || export ${v}="${!c_v}"
+ done
export ECLASS="${old_ECLASS}"
done
diff --git a/paludis/repositories/gentoo/ebuild/utils/Makefile.am b/paludis/repositories/gentoo/ebuild/utils/Makefile.am
index c0f2447..c3fc906 100644
--- a/paludis/repositories/gentoo/ebuild/utils/Makefile.am
+++ b/paludis/repositories/gentoo/ebuild/utils/Makefile.am
@@ -1,4 +1,5 @@
MAINTAINERCLEANFILES = Makefile.in
+SUBDIRS = . exheres-0
libexecprogdir = $(libexecdir)/paludis/utils
diff --git a/paludis/repositories/gentoo/ebuild/utils/exheres-0/Makefile.am b/paludis/repositories/gentoo/ebuild/utils/exheres-0/Makefile.am
new file mode 100644
index 0000000..1a3a8dc
--- /dev/null
+++ b/paludis/repositories/gentoo/ebuild/utils/exheres-0/Makefile.am
@@ -0,0 +1,49 @@
+MAINTAINERCLEANFILES = Makefile.in
+SUBDIRS = .
+
+libexecprogdir = $(libexecdir)/paludis/utils/exheres-0
+
+libexecprog_SCRIPTS = \
+ dohard \
+ dosed \
+ donewins \
+ prepall \
+ prepallstrip \
+ prepstrip \
+ prepallman \
+ prepman \
+ prepallinfo \
+ prepinfo \
+ prepdocs \
+ prepalldocs \
+ banned_in_eapi_exheres-0
+
+AM_CXXFLAGS = -I$(top_srcdir) @PALUDIS_CXXFLAGS@
+
+TESTS_ENVIRONMENT = env \
+ PALUDIS_UTILITY_PATH_SUFFIXES="exheres-0" \
+ PALUDIS_EBUILD_DIR="`$(top_srcdir)/paludis/repositories/gentoo/ebuild/utils/canonicalise \
+ $(top_srcdir)/paludis/repositories/gentoo/ebuild/`" \
+ TOP_BUILD_DIR="`$(top_srcdir)/paludis/repositories/gentoo/ebuild/utils/canonicalise $(top_builddir)/`" \
+ PALUDIS_EBUILD_LOG_LEVEL="silent" \
+ TEST_SCRIPT_DIR="$(srcdir)/" \
+ bash $(top_srcdir)/paludis/repositories/gentoo/ebuild/utils/run_test.bash
+
+TESTS =
+
+EXTRA_DIST = $(libexecprog_SCRIPTS) $(check_SCRIPTS) \
+ banned_in_eapi_exheres-0 $(TESTS)
+
+bannedscripts = prepall prepallstrip prepstrip prepallman prepman prepallinfo \
+ prepinfo prepdocs prepalldocs dohard donewins dosed
+
+CLEANFILES = *~ $(bannedscripts)
+
+$(bannedscripts) : banned_in_eapi_exheres-0
+ cat $? > $@
+
+check_PROGRAMS =
+
+built-sources : $(BUILT_SOURCES)
+ for s in `echo $(SUBDIRS) | tr -d .` ; do $(MAKE) -C $$s built-sources || exit 1 ; done
+
diff --git a/paludis/repositories/gentoo/ebuild/utils/exheres-0/banned_in_eapi_exheres-0 b/paludis/repositories/gentoo/ebuild/utils/exheres-0/banned_in_eapi_exheres-0
new file mode 100755
index 0000000..937c70c
--- /dev/null
+++ b/paludis/repositories/gentoo/ebuild/utils/exheres-0/banned_in_eapi_exheres-0
@@ -0,0 +1,25 @@
+#!/bin/bash
+# vim: set sw=4 sts=4 et :
+
+# Copyright (c) 2007 Ciaran McCreesh <ciaranm@ciaranm.org>
+#
+# This file is part of the Paludis package manager. Paludis is free software;
+# you can redistribute it and/or modify it under the terms of the GNU General
+# Public License as published by the Free Software Foundation; either version
+# 2 of the License, or (at your option) any later version.
+#
+# Paludis is distributed in the hope that it will be useful, but WITHOUT ANY
+# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+# FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
+# details.
+#
+# You should have received a copy of the GNU General Public License along with
+# this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+# Place, Suite 330, Boston, MA 02111-1307 USA
+
+COLOUR_RED=$'\e[31;01m'
+COLOUR_NORMAL=$'\e[0m'
+
+echo "${COLOUR_RED}!!! Ebuild bug: '$(basename ${0} )' banned in EAPI exheres-0${COLOUR_NORMAL}"
+exit 123
+
diff --git a/paludis/repositories/gentoo/ebuild_entries.cc b/paludis/repositories/gentoo/ebuild_entries.cc
index b10ce00..f7e1a5f 100644
--- a/paludis/repositories/gentoo/ebuild_entries.cc
+++ b/paludis/repositories/gentoo/ebuild_entries.cc
@@ -166,6 +166,17 @@ EbuildEntries::generate_version_metadata(const QualifiedPackageName & q,
throw EAPIConfigurationError("EAPI '" + eapi->name + "' defines "
+ (c == 0 ? "no" : stringify(c)) + " ebuild variable phases but expected exactly one");
+ tr1::shared_ptr<FSEntryCollection> exlibsdirs(new FSEntryCollection::Concrete);
+ if (_imp->params.master_repository)
+ exlibsdirs->push_back(_imp->params.master_repository->params().location / "exlibs");
+ exlibsdirs->push_back(_imp->params.location / "exlibs");
+ if (_imp->params.master_repository)
+ exlibsdirs->push_back(_imp->params.master_repository->layout()->category_directory(q.category) / "exlibs");
+ exlibsdirs->push_back(_imp->portage_repository->layout()->category_directory(q.category) / "exlibs");
+ if (_imp->params.master_repository)
+ exlibsdirs->push_back(_imp->params.master_repository->layout()->package_directory(q) / "exlibs");
+ exlibsdirs->push_back(_imp->portage_repository->layout()->package_directory(q) / "exlibs");
+
EbuildMetadataCommand cmd(EbuildCommandParams::create()
.environment(_imp->environment)
.db_entry(&e)
@@ -173,6 +184,7 @@ EbuildEntries::generate_version_metadata(const QualifiedPackageName & q,
.ebuild_file(ebuild_file)
.files_dir(_imp->portage_repository->layout()->package_directory(q) / "files")
.eclassdirs(_imp->params.eclassdirs)
+ .exlibsdirs(exlibsdirs)
.portdir(_imp->params.master_repository ? _imp->params.master_repository->params().location :
_imp->params.location)
.distdir(_imp->params.distdir)
@@ -269,7 +281,7 @@ namespace
if (env->query_use(i->flag, pde))
use += stringify(i->flag) + " ";
- if (metadata->eapi->supported->want_arch_var)
+ if (metadata->eapi->supported->ebuild_options->want_arch_var)
use += profile->environment_variable("ARCH") + " ";
return use;
@@ -311,7 +323,7 @@ namespace
if (! env->query_use(UseFlagName(lower_x + "_" + stringify(*u)), e))
continue;
- if (! metadata->eapi->supported->require_use_expand_in_iuse)
+ if (! metadata->eapi->supported->ebuild_options->require_use_expand_in_iuse)
use.append(lower_x + "_" + stringify(*u) + " ");
std::string value;
@@ -459,7 +471,7 @@ EbuildEntries::install(const QualifiedPackageName & q, const VersionSpec & v,
}
/* make AA */
- if (metadata->eapi->supported->want_aa_var)
+ if (metadata->eapi->supported->ebuild_options->want_aa_var)
{
AAFinder g;
metadata->ebuild_interface->src_uri()->accept(g);
@@ -506,6 +518,16 @@ EbuildEntries::install(const QualifiedPackageName & q, const VersionSpec & v,
tr1::shared_ptr<AssociativeCollection<std::string, std::string> > expand_vars(make_expand(
_imp->params.environment, e, metadata, p, use));
+ tr1::shared_ptr<FSEntryCollection> exlibsdirs(new FSEntryCollection::Concrete);
+ if (_imp->params.master_repository)
+ exlibsdirs->push_back(_imp->params.master_repository->params().location / "exlibs");
+ exlibsdirs->push_back(_imp->params.location / "exlibs");
+ if (_imp->params.master_repository)
+ exlibsdirs->push_back(_imp->params.master_repository->layout()->category_directory(q.category) / "exlibs");
+ exlibsdirs->push_back(_imp->portage_repository->layout()->category_directory(q.category) / "exlibs");
+ if (_imp->params.master_repository)
+ exlibsdirs->push_back(_imp->params.master_repository->layout()->package_directory(q) / "exlibs");
+ exlibsdirs->push_back(_imp->portage_repository->layout()->package_directory(q) / "exlibs");
/* fetch */
{
@@ -550,6 +572,7 @@ EbuildEntries::install(const QualifiedPackageName & q, const VersionSpec & v,
.ebuild_file(_imp->portage_repository->layout()->package_file(q, v))
.files_dir(_imp->portage_repository->layout()->package_directory(q) / "files")
.eclassdirs(_imp->params.eclassdirs)
+ .exlibsdirs(exlibsdirs)
.portdir(_imp->params.master_repository ? _imp->params.master_repository->params().location :
_imp->params.location)
.distdir(_imp->params.distdir)
@@ -634,6 +657,7 @@ EbuildEntries::install(const QualifiedPackageName & q, const VersionSpec & v,
.ebuild_file(_imp->portage_repository->layout()->package_file(q, v))
.files_dir(_imp->portage_repository->layout()->package_directory(q) / "files")
.eclassdirs(_imp->params.eclassdirs)
+ .exlibsdirs(exlibsdirs)
.portdir(_imp->params.master_repository ? _imp->params.master_repository->params().location :
_imp->params.location)
.distdir(_imp->params.distdir)
@@ -680,6 +704,17 @@ EbuildEntries::get_environment_variable(const QualifiedPackageName & q,
throw EAPIConfigurationError("EAPI '" + metadata->eapi->name + "' defines "
+ (c == 0 ? "no" : stringify(c)) + " ebuild variable phases but expected exactly one");
+ tr1::shared_ptr<FSEntryCollection> exlibsdirs(new FSEntryCollection::Concrete);
+ if (_imp->params.master_repository)
+ exlibsdirs->push_back(_imp->params.master_repository->params().location / "exlibs");
+ exlibsdirs->push_back(_imp->params.location / "exlibs");
+ if (_imp->params.master_repository)
+ exlibsdirs->push_back(_imp->params.master_repository->layout()->category_directory(q.category) / "exlibs");
+ exlibsdirs->push_back(_imp->portage_repository->layout()->category_directory(q.category) / "exlibs");
+ if (_imp->params.master_repository)
+ exlibsdirs->push_back(_imp->params.master_repository->layout()->package_directory(q) / "exlibs");
+ exlibsdirs->push_back(_imp->portage_repository->layout()->package_directory(q) / "exlibs");
+
EbuildVariableCommand cmd(EbuildCommandParams::create()
.environment(_imp->params.environment)
.db_entry(&for_package)
@@ -687,6 +722,7 @@ EbuildEntries::get_environment_variable(const QualifiedPackageName & q,
.ebuild_file(_imp->portage_repository->layout()->package_file(q, v))
.files_dir(_imp->portage_repository->layout()->package_directory(q) / "files")
.eclassdirs(_imp->params.eclassdirs)
+ .exlibsdirs(exlibsdirs)
.portdir(_imp->params.master_repository ? _imp->params.master_repository->params().location :
_imp->params.location)
.distdir(_imp->params.distdir)
@@ -770,6 +806,17 @@ EbuildEntries::pretend(const QualifiedPackageName & q, const VersionSpec & v,
tr1::shared_ptr<AssociativeCollection<std::string, std::string> > expand_vars(make_expand(
_imp->params.environment, e, metadata, p, use));
+ tr1::shared_ptr<FSEntryCollection> exlibsdirs(new FSEntryCollection::Concrete);
+ if (_imp->params.master_repository)
+ exlibsdirs->push_back(_imp->params.master_repository->params().location / "exlibs");
+ exlibsdirs->push_back(_imp->params.location / "exlibs");
+ if (_imp->params.master_repository)
+ exlibsdirs->push_back(_imp->params.master_repository->layout()->category_directory(q.category) / "exlibs");
+ exlibsdirs->push_back(_imp->portage_repository->layout()->category_directory(q.category) / "exlibs");
+ if (_imp->params.master_repository)
+ exlibsdirs->push_back(_imp->params.master_repository->layout()->package_directory(q) / "exlibs");
+ exlibsdirs->push_back(_imp->portage_repository->layout()->package_directory(q) / "exlibs");
+
EAPIPhases phases(metadata->eapi->supported->ebuild_phases->ebuild_pretend);
for (EAPIPhases::Iterator phase(phases.begin_phases()), phase_end(phases.end_phases()) ;
phase != phase_end ; ++phase)
@@ -781,6 +828,7 @@ EbuildEntries::pretend(const QualifiedPackageName & q, const VersionSpec & v,
.ebuild_file(_imp->portage_repository->layout()->package_file(q, v))
.files_dir(_imp->portage_repository->layout()->package_directory(q) / "files")
.eclassdirs(_imp->params.eclassdirs)
+ .exlibsdirs(exlibsdirs)
.portdir(_imp->params.master_repository ? _imp->params.master_repository->params().location :
_imp->params.location)
.distdir(_imp->params.distdir)
diff --git a/paludis/repositories/gentoo/portage_repository.cc b/paludis/repositories/gentoo/portage_repository.cc
index 2cad69f..98f1c1e 100644
--- a/paludis/repositories/gentoo/portage_repository.cc
+++ b/paludis/repositories/gentoo/portage_repository.cc
@@ -162,7 +162,7 @@ namespace paludis
profile_ptr.reset(new PortageRepositoryProfile(
params.environment, repo, repo->name(), *params.profiles,
- EAPIData::get_instance()->eapi_from_string(params.eapi_when_unknown)->supported->want_arch_var));
+ EAPIData::get_instance()->eapi_from_string(params.eapi_when_unknown)->supported->ebuild_options->want_arch_var));
}
void
@@ -200,7 +200,8 @@ namespace paludis
.status(tokens.at(2))
.profile(tr1::shared_ptr<PortageRepositoryProfile>(new PortageRepositoryProfile(
params.environment, repo, repo->name(), profiles,
- EAPIData::get_instance()->eapi_from_string(params.eapi_when_unknown)->supported->want_arch_var))));
+ EAPIData::get_instance()->eapi_from_string(
+ params.eapi_when_unknown)->supported->ebuild_options->want_arch_var))));
}
}
diff --git a/paludis/repositories/gentoo/portage_repository_TEST.cc b/paludis/repositories/gentoo/portage_repository_TEST.cc
index c1ca4f6..a027c8f 100644
--- a/paludis/repositories/gentoo/portage_repository_TEST.cc
+++ b/paludis/repositories/gentoo/portage_repository_TEST.cc
@@ -24,6 +24,7 @@
#include <paludis/util/system.hh>
#include <paludis/util/visitor-impl.hh>
#include <paludis/eapi.hh>
+#include <paludis/dep_spec_pretty_printer.hh>
#include <test/test_framework.hh>
#include <test/test_runner.hh>
@@ -545,14 +546,26 @@ namespace test_cases
tr1::shared_ptr<const VersionMetadata> m;
m = repo->version_metadata(QualifiedPackageName("cat-one/pkg-one"), VersionSpec("1"));
+ TEST_CHECK(m->eapi->supported);
TEST_CHECK_EQUAL(m->description, "The Description");
TEST_CHECK_EQUAL(m->eapi->name, "0");
- TEST_CHECK(m->eapi->supported);
+ DepSpecPrettyPrinter pd(0, false);
+ m->deps_interface->build_depend()->accept(pd);
+ TEST_CHECK_STRINGIFY_EQUAL(pd, "foo/bar");
+ DepSpecPrettyPrinter pr(0, false);
+ m->deps_interface->run_depend()->accept(pr);
+ TEST_CHECK_STRINGIFY_EQUAL(pr, "foo/bar");
m = repo->version_metadata(QualifiedPackageName("cat-one/pkg-one"), VersionSpec("2"));
+ TEST_CHECK(m->eapi->supported);
TEST_CHECK_EQUAL(m->description, "dquote \" squote ' backslash \\ dollar $");
TEST_CHECK_EQUAL(m->eapi->name, "0");
- TEST_CHECK(m->eapi->supported);
+ DepSpecPrettyPrinter pd2(0, false);
+ m->deps_interface->build_depend()->accept(pd2);
+ TEST_CHECK_STRINGIFY_EQUAL(pd2, "foo/bar bar/baz");
+ DepSpecPrettyPrinter pr2(0, false);
+ m->deps_interface->run_depend()->accept(pr2);
+ TEST_CHECK_STRINGIFY_EQUAL(pr2, "foo/bar");
}
}
}
diff --git a/paludis/repositories/gentoo/portage_repository_TEST_setup.sh b/paludis/repositories/gentoo/portage_repository_TEST_setup.sh
index 9262151..af92586 100755
--- a/paludis/repositories/gentoo/portage_repository_TEST_setup.sh
+++ b/paludis/repositories/gentoo/portage_repository_TEST_setup.sh
@@ -133,8 +133,10 @@ SLOT="0"
IUSE=""
LICENSE="GPL-2"
KEYWORDS="test"
+DEPEND="foo/bar"
END
cat <<"END" > cat-one/pkg-one/pkg-one-2.ebuild || exit 1
+inherit mine
DESCRIPTION="dquote \" squote ' backslash \\ dollar \$"
HOMEPAGE="http://example.com/"
SRC_URI=""
@@ -142,6 +144,10 @@ SLOT="0"
IUSE=""
LICENSE="GPL-2"
KEYWORDS="test"
+DEPEND="foo/bar"
+END
+cat <<END > eclass/mine.eclass
+DEPEND="bar/baz"
END
cat <<END > cat-one/pkg-two/pkg-two-1.ebuild || exit 1
i am a fish
diff --git a/paludis/repositories/gentoo/vdb_repository.cc b/paludis/repositories/gentoo/vdb_repository.cc
index b6074f8..80a68ff 100644
--- a/paludis/repositories/gentoo/vdb_repository.cc
+++ b/paludis/repositories/gentoo/vdb_repository.cc
@@ -26,6 +26,7 @@
#include <paludis/dep_spec.hh>
#include <paludis/dep_spec_flattener.hh>
#include <paludis/util/private_implementation_pattern-impl.hh>
+#include <paludis/util/make_shared_ptr.hh>
#include <paludis/dep_tag.hh>
#include <paludis/eapi.hh>
#include <paludis/dep_spec_pretty_printer.hh>
@@ -996,6 +997,7 @@ VDBRepository::_uninstall(const QualifiedPackageName & q, const VersionSpec & v,
.ebuild_file(pkg_dir / (stringify(e.name.package) + "-" + stringify(e.version) + ".ebuild"))
.files_dir(pkg_dir)
.eclassdirs(eclassdirs)
+ .exlibsdirs(make_shared_ptr(new FSEntryCollection::Concrete))
.portdir(_imp->location)
.distdir(pkg_dir)
.eapi(m.eapi)
@@ -1061,6 +1063,7 @@ VDBRepository::do_config(const QualifiedPackageName & q, const VersionSpec & v)
.ebuild_file(pkg_dir / (stringify(e.name.package) + "-" + stringify(e.version) + ".ebuild"))
.files_dir(pkg_dir)
.eclassdirs(eclassdirs)
+ .exlibsdirs(make_shared_ptr(new FSEntryCollection::Concrete))
.portdir(_imp->location)
.distdir(pkg_dir)
.eapi(metadata->eapi)