aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2007-07-07 09:41:17 +0000
committerAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2007-07-07 09:41:17 +0000
commit50b532511e18b923c6102819397dd3d09cfa5124 (patch)
tree9117d7569129feb0772721031365721b4a7a1d12
parentc4bfb64606c6029a22ee1cd920136b7ef53496cd (diff)
downloadpaludis-50b532511e18b923c6102819397dd3d09cfa5124.tar.gz
paludis-50b532511e18b923c6102819397dd3d09cfa5124.tar.xz
More EAPI-configurable options. Allow characters other than underscore for USE_EXPAND. Fixes: ticket:285. Fixes: ticket:311
-rw-r--r--configure.ac2
-rw-r--r--paludis/distribution.cc7
-rw-r--r--paludis/distribution.sr7
-rw-r--r--paludis/distributions/gentoo.conf7
-rw-r--r--paludis/eapi-fwd.hh1
-rw-r--r--paludis/eapi.cc42
-rw-r--r--paludis/eapi.sr84
-rw-r--r--paludis/eapis/0.conf73
-rw-r--r--paludis/eapis/exheres-0.conf71
-rw-r--r--paludis/eapis/paludis-1.conf54
-rw-r--r--paludis/environments/no_config/no_config_environment.cc18
-rw-r--r--paludis/name.cc19
-rw-r--r--paludis/name_TEST.cc8
-rw-r--r--paludis/repositories/e/e_repository.cc27
-rw-r--r--paludis/repositories/e/e_repository_params.sr1
-rw-r--r--paludis/repositories/e/e_repository_profile.cc96
-rw-r--r--paludis/repositories/e/e_repository_profile.hh2
-rw-r--r--paludis/repositories/e/ebuild.cc72
-rw-r--r--paludis/repositories/e/ebuild/0/Makefile.am26
-rw-r--r--paludis/repositories/e/ebuild/Makefile.am2
-rw-r--r--paludis/repositories/e/ebuild/builtin_metadata.bash2
-rwxr-xr-xpaludis/repositories/e/ebuild/ebuild.bash8
-rw-r--r--paludis/repositories/e/ebuild/exheres-0/Makefile.am27
-rw-r--r--paludis/repositories/e/ebuild/exheres-0/builtin_fetch.bash138
-rw-r--r--paludis/repositories/e/ebuild/exheres-0/pkg_nofetch.bash62
-rw-r--r--paludis/repositories/e/ebuild/utils/exheres-0/Makefile.am1
-rwxr-xr-xpaludis/repositories/e/ebuild/utils/exheres-0/dounpack132
-rwxr-xr-xpaludis/repositories/e/ebuild/write_vdb_entry.bash26
-rw-r--r--paludis/repositories/e/ebuild_entries.cc19
-rw-r--r--paludis/repositories/e/make_ebin_repository.cc6
-rw-r--r--paludis/repositories/e/make_ebuild_repository.cc6
-rw-r--r--paludis/repositories/e/use_desc.cc8
-rw-r--r--paludis/repositories/e/use_desc.hh2
-rw-r--r--paludis/repositories/e/vdb_id.cc166
-rw-r--r--paludis/util/destringify.hh32
-rw-r--r--src/output/console_install_task.cc20
-rw-r--r--src/output/use_flag_pretty_printer.cc13
37 files changed, 1056 insertions, 231 deletions
diff --git a/configure.ac b/configure.ac
index 946e6c2..b33f1a3 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1216,6 +1216,8 @@ AC_OUTPUT(
paludis/repositories/gems/Makefile
paludis/repositories/e/Makefile
paludis/repositories/e/ebuild/Makefile
+ paludis/repositories/e/ebuild/0/Makefile
+ paludis/repositories/e/ebuild/exheres-0/Makefile
paludis/repositories/e/ebuild/digests/Makefile
paludis/repositories/e/ebuild/utils/Makefile
paludis/repositories/e/ebuild/utils/exheres-0/Makefile
diff --git a/paludis/distribution.cc b/paludis/distribution.cc
index 1ed95b5..4ccb2eb 100644
--- a/paludis/distribution.cc
+++ b/paludis/distribution.cc
@@ -75,6 +75,11 @@ namespace paludis
.default_ebuild_layout(k.get("default_ebuild_layout"))
.default_ebuild_eapi_when_unknown(k.get("default_ebuild_eapi_when_unknown"))
.default_ebuild_eapi_when_unspecified(k.get("default_ebuild_eapi_when_unspecified"))
+ .default_ebuild_profile_eapi(k.get("default_ebuild_profile_eapi"))
+ .paludis_environment_use_conf_filename(k.get("paludis_environment_use_conf_filename"))
+ .paludis_environment_keywords_conf_filename(k.get("paludis_environment_keywords_conf_filename"))
+ .concept_use(k.get("concept_use"))
+ .concept_keyword(k.get("concept_keyword"))
))));
}
}
@@ -95,7 +100,7 @@ DistributionData::distribution_from_string(const std::string & s) const
{
MakeHashedMap<std::string, tr1::shared_ptr<const Distribution> >::Type::const_iterator i(_imp->values.find(s));
if (i == _imp->values.end())
- return tr1::shared_ptr<const Distribution>();
+ throw DistributionConfigurationError("No distribution configuration found for '" + s + "'");
else
return i->second;
}
diff --git a/paludis/distribution.sr b/paludis/distribution.sr
index eb616eb..2c44cd1 100644
--- a/paludis/distribution.sr
+++ b/paludis/distribution.sr
@@ -14,6 +14,13 @@ make_class_Distribution()
key default_ebuild_layout std::string
key default_ebuild_eapi_when_unknown std::string
key default_ebuild_eapi_when_unspecified std::string
+ key default_ebuild_profile_eapi std::string
+
+ key paludis_environment_use_conf_filename std::string
+ key paludis_environment_keywords_conf_filename std::string
+
+ key concept_use std::string
+ key concept_keyword std::string
allow_named_args
diff --git a/paludis/distributions/gentoo.conf b/paludis/distributions/gentoo.conf
index f574db9..3353642 100644
--- a/paludis/distributions/gentoo.conf
+++ b/paludis/distributions/gentoo.conf
@@ -11,4 +11,11 @@ default_ebuild_build_root = /var/tmp/paludis
default_ebuild_layout = traditional
default_ebuild_eapi_when_unknown = 0
default_ebuild_eapi_when_unspecified = 0
+default_ebuild_profile_eapi = 0
+
+paludis_environment_use_conf_filename = use.conf
+paludis_environment_keywords_conf_filename = keywords.conf
+
+concept_use = USE flag
+concept_keyword = keyword
diff --git a/paludis/eapi-fwd.hh b/paludis/eapi-fwd.hh
index b5ef381..882817c 100644
--- a/paludis/eapi-fwd.hh
+++ b/paludis/eapi-fwd.hh
@@ -28,6 +28,7 @@ namespace paludis
class EAPIConfigurationError;
class EAPIEbuildPhases;
class EAPIEbuildMetadataVariables;
+ class EAPIEbuildEnvironmentVariables;
class EAPIEbuildOptions;
}
diff --git a/paludis/eapi.cc b/paludis/eapi.cc
index 6e2a23e..395b9ff 100644
--- a/paludis/eapi.cc
+++ b/paludis/eapi.cc
@@ -82,9 +82,6 @@ namespace paludis
.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")))
@@ -92,12 +89,17 @@ namespace paludis
.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"))
+ .vdb_from_env_variables(k.get("vdb_from_env_variables"))
+ .vdb_from_env_unless_empty_variables(k.get("vdb_from_env_unless_empty_variables"))
.source_merged_variables(k.get("source_merged_variables"))
.must_not_change_variables(k.get("must_not_change_variables"))
+ .save_variables(k.get("save_variables"))
+ .save_base_variables(k.get("save_base_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_module_suffixes(k.get("ebuild_module_suffixes"))
+ .use_expand_separator(destringify<char>(k.get("use_expand_separator")))
)))
.ebuild_phases(make_shared_ptr(new EAPIEbuildPhases(
@@ -127,7 +129,37 @@ namespace paludis
.metadata_iuse(k.get("metadata_iuse"))
.metadata_pdepend(k.get("metadata_pdepend"))
.metadata_provide(k.get("metadata_provide"))
- .metadata_eapi(k.get("metadata_eapi")))))
+ .metadata_eapi(k.get("metadata_eapi"))
+ .description_build_depend(k.get("description_build_depend"))
+ .description_run_depend(k.get("description_run_depend"))
+ .description_slot(k.get("description_slot"))
+ .description_src_uri(k.get("description_src_uri"))
+ .description_restrict(k.get("description_restrict"))
+ .description_homepage(k.get("description_homepage"))
+ .description_license(k.get("description_license"))
+ .description_description(k.get("description_description"))
+ .description_keywords(k.get("description_keywords"))
+ .description_eclass_keywords(k.get("description_eclass_keywords"))
+ .description_inherited(k.get("description_inherited"))
+ .description_iuse(k.get("description_iuse"))
+ .description_pdepend(k.get("description_pdepend"))
+ .description_provide(k.get("description_provide"))
+ .description_eapi(k.get("description_eapi"))
+ )))
+
+ .ebuild_environment_variables(make_shared_ptr(new EAPIEbuildEnvironmentVariables(
+ EAPIEbuildEnvironmentVariables::create()
+ .env_use(k.get("env_use"))
+ .env_use_expand(k.get("env_use_expand"))
+ .env_use_expand_hidden(k.get("env_use_expand_hidden"))
+ .env_aa(k.get("env_aa"))
+ .env_arch(k.get("env_arch"))
+ .env_kv(k.get("env_kv"))
+ .env_portdir(k.get("env_portdir"))
+ .env_distdir(k.get("env_distdir"))
+ .env_accept_keywords(k.get("env_accept_keywords"))
+ .description_use(k.get("description_use"))
+ )))
))))));
}
@@ -149,6 +181,7 @@ namespace paludis
.uri_supports_arrow(false)
.ebuild_options(tr1::shared_ptr<EAPIEbuildOptions>())
.ebuild_metadata_variables(tr1::shared_ptr<EAPIEbuildMetadataVariables>())
+ .ebuild_environment_variables(tr1::shared_ptr<EAPIEbuildEnvironmentVariables>())
.ebuild_phases(tr1::shared_ptr<EAPIEbuildPhases>())
))))));
@@ -164,6 +197,7 @@ namespace paludis
.uri_supports_arrow(false)
.ebuild_options(tr1::shared_ptr<EAPIEbuildOptions>())
.ebuild_metadata_variables(tr1::shared_ptr<EAPIEbuildMetadataVariables>())
+ .ebuild_environment_variables(tr1::shared_ptr<EAPIEbuildEnvironmentVariables>())
.ebuild_phases(tr1::shared_ptr<EAPIEbuildPhases>())
))))));
}
diff --git a/paludis/eapi.sr b/paludis/eapi.sr
index 6d9def7..71347c9 100644
--- a/paludis/eapi.sr
+++ b/paludis/eapi.sr
@@ -31,21 +31,37 @@ make_class_EAPIEbuildMetadataVariables()
visible
allow_named_args cc
- key metadata_build_depend std::string
- key metadata_run_depend std::string
- key metadata_slot std::string
- key metadata_src_uri std::string
- key metadata_restrict std::string
- key metadata_homepage std::string
- key metadata_license std::string
- key metadata_description std::string
- key metadata_keywords std::string
- key metadata_eclass_keywords std::string
- key metadata_inherited std::string
- key metadata_iuse std::string
- key metadata_pdepend std::string
- key metadata_provide std::string
- key metadata_eapi std::string
+ key metadata_build_depend std::string
+ key metadata_run_depend std::string
+ key metadata_slot std::string
+ key metadata_src_uri std::string
+ key metadata_restrict std::string
+ key metadata_homepage std::string
+ key metadata_license std::string
+ key metadata_description std::string
+ key metadata_keywords std::string
+ key metadata_eclass_keywords std::string
+ key metadata_inherited std::string
+ key metadata_iuse std::string
+ key metadata_pdepend std::string
+ key metadata_provide std::string
+ key metadata_eapi std::string
+
+ key description_build_depend std::string
+ key description_run_depend std::string
+ key description_slot std::string
+ key description_src_uri std::string
+ key description_restrict std::string
+ key description_homepage std::string
+ key description_license std::string
+ key description_description std::string
+ key description_keywords std::string
+ key description_eclass_keywords std::string
+ key description_inherited std::string
+ key description_iuse std::string
+ key description_pdepend std::string
+ key description_provide std::string
+ key description_eapi std::string
doxygen_comment << "END"
/**
@@ -59,17 +75,44 @@ make_class_EAPIEbuildMetadataVariables()
END
}
+make_class_EAPIEbuildEnvironmentVariables()
+{
+ visible
+ allow_named_args cc
+
+ key env_use std::string
+ key env_use_expand std::string
+ key env_use_expand_hidden std::string
+ key env_aa std::string
+ key env_arch std::string
+ key env_kv std::string
+ key env_accept_keywords std::string
+ key env_distdir std::string
+ key env_portdir std::string
+
+ key description_use std::string
+
+ doxygen_comment << "END"
+ /**
+ * Information about a supported EAPI's ebuild environment variables.
+ *
+ * \see EAPIData
+ * \see EAPI
+ * \ingroup grpeapi
+ * \nosubgrouping
+ */
+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 use_expand_separator char
key support_eclasses bool
key support_exlibs bool
@@ -83,6 +126,10 @@ make_class_EAPIEbuildOptions()
key ebuild_must_not_set_variables std::string
key source_merged_variables std::string
key must_not_change_variables std::string
+ key save_variables std::string
+ key save_base_variables std::string
+ key vdb_from_env_variables std::string
+ key vdb_from_env_unless_empty_variables std::string
doxygen_comment << "END"
/**
@@ -113,6 +160,7 @@ make_class_SupportedEAPI()
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>"
+ key ebuild_environment_variables "tr1::shared_ptr<const EAPIEbuildEnvironmentVariables>"
doxygen_comment << "END"
/**
diff --git a/paludis/eapis/0.conf b/paludis/eapis/0.conf
index a19ca3e..b41c2d4 100644
--- a/paludis/eapis/0.conf
+++ b/paludis/eapis/0.conf
@@ -9,16 +9,24 @@ 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
+use_expand_separator = _
want_portage_emulation_vars = true
require_use_expand_in_iuse = false
support_eclasses = true
support_exlibs = false
utility_path_suffixes =
-ebuild_module_suffixes =
+ebuild_module_suffixes = 0
+
+vdb_from_env_variables = \
+ CATEGORY CHOST COUNTER DEPEND DESCRIPTION EAPI FEATURES \
+ HOMEPAGE INHERITED IUSE KEYWORDS LICENSE PDEPEND PF \
+ PROVIDE RDEPEND SLOT SRC_URI USE CONFIG_PROTECT CONFIG_PROTECT_MASK \
+ VDB_FORMAT PKGMANAGER
+
+vdb_from_env_unless_empty_variables = \
+ ASFLAGS CBUILD CC CFLAGS CHOST CTARGET CXX CXXFLAGS \
+ EXTRA_ECONF EXTRA_EINSTALL EXTRA_EMAKE LDFLAGS LIBCXXFLAGS \
+ REPOSITORY
non_empty_variables = \
P PV PR PN PVR PF CATEGORY FILESDIR ECLASSDIR PORTDIR \
@@ -33,9 +41,17 @@ directory_if_exists_variables = \
ebuild_must_not_set_variables =
-source_merged_variables = IUSE DEPEND RDEPEND PDEPEND KEYWORDS
+source_merged_variables = \
+ IUSE DEPEND RDEPEND PDEPEND KEYWORDS
-must_not_change_variables = SLOT
+must_not_change_variables = \
+ SLOT
+
+save_variables = \
+ USE USE_EXPAND USE_EXPAND_HIDDEN \$USE_EXPAND
+
+save_base_variables = \
+ CONFIG_PROTECT CONFIG_PROTECT_MASK
ebuild_install = \
: prepare ; \
@@ -70,19 +86,46 @@ ebuild_variable = \
ebuild_config = \
sandbox : config
+description_build_depend = Build dependencies
+description_description = Description
+description_eapi = EAPI
+description_eclass_keywords = Eclass Keywords
+description_homepage = Homepage
+description_inherited = Inherited
+description_iuse = Relevant USE flags
+description_keywords = Keywords
+description_license = License
+description_pdepend = Post dependencies
+description_provide = Provided packages
+description_restrict = Restrictions
+description_run_depend = Run dependencies
+description_slot = Slot
+description_src_uri = Source URI
+description_use = Selected USE flags
+
metadata_build_depend = DEPEND
-metadata_run_depend = RDEPEND
-metadata_slot = SLOT
-metadata_src_uri = SRC_URI
-metadata_restrict = RESTRICT
-metadata_homepage = HOMEPAGE
-metadata_license = LICENSE
metadata_description = DESCRIPTION
-metadata_keywords = KEYWORDS
+metadata_eapi = EAPI
metadata_eclass_keywords = E_KEYWORDS
+metadata_homepage = HOMEPAGE
metadata_inherited = INHERITED
metadata_iuse = IUSE
+metadata_keywords = KEYWORDS
+metadata_license = LICENSE
metadata_pdepend = PDEPEND
metadata_provide = PROVIDE
-metadata_eapi = EAPI
+metadata_restrict = RESTRICT
+metadata_run_depend = RDEPEND
+metadata_slot = SLOT
+metadata_src_uri = SRC_URI
+
+env_use = USE
+env_use_expand = USE_EXPAND
+env_use_expand_hidden = USE_EXPAND_HIDDEN
+env_aa = AA
+env_arch = ARCH
+env_kv = KV
+env_accept_keywords = ACCEPT_KEYWORDS
+env_portdir = PORTDIR
+env_distdir = DISTDIR
diff --git a/paludis/eapis/exheres-0.conf b/paludis/eapis/exheres-0.conf
index db0ffa6..f6b59d5 100644
--- a/paludis/eapis/exheres-0.conf
+++ b/paludis/eapis/exheres-0.conf
@@ -6,9 +6,6 @@ package_dep_spec_parse_mode = exheres_0
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
@@ -16,15 +13,27 @@ rdepend_defaults_to_depend = false
support_eclasses = false
support_exlibs = true
utility_path_suffixes = exheres-0
-ebuild_module_suffixes =
+ebuild_module_suffixes = exheres-0
+use_expand_separator = :
+
+vdb_from_env_variables = \
+ CATEGORY CHOST DEPENDENCIES DESCRIPTION EAPI \
+ HOMEPAGE INHERITED MYOPTIONS PLATFORMS LICENSE PF \
+ SLOT SRC_URI OPTIONS CONFIG_PROTECT CONFIG_PROTECT_MASK \
+ VDB_FORMAT PKGMANAGER
+
+vdb_from_env_unless_empty_variables = \
+ ASFLAGS CBUILD CC CFLAGS CHOST CTARGET CXX CXXFLAGS \
+ EXTRA_ECONF EXTRA_EINSTALL EXTRA_EMAKE LDFLAGS LIBCXXFLAGS \
+ REPOSITORY
non_empty_variables = \
- P PV PR PN PVR PF CATEGORY FILESDIR EXLIBSDIRS PORTDIR \
- DISTDIR PALUDIS_TMPDIR PALUDIS_EBUILD_LOG_LEVEL PALUDIS_EBUILD_DIR \
+ P PV PR PN PVR PF CATEGORY FILESDIR EXLIBSDIRS FETCHEDDIR REPODIR \
+ PALUDIS_TMPDIR PALUDIS_EBUILD_LOG_LEVEL PALUDIS_EBUILD_DIR \
PALUDIS_COMMAND ROOT
directory_variables = \
- DISTDIR
+ FETCHEDDIR REPODIR
directory_if_exists_variables = \
FILESDIR
@@ -32,11 +41,20 @@ directory_if_exists_variables = \
ebuild_must_not_set_variables = \
DEPEND RDEPEND PDEPEND PROVIDE
-ebuild_must_not_set_variables =
+ebuild_must_not_set_variables = \
+ USE IUSE KEYWORDS
+
+source_merged_variables = \
+ OPTIONS MYOPTIONS PLATFORMS
+
+must_not_change_variables = \
+ SLOT EAPI KEYWORDS
-source_merged_variables = IUSE KEYWORDS
+save_variables = \
+ OPTIONS SUBOPTIONS HIDDEN_SUBOPTIONS \$SUBOPTIONS
-must_not_change_variables = SLOT EAPI
+save_base_variables = \
+ CONFIG_PROTECT CONFIG_PROTECT_MASK
ebuild_install = \
: prepare ; \
@@ -80,12 +98,39 @@ metadata_restrict = RESTRICT
metadata_homepage = HOMEPAGE
metadata_license = LICENSE
metadata_description = DESCRIPTION
-metadata_keywords = KEYWORDS
-metadata_eclass_keywords = E_KEYWORDS
+metadata_keywords = PLATFORMS
+metadata_eclass_keywords = E_PLATFORMS
metadata_inherited = INHERITED
-metadata_iuse = IUSE
+metadata_iuse = MYOPTIONS
metadata_pdepend =
metadata_provide =
metadata_eapi = EAPI
metadata_dependencies = DEPENDENCIES
+description_build_depend =
+description_description = Description
+description_eapi = EAPI
+description_eclass_keywords = Eclass Platforms
+description_homepage = Homepage
+description_inherited = Inherited
+description_iuse = Relevant option flags
+description_keywords = Supported platforms
+description_license = License
+description_pdepend =
+description_provide =
+description_restrict = Restrictions
+description_run_depend =
+description_slot = Slot
+description_src_uri = Source URI
+description_use = Selected option flags
+
+env_use = OPTIONS
+env_use_expand = SUBOPTIONS
+env_use_expand_hidden = HIDDEN_SUBOPTIONS
+env_aa =
+env_arch =
+env_kv =
+env_accept_keywords = ACCEPT_PLATFORMS
+env_portdir = REPODIR
+env_distdir = FETCHEDDIR
+
diff --git a/paludis/eapis/paludis-1.conf b/paludis/eapis/paludis-1.conf
index e091d0a..3e23ce6 100644
--- a/paludis/eapis/paludis-1.conf
+++ b/paludis/eapis/paludis-1.conf
@@ -7,9 +7,6 @@ dependency_spec_tree_parse_mode = paludis_1
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
@@ -18,6 +15,18 @@ support_eclasses = true
support_exlibs = false
utility_path_suffixes =
ebuild_module_suffixes =
+use_expand_separator = _
+
+vdb_from_env_variables = \
+ CATEGORY CHOST COUNTER DEPEND DESCRIPTION EAPI FEATURES \
+ HOMEPAGE INHERITED IUSE KEYWORDS LICENSE PDEPEND PF \
+ PROVIDE RDEPEND SLOT SRC_URI USE CONFIG_PROTECT CONFIG_PROTECT_MASK \
+ VDB_FORMAT PKGMANAGER
+
+vdb_from_env_unless_empty_variables = \
+ ASFLAGS CBUILD CC CFLAGS CHOST CTARGET CXX CXXFLAGS \
+ EXTRA_ECONF EXTRA_EINSTALL EXTRA_EMAKE LDFLAGS LIBCXXFLAGS \
+ REPOSITORY
non_empty_variables = \
P PV PR PN PVR PF CATEGORY FILESDIR ECLASSDIR PORTDIR \
@@ -34,9 +43,17 @@ ebuild_must_not_set_variables =
ebuild_must_not_set_variables =
-source_merged_variables = IUSE DEPEND RDEPEND PDEPEND KEYWORDS
+source_merged_variables = \
+ IUSE DEPEND RDEPEND PDEPEND KEYWORDS
+
+must_not_change_variables = \
+ SLOT
-must_not_change_variables = SLOT
+save_variables = \
+ USE USE_EXPAND USE_EXPAND_HIDDEN \$USE_EXPAND
+
+save_base_variables = \
+ CONFIG_PROTECT CONFIG_PROTECT_MASK
ebuild_install = \
: prepare ; \
@@ -88,3 +105,30 @@ metadata_pdepend = PDEPEND
metadata_provide = PROVIDE
metadata_eapi = EAPI
+description_build_depend = Build dependencies
+description_description = Description
+description_eapi = EAPI
+description_eclass_keywords = Eclass Keywords
+description_homepage = Homepage
+description_inherited = Inherited
+description_iuse = Relevant use flags
+description_keywords = Keywords
+description_license = License
+description_pdepend = Post dependencies
+description_provide = Provided packages
+description_restrict = Restrictions
+description_run_depend = Run dependencies
+description_slot = Slot
+description_src_uri = Source URI
+description_use = Selected USE flags
+
+env_use = USE
+env_use_expand = USE_EXPAND
+env_use_expand_hidden = USE_EXPAND_HIDDEN
+env_aa =
+env_arch = ARCH
+env_kv =
+env_accept_keywords = ACCEPT_KEYWORDS
+env_portdir = PORTDIR
+env_distdir = DISTDIR
+
diff --git a/paludis/environments/no_config/no_config_environment.cc b/paludis/environments/no_config/no_config_environment.cc
index b7e200d..b65f7a3 100644
--- a/paludis/environments/no_config/no_config_environment.cc
+++ b/paludis/environments/no_config/no_config_environment.cc
@@ -28,6 +28,8 @@
#include <paludis/config_file.hh>
#include <paludis/distribution.hh>
#include <paludis/package_database.hh>
+#include <paludis/eapi.hh>
+#include <paludis/repositories/e/e_repository_params.hh>
#include <libwrapiter/libwrapiter_forward_iterator.hh>
#include <libwrapiter/libwrapiter_output_iterator.hh>
#include <set>
@@ -284,11 +286,23 @@ NoConfigEnvironment::accept_keywords(tr1::shared_ptr<const KeywordNameSet> keywo
if (_imp->is_vdb)
return true;
- std::string ak(_imp->main_repo->e_interface->profile_variable("ACCEPT_KEYWORDS"));
+ std::string accept_keywords_var(EAPIData::get_instance()->eapi_from_string(
+ _imp->main_repo->e_interface->params().profile_eapi)->supported->ebuild_environment_variables->env_accept_keywords);
+
+ std::string ak;
+ if (! accept_keywords_var.empty())
+ ak = _imp->main_repo->e_interface->profile_variable(accept_keywords_var);
if (ak.empty())
{
- std::string arch(_imp->main_repo->e_interface->profile_variable("ARCH"));
+ std::string arch_var(EAPIData::get_instance()->eapi_from_string(
+ _imp->main_repo->e_interface->params().profile_eapi)->supported->ebuild_environment_variables->env_arch);
+
+ if (arch_var.empty())
+ throw ConfigurationError("Don't know how to work out whether keywords are acceptable");
+
+ std::string arch(_imp->main_repo->e_interface->profile_variable(arch_var));
+
if (keywords->end() != keywords->find(KeywordName(arch)))
return true;
diff --git a/paludis/name.cc b/paludis/name.cc
index 222a2c3..3afa6ab 100644
--- a/paludis/name.cc
+++ b/paludis/name.cc
@@ -65,13 +65,16 @@ UseFlagNameValidator::validate(const std::string & s)
static const std::string allowed_chars(
"abcdefghijklmnopqrstuvwxyz"
"ABCDEFGHIJKLMNOPQRSTUVWXYZ"
- "0123456789-+_@");
+ "0123456789-+_:@");
static const std::string alphanum_chars(
"abcdefghijklmnopqrstuvwxyz"
"ABCDEFGHIJKLMNOPQRSTUVWXYZ"
"0123456789");
+ static const std::string special_chars(
+ ":_");
+
do
{
if (s.empty())
@@ -83,6 +86,20 @@ UseFlagNameValidator::validate(const std::string & s)
if (std::string::npos != s.find_first_not_of(allowed_chars))
break;
+ std::string::size_type t;
+ if (std::string::npos != ((t = s.find_first_of(special_chars))))
+ {
+ try
+ {
+ validate(s.substr(0, t));
+ validate(s.substr(t + 1));
+ }
+ catch (const UseFlagNameError & e)
+ {
+ break;
+ }
+ }
+
return;
} while (false);
diff --git a/paludis/name_TEST.cc b/paludis/name_TEST.cc
index 60d74e1..4957f84 100644
--- a/paludis/name_TEST.cc
+++ b/paludis/name_TEST.cc
@@ -1,7 +1,7 @@
/* vim: set sw=4 sts=4 et foldmethod=syntax : */
/*
- * Copyright (c) 2005, 2006 Ciaran McCreesh <ciaranm@ciaranm.org>
+ * Copyright (c) 2005, 2006, 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
@@ -288,7 +288,7 @@ namespace test_cases
void run()
{
- UseFlagName u("use0+_@-");
+ UseFlagName u("use0+_x@-x");
TEST_CHECK_THROWS(u = UseFlagName(""), NameError);
TEST_CHECK_THROWS(u = UseFlagName("!!!"), NameError);
TEST_CHECK_THROWS(u = UseFlagName("-foo"), NameError);
@@ -296,6 +296,10 @@ namespace test_cases
TEST_CHECK_THROWS(u = UseFlagName("@foo"), NameError);
TEST_CHECK_THROWS(u = UseFlagName("+foo"), NameError);
TEST_CHECK_THROWS(u = UseFlagName("fo$o"), NameError);
+
+ TEST_CHECK_THROWS(u = UseFlagName("foo:"), NameError);
+ TEST_CHECK_THROWS(u = UseFlagName(":foo"), NameError);
+ TEST_CHECK_THROWS(u = UseFlagName("foo:_"), NameError);
}
} test_use_flag_name_validation;
diff --git a/paludis/repositories/e/e_repository.cc b/paludis/repositories/e/e_repository.cc
index a980cc0..787d899 100644
--- a/paludis/repositories/e/e_repository.cc
+++ b/paludis/repositories/e/e_repository.cc
@@ -157,7 +157,7 @@ namespace paludis
profile_ptr.reset(new ERepositoryProfile(
params.environment, repo, repo->name(), *params.profiles,
- EAPIData::get_instance()->eapi_from_string(params.eapi_when_unknown)->supported->ebuild_options->want_arch_var));
+ EAPIData::get_instance()->eapi_from_string(params.eapi_when_unknown)->supported->ebuild_environment_variables->env_arch));
}
void
@@ -196,7 +196,7 @@ namespace paludis
.profile(tr1::shared_ptr<ERepositoryProfile>(new ERepositoryProfile(
params.environment, repo, repo->name(), profiles,
EAPIData::get_instance()->eapi_from_string(
- params.eapi_when_unknown)->supported->ebuild_options->want_arch_var))));
+ params.eapi_when_unknown)->supported->ebuild_environment_variables->env_arch))));
}
}
@@ -285,24 +285,25 @@ ERepository::ERepository(const ERepositoryParams & p) :
config_info->add_kv("location", stringify(_imp->params.location));
config_info->add_kv("profiles", join(_imp->params.profiles->begin(),
_imp->params.profiles->end(), " "));
- config_info->add_kv("eclassdirs", join(_imp->params.eclassdirs->begin(),
- _imp->params.eclassdirs->end(), " "));
config_info->add_kv("cache", stringify(_imp->params.cache));
config_info->add_kv("write_cache", stringify(_imp->params.write_cache));
config_info->add_kv("names_cache", stringify(_imp->params.names_cache));
config_info->add_kv("distdir", stringify(_imp->params.distdir));
+ config_info->add_kv("eclassdirs", join(_imp->params.eclassdirs->begin(),
+ _imp->params.eclassdirs->end(), " "));
config_info->add_kv("securitydir", stringify(_imp->params.securitydir));
config_info->add_kv("setsdir", stringify(_imp->params.setsdir));
config_info->add_kv("newsdir", stringify(_imp->params.newsdir));
- config_info->add_kv("format", _imp->params.entry_format);
- config_info->add_kv("layout", _imp->params.layout);
- config_info->add_kv("buildroot", stringify(_imp->params.buildroot));
config_info->add_kv("sync", _imp->params.sync);
config_info->add_kv("sync_options", _imp->params.sync_options);
- config_info->add_kv("eapi_when_unknown", _imp->params.eapi_when_unknown);
- config_info->add_kv("eapi_when_unspecified", _imp->params.eapi_when_unspecified);
+ config_info->add_kv("buildroot", stringify(_imp->params.buildroot));
if (_imp->params.master_repository)
config_info->add_kv("master_repository", stringify(_imp->params.master_repository->name()));
+ config_info->add_kv("format", _imp->params.entry_format);
+ config_info->add_kv("layout", _imp->params.layout);
+ config_info->add_kv("eapi_when_unknown", _imp->params.eapi_when_unknown);
+ config_info->add_kv("eapi_when_unspecified", _imp->params.eapi_when_unspecified);
+ config_info->add_kv("profile_eapi", _imp->params.profile_eapi);
_info->add_section(config_info);
}
@@ -749,6 +750,8 @@ ERepository::do_use_expand_flags() const
{
_imp->need_profiles();
+ std::string expand_sep(stringify(EAPIData::get_instance()->eapi_from_string(_imp->params.profile_eapi
+ )->supported->ebuild_options->use_expand_separator));
tr1::shared_ptr<UseFlagNameSet> result(new UseFlagNameSet);
for (ERepositoryProfile::UseExpandIterator i(_imp->profile_ptr->begin_use_expand()),
i_end(_imp->profile_ptr->end_use_expand()) ; i != i_end ; ++i)
@@ -759,7 +762,7 @@ ERepository::do_use_expand_flags() const
for (std::list<std::string>::const_iterator j(values.begin()), j_end(values.end()) ;
j != j_end ; ++j)
{
- std::string f(stringify(*i) + "_" + *j), lower_f;
+ std::string f(stringify(*i) + expand_sep + *j), lower_f;
std::transform(f.begin(), f.end(), std::back_inserter(lower_f), &::tolower);
result->insert(UseFlagName(lower_f));
}
@@ -886,10 +889,12 @@ ERepository::do_describe_use_flag(const UseFlagName & f,
{
if (_imp->use_desc.empty())
{
+ std::string expand_sep(stringify(EAPIData::get_instance()->eapi_from_string(
+ _imp->params.profile_eapi)->supported->ebuild_options->use_expand_separator));
tr1::shared_ptr<const FSEntrySequence> use_desc_dirs(_imp->layout->use_desc_dirs());
for (FSEntrySequence::Iterator p(use_desc_dirs->begin()), p_end(use_desc_dirs->end()) ;
p != p_end ; ++p)
- _imp->use_desc.push_back(tr1::shared_ptr<UseDesc>(new UseDesc(*p)));
+ _imp->use_desc.push_back(tr1::shared_ptr<UseDesc>(new UseDesc(*p, expand_sep)));
}
std::string result;
diff --git a/paludis/repositories/e/e_repository_params.sr b/paludis/repositories/e/e_repository_params.sr
index aefcaf0..1376d21 100644
--- a/paludis/repositories/e/e_repository_params.sr
+++ b/paludis/repositories/e/e_repository_params.sr
@@ -26,6 +26,7 @@ make_class_ERepositoryParams()
key write_bin_uri_prefix std::string
key eapi_when_unknown std::string
key eapi_when_unspecified std::string
+ key profile_eapi std::string
doxygen_comment << "END"
/**
diff --git a/paludis/repositories/e/e_repository_profile.cc b/paludis/repositories/e/e_repository_profile.cc
index 135f1fb..17ed4b0 100644
--- a/paludis/repositories/e/e_repository_profile.cc
+++ b/paludis/repositories/e/e_repository_profile.cc
@@ -32,6 +32,7 @@
#include <paludis/util/set.hh>
#include <paludis/config_file.hh>
#include <paludis/dep_tag.hh>
+#include <paludis/eapi.hh>
#include <paludis/environment.hh>
#include <paludis/match_package.hh>
#include <paludis/hashed_containers.hh>
@@ -102,7 +103,7 @@ namespace paludis
void add_use_expand_to_use();
void make_vars_from_file_vars();
- void handle_profile_arch_var();
+ void handle_profile_arch_var(const std::string &);
void load_special_make_defaults_vars();
ProfileFile packages_file;
@@ -165,24 +166,28 @@ namespace paludis
Implementation(const Environment * const e, const ERepository * const p,
const RepositoryName & name, const FSEntrySequence & dirs,
- bool arch_is_special) :
+ const std::string & arch_var_if_special) :
env(e),
repository(p),
system_packages(new ConstTreeSequence<SetSpecTree, AllDepSpec>(
tr1::shared_ptr<AllDepSpec>(new AllDepSpec))),
system_tag(new GeneralSetDepTag(SetName("system"), stringify(name)))
{
+ Context context("When loading profiles for repository '" + stringify(name) + "':");
load_environment();
for (FSEntrySequence::Iterator d(dirs.begin()), d_end(dirs.end()) ;
d != d_end ; ++d)
+ {
+ Context subcontext("When using directory '" + stringify(*d) + "':");
load_profile_directory_recursively(*d);
+ }
make_vars_from_file_vars();
load_special_make_defaults_vars();
add_use_expand_to_use();
- if (arch_is_special)
- handle_profile_arch_var();
+ if (! arch_var_if_special.empty())
+ handle_profile_arch_var(arch_var_if_special);
}
~Implementation()
@@ -317,15 +322,18 @@ Implementation<ERepositoryProfile>::load_profile_make_defaults(const FSEntry & d
stringify(k->first) + "' is now '" + stringify(environment_variables[k->first]) + "'");
}
+ std::string use_expand_var(EAPIData::get_instance()->eapi_from_string(
+ repository->params().profile_eapi)->supported->ebuild_environment_variables->env_use_expand);
try
{
use_expand.clear();
- WhitespaceTokeniser::get_instance()->tokenise(environment_variables["USE_EXPAND"],
- create_inserter<UseFlagName>(std::inserter(use_expand, use_expand.end())));
+ if (! use_expand_var.empty())
+ WhitespaceTokeniser::get_instance()->tokenise(environment_variables[use_expand_var],
+ create_inserter<UseFlagName>(std::inserter(use_expand, use_expand.end())));
}
catch (const Exception & e)
{
- Log::get_instance()->message(ll_warning, lc_context, "Loading USE_EXPAND failed due to exception: "
+ Log::get_instance()->message(ll_warning, lc_context, "Loading '" + use_expand_var + "' failed due to exception: "
+ e.message() + " (" + e.what() + ")");
}
}
@@ -333,38 +341,48 @@ Implementation<ERepositoryProfile>::load_profile_make_defaults(const FSEntry & d
void
Implementation<ERepositoryProfile>::load_special_make_defaults_vars()
{
+ std::string use_var(EAPIData::get_instance()->eapi_from_string(
+ repository->params().profile_eapi)->supported->ebuild_environment_variables->env_use);
try
{
use.clear();
- WhitespaceTokeniser::get_instance()->tokenise(environment_variables["USE"],
- create_inserter<UseFlagName>(std::inserter(use, use.end())));
+ if (! use_var.empty())
+ WhitespaceTokeniser::get_instance()->tokenise(environment_variables[use_var],
+ create_inserter<UseFlagName>(std::inserter(use, use.end())));
}
catch (const Exception & e)
{
- Log::get_instance()->message(ll_warning, lc_context, "Loading USE failed due to exception: "
+ Log::get_instance()->message(ll_warning, lc_context, "Loading '" + use_var + "' failed due to exception: "
+ e.message() + " (" + e.what() + ")");
}
+ std::string use_expand_var(EAPIData::get_instance()->eapi_from_string(
+ repository->params().profile_eapi)->supported->ebuild_environment_variables->env_use_expand);
try
{
use_expand.clear();
- WhitespaceTokeniser::get_instance()->tokenise(environment_variables["USE_EXPAND"],
- create_inserter<UseFlagName>(std::inserter(use_expand, use_expand.end())));
+ if (! use_expand_var.empty())
+ WhitespaceTokeniser::get_instance()->tokenise(environment_variables[use_expand_var],
+ create_inserter<UseFlagName>(std::inserter(use_expand, use_expand.end())));
}
catch (const Exception & e)
{
- Log::get_instance()->message(ll_warning, lc_context, "Loading USE_EXPAND failed due to exception: "
+ Log::get_instance()->message(ll_warning, lc_context, "Loading '" + use_expand_var + "' failed due to exception: "
+ e.message() + " (" + e.what() + ")");
}
+
+ std::string use_expand_hidden_var(EAPIData::get_instance()->eapi_from_string(
+ repository->params().profile_eapi)->supported->ebuild_environment_variables->env_use_expand_hidden);
try
{
use_expand_hidden.clear();
- WhitespaceTokeniser::get_instance()->tokenise(environment_variables["USE_EXPAND_HIDDEN"],
- create_inserter<UseFlagName>(std::inserter(use_expand_hidden, use_expand_hidden.end())));
+ if (! use_expand_hidden_var.empty())
+ WhitespaceTokeniser::get_instance()->tokenise(environment_variables[use_expand_hidden_var],
+ create_inserter<UseFlagName>(std::inserter(use_expand_hidden, use_expand_hidden.end())));
}
catch (const Exception & e)
{
- Log::get_instance()->message(ll_warning, lc_context, "Loading USE_EXPAND_HIDDEN failed due to exception: "
+ Log::get_instance()->message(ll_warning, lc_context, "Loading '" + use_expand_hidden_var + "' failed due to exception: "
+ e.message() + " (" + e.what() + ")");
}
}
@@ -372,16 +390,31 @@ Implementation<ERepositoryProfile>::load_special_make_defaults_vars()
bool
Implementation<ERepositoryProfile>::is_incremental(const std::string & s) const
{
+ tr1::shared_ptr<const EAPI> e(EAPIData::get_instance()->eapi_from_string(repository->params().profile_eapi));
+
try
{
- return (s == "USE") || (s == "USE_EXPAND") || (s == "USE_EXPAND_HIDDEN")
- || (s == "CONFIG_PROTECT") || (s == "CONFIG_PROTECT_MASK")
- || (use_expand.end() != use_expand.find(UseFlagName(s)));
+ Context c("When checking whether '" + s + "' is incremental:");
+
+ return (! s.empty()) &&
+ (s == e->supported->ebuild_environment_variables->env_use
+ || s == e->supported->ebuild_environment_variables->env_use_expand
+ || s == e->supported->ebuild_environment_variables->env_use_expand_hidden
+ || s == "CONFIG_PROTECT"
+ || s == "CONFIG_PROTECT_MASK"
+ || use_expand.end() != use_expand.find(UseFlagName(s)));
}
- catch (const Exception &)
+ catch (const Exception & x)
{
- return (s == "USE") || (s == "USE_EXPAND") || (s == "USE_EXPAND_HIDDEN")
- || (s == "CONFIG_PROTECT") || (s == "CONFIG_PROTECT_MASK");
+ Log::get_instance()->message(ll_qa, lc_context) << "Caught exception '" << x.message() << "' (" << x.what()
+ << "), possibly due to weird variable name being used in profile";
+
+ return (! s.empty()) &&
+ (s == e->supported->ebuild_environment_variables->env_use
+ || s == e->supported->ebuild_environment_variables->env_use_expand
+ || s == e->supported->ebuild_environment_variables->env_use_expand_hidden
+ || s == "CONFIG_PROTECT"
+ || s == "CONFIG_PROTECT_MASK");
}
}
@@ -547,6 +580,9 @@ Implementation<ERepositoryProfile>::add_use_expand_to_use()
stacked_values_list.push_back(StackedValues("use_expand special values"));
+ std::string expand_sep(stringify(EAPIData::get_instance()->eapi_from_string(
+ repository->params().profile_eapi)->supported->ebuild_options->use_expand_separator));
+
for (UseFlagSet::const_iterator x(use_expand.begin()), x_end(use_expand.end()) ;
x != x_end ; ++x)
{
@@ -559,18 +595,18 @@ Implementation<ERepositoryProfile>::add_use_expand_to_use()
std::back_inserter(uses));
for (std::list<std::string>::const_iterator u(uses.begin()), u_end(uses.end()) ;
u != u_end ; ++u)
- use.insert(UseFlagName(lower_x + "_" + *u));
+ use.insert(UseFlagName(lower_x + expand_sep + *u));
}
}
void
-Implementation<ERepositoryProfile>::handle_profile_arch_var()
+Implementation<ERepositoryProfile>::handle_profile_arch_var(const std::string & s)
{
- Context context("When handling profile ARCH variable:");
+ Context context("When handling profile " + s + " variable:");
- std::string arch_s(environment_variables["ARCH"]);
+ std::string arch_s(environment_variables[s]);
if (arch_s.empty())
- throw ERepositoryConfigurationError("ARCH variable is unset or empty");
+ throw ERepositoryConfigurationError("Variable '" + s + "' is unset or empty");
stacked_values_list.push_back(StackedValues("arch special values"));
try
@@ -582,16 +618,16 @@ Implementation<ERepositoryProfile>::handle_profile_arch_var()
}
catch (const Exception &)
{
- throw ERepositoryConfigurationError("ARCH variable has invalid value '" + arch_s + "'");
+ throw ERepositoryConfigurationError("Variable '" + s + "' has invalid value '" + arch_s + "'");
}
}
ERepositoryProfile::ERepositoryProfile(
const Environment * const env, const ERepository * const p, const RepositoryName & name,
const FSEntrySequence & location,
- bool arch_is_special) :
+ const std::string & arch_var_if_special) :
PrivateImplementationPattern<ERepositoryProfile>(
- new Implementation<ERepositoryProfile>(env, p, name, location, arch_is_special))
+ new Implementation<ERepositoryProfile>(env, p, name, location, arch_var_if_special))
{
}
diff --git a/paludis/repositories/e/e_repository_profile.hh b/paludis/repositories/e/e_repository_profile.hh
index fa69b6b..a27bdd5 100644
--- a/paludis/repositories/e/e_repository_profile.hh
+++ b/paludis/repositories/e/e_repository_profile.hh
@@ -61,7 +61,7 @@ namespace paludis
const ERepository * const,
const RepositoryName & name,
const FSEntrySequence & location,
- bool arch_is_special);
+ const std::string & arch_var_if_special);
~ERepositoryProfile();
///\}
diff --git a/paludis/repositories/e/ebuild.cc b/paludis/repositories/e/ebuild.cc
index d8505ab..a0dc586 100644
--- a/paludis/repositories/e/ebuild.cc
+++ b/paludis/repositories/e/ebuild.cc
@@ -107,8 +107,6 @@ EbuildCommand::operator() ()
.with_setenv("CATEGORY", stringify(params.package_id->name().category))
.with_setenv("REPOSITORY", stringify(params.package_id->repository()->name()))
.with_setenv("FILESDIR", stringify(params.files_dir))
- .with_setenv("PORTDIR", stringify(params.portdir))
- .with_setenv("DISTDIR", stringify(params.distdir))
.with_setenv("EAPI", stringify(params.package_id->eapi()->name))
.with_setenv("SLOT", "")
.with_setenv("PKGMANAGER", PALUDIS_PACKAGE "-" + stringify(PALUDIS_VERSION_MAJOR) + "." +
@@ -137,6 +135,10 @@ EbuildCommand::operator() ()
params.package_id->eapi()->supported->ebuild_options->directory_variables)
.with_setenv("PALUDIS_EBUILD_MUST_NOT_SET_VARIABLES",
params.package_id->eapi()->supported->ebuild_options->ebuild_must_not_set_variables)
+ .with_setenv("PALUDIS_SAVE_VARIABLES",
+ params.package_id->eapi()->supported->ebuild_options->save_variables)
+ .with_setenv("PALUDIS_SAVE_BASE_VARIABLES",
+ params.package_id->eapi()->supported->ebuild_options->save_base_variables)
.with_setenv("PALUDIS_DIRECTORY_IF_EXISTS_VARIABLES",
params.package_id->eapi()->supported->ebuild_options->directory_if_exists_variables)
.with_setenv("PALUDIS_SOURCE_MERGED_VARIABLES",
@@ -147,8 +149,12 @@ EbuildCommand::operator() ()
params.package_id->eapi()->supported->ebuild_options->rdepend_defaults_to_depend ? "yes" : "")
);
- if (params.package_id->eapi()->supported->ebuild_options->want_kv_var)
- cmd.with_setenv("KV", kernel_version());
+ if (! params.package_id->eapi()->supported->ebuild_environment_variables->env_kv.empty())
+ cmd.with_setenv(params.package_id->eapi()->supported->ebuild_environment_variables->env_kv, kernel_version());
+ if (! params.package_id->eapi()->supported->ebuild_environment_variables->env_portdir.empty())
+ cmd.with_setenv(params.package_id->eapi()->supported->ebuild_environment_variables->env_portdir, stringify(params.portdir));
+ if (! params.package_id->eapi()->supported->ebuild_environment_variables->env_distdir.empty())
+ cmd.with_setenv(params.package_id->eapi()->supported->ebuild_environment_variables->env_distdir, stringify(params.distdir));
if (params.package_id->eapi()->supported->ebuild_options->support_eclasses)
cmd
@@ -318,16 +324,16 @@ EbuildMetadataCommand::load(const tr1::shared_ptr<const EbuildID> & id)
const EAPIEbuildMetadataVariables & m(*id->eapi()->supported->ebuild_metadata_variables);
if (! m.metadata_description.empty())
- id->load_short_description(m.metadata_description, "Description", get(keys, m.metadata_description));
+ id->load_short_description(m.metadata_description, m.description_description, get(keys, m.metadata_description));
if (! m.metadata_build_depend.empty())
- id->load_build_depend(m.metadata_build_depend, "Build depend", get(keys, m.metadata_build_depend));
+ id->load_build_depend(m.metadata_build_depend, m.description_build_depend, get(keys, m.metadata_build_depend));
if (! m.metadata_run_depend.empty())
- id->load_run_depend(m.metadata_run_depend, "Run depend", get(keys, m.metadata_run_depend));
+ id->load_run_depend(m.metadata_run_depend, m.description_run_depend, get(keys, m.metadata_run_depend));
if (! m.metadata_pdepend.empty())
- id->load_post_depend(m.metadata_pdepend, "Post depend", get(keys, m.metadata_pdepend));
+ id->load_post_depend(m.metadata_pdepend, m.description_pdepend, get(keys, m.metadata_pdepend));
if (! m.metadata_slot.empty())
{
@@ -351,28 +357,28 @@ EbuildMetadataCommand::load(const tr1::shared_ptr<const EbuildID> & id)
}
if (! m.metadata_src_uri.empty())
- id->load_src_uri(m.metadata_src_uri, "Source URI", get(keys, m.metadata_src_uri));
+ id->load_src_uri(m.metadata_src_uri, m.description_src_uri, get(keys, m.metadata_src_uri));
if (! m.metadata_homepage.empty())
- id->load_homepage(m.metadata_homepage, "Homepage", get(keys, m.metadata_homepage));
+ id->load_homepage(m.metadata_homepage, m.description_homepage, get(keys, m.metadata_homepage));
if (! m.metadata_license.empty())
- id->load_license(m.metadata_license, "License", get(keys, m.metadata_license));
+ id->load_license(m.metadata_license, m.description_license, get(keys, m.metadata_license));
if (! m.metadata_provide.empty())
- id->load_provide(m.metadata_provide, "Provides", get(keys, m.metadata_provide));
+ id->load_provide(m.metadata_provide, m.description_provide, get(keys, m.metadata_provide));
if (! m.metadata_iuse.empty())
- id->load_iuse(m.metadata_iuse, "Used USE flags", get(keys, m.metadata_iuse));
+ id->load_iuse(m.metadata_iuse, m.description_iuse, get(keys, m.metadata_iuse));
if (! m.metadata_inherited.empty())
- id->load_inherited(m.metadata_inherited, "Inherited", get(keys, m.metadata_inherited));
+ id->load_inherited(m.metadata_inherited, m.description_inherited, get(keys, m.metadata_inherited));
if (! m.metadata_keywords.empty())
- id->load_keywords(m.metadata_keywords, "Keywords", get(keys, m.metadata_keywords));
+ id->load_keywords(m.metadata_keywords, m.description_keywords, get(keys, m.metadata_keywords));
if (! m.metadata_restrict.empty())
- id->load_restrict(m.metadata_restrict, "Restrictions", get(keys, m.metadata_restrict));
+ id->load_restrict(m.metadata_restrict, m.description_restrict, get(keys, m.metadata_restrict));
}
EbuildVariableCommand::EbuildVariableCommand(const EbuildCommandParams & p,
@@ -430,9 +436,6 @@ EbuildFetchCommand::extend_command(const Command & cmd)
{
Command result(Command(cmd)
.with_setenv("A", fetch_params.a)
- .with_setenv("AA", fetch_params.aa)
- .with_setenv("USE", fetch_params.use)
- .with_setenv("USE_EXPAND", fetch_params.use_expand)
.with_setenv("FLAT_SRC_URI", fetch_params.flat_src_uri)
.with_setenv("ROOT", fetch_params.root)
.with_setenv("PALUDIS_USE_SAFE_RESUME", fetch_params.safe_resume ? "oohyesplease" : "")
@@ -440,6 +443,13 @@ EbuildFetchCommand::extend_command(const Command & cmd)
.with_setenv("PALUDIS_PROFILE_DIRS", join(fetch_params.profiles->begin(),
fetch_params.profiles->end(), " ")));
+ if (! params.package_id->eapi()->supported->ebuild_environment_variables->env_aa.empty())
+ result.with_setenv(params.package_id->eapi()->supported->ebuild_environment_variables->env_aa, fetch_params.aa);
+ if (! params.package_id->eapi()->supported->ebuild_environment_variables->env_use.empty())
+ result.with_setenv(params.package_id->eapi()->supported->ebuild_environment_variables->env_use, fetch_params.use);
+ if (! params.package_id->eapi()->supported->ebuild_environment_variables->env_use_expand.empty())
+ result.with_setenv(params.package_id->eapi()->supported->ebuild_environment_variables->env_use_expand, fetch_params.use_expand);
+
for (Map<std::string, std::string>::Iterator
i(fetch_params.expand_vars->begin()),
j(fetch_params.expand_vars->end()) ; i != j ; ++i)
@@ -494,9 +504,6 @@ EbuildInstallCommand::extend_command(const Command & cmd)
Command result(Command(cmd)
.with_setenv("A", install_params.a)
- .with_setenv("AA", install_params.aa)
- .with_setenv("USE", install_params.use)
- .with_setenv("USE_EXPAND", install_params.use_expand)
.with_setenv("ROOT", install_params.root)
.with_setenv("PALUDIS_LOADSAVEENV_DIR", stringify(install_params.loadsaveenv_dir))
.with_setenv("PALUDIS_CONFIG_PROTECT", install_params.config_protect)
@@ -509,6 +516,13 @@ EbuildInstallCommand::extend_command(const Command & cmd)
install_params.profiles->end(), " "))
.with_setenv("SLOT", stringify(install_params.slot)));
+ if (! params.package_id->eapi()->supported->ebuild_environment_variables->env_aa.empty())
+ result.with_setenv(params.package_id->eapi()->supported->ebuild_environment_variables->env_aa, install_params.aa);
+ if (! params.package_id->eapi()->supported->ebuild_environment_variables->env_use.empty())
+ result.with_setenv(params.package_id->eapi()->supported->ebuild_environment_variables->env_use, install_params.use);
+ if (! params.package_id->eapi()->supported->ebuild_environment_variables->env_use_expand.empty())
+ result.with_setenv(params.package_id->eapi()->supported->ebuild_environment_variables->env_use_expand, install_params.use_expand);
+
for (Map<std::string, std::string>::Iterator
i(install_params.expand_vars->begin()),
j(install_params.expand_vars->end()) ; i != j ; ++i)
@@ -631,7 +645,12 @@ WriteVDBEntryCommand::operator() ()
.with_setenv("PALUDIS_SYNCERS_DIRS", join(syncers_dirs->begin(), syncers_dirs->end(), " "))
.with_setenv("PALUDIS_COMMAND", params.environment->paludis_command())
.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_VDB_FROM_ENV_VARIABLES",
+ params.package_id->eapi()->supported->ebuild_options->vdb_from_env_variables)
+ .with_setenv("PALUDIS_VDB_FROM_ENV_UNLESS_EMPTY_VARIABLES",
+ params.package_id->eapi()->supported->ebuild_options->vdb_from_env_unless_empty_variables)
+ );
if (0 != (run_command(cmd)))
throw PackageInstallActionError("Write VDB Entry command failed");
@@ -681,13 +700,16 @@ EbuildPretendCommand::extend_command(const Command & cmd)
stringify(params.package_id->version()) + "> ")
.with_prefix_discard_blank_output()
.with_prefix_blank_lines()
- .with_setenv("USE", pretend_params.use)
- .with_setenv("USE_EXPAND", pretend_params.use_expand)
.with_setenv("ROOT", pretend_params.root)
.with_setenv("PALUDIS_PROFILE_DIR", stringify(*pretend_params.profiles->begin()))
.with_setenv("PALUDIS_PROFILE_DIRS", join(pretend_params.profiles->begin(),
pretend_params.profiles->end(), " ")));
+ if (! params.package_id->eapi()->supported->ebuild_environment_variables->env_use.empty())
+ result.with_setenv(params.package_id->eapi()->supported->ebuild_environment_variables->env_use, pretend_params.use);
+ if (! params.package_id->eapi()->supported->ebuild_environment_variables->env_use_expand.empty())
+ result.with_setenv(params.package_id->eapi()->supported->ebuild_environment_variables->env_use_expand, pretend_params.use_expand);
+
for (Map<std::string, std::string>::Iterator
i(pretend_params.expand_vars->begin()),
j(pretend_params.expand_vars->end()) ; i != j ; ++i)
diff --git a/paludis/repositories/e/ebuild/0/Makefile.am b/paludis/repositories/e/ebuild/0/Makefile.am
new file mode 100644
index 0000000..676e4ce
--- /dev/null
+++ b/paludis/repositories/e/ebuild/0/Makefile.am
@@ -0,0 +1,26 @@
+MAINTAINERCLEANFILES = Makefile.in
+CLEANFILES = *~
+SUBDIRS = .
+
+libexecprogdir = $(libexecdir)/paludis/
+
+libexecprog_SCRIPTS =
+
+TESTS_ENVIRONMENT = env \
+ PALUDIS_EBUILD_DIR="$(top_srcdir)/paludis/repositories/e/ebuild/" \
+ PALUDIS_EAPIS_DIR="$(top_srcdir)/paludis/eapis/" \
+ PALUDIS_DISTRIBUTIONS_DIR="$(top_srcdir)/paludis/distributions/" \
+ PALUDIS_EBUILD_LOG_LEVEL="warning" \
+ TOP_BUILD_DIR="`$(top_srcdir)/paludis/repositories/e/ebuild/utils/canonicalise $(top_builddir)/`" \
+ TEST_SCRIPT_DIR="$(srcdir)/" \
+ bash $(top_srcdir)/test/run_test.sh $(top_srcdir)/paludis/repositories/e/ebuild/run_test.bash
+
+TESTS =
+check_SCRIPTS = $(TESTS)
+
+EXTRA_DIST = $(libexecprog_SCRIPTS)
+
+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/e/ebuild/Makefile.am b/paludis/repositories/e/ebuild/Makefile.am
index cb4bbd9..3e21082 100644
--- a/paludis/repositories/e/ebuild/Makefile.am
+++ b/paludis/repositories/e/ebuild/Makefile.am
@@ -1,6 +1,6 @@
MAINTAINERCLEANFILES = Makefile.in
CLEANFILES = *~
-SUBDIRS = . digests utils
+SUBDIRS = . 0 exheres-0 digests utils
AM_CXXFLAGS = -I$(top_srcdir) @PALUDIS_CXXFLAGS@
diff --git a/paludis/repositories/e/ebuild/builtin_metadata.bash b/paludis/repositories/e/ebuild/builtin_metadata.bash
index 36d181b..72ac38d 100644
--- a/paludis/repositories/e/ebuild/builtin_metadata.bash
+++ b/paludis/repositories/e/ebuild/builtin_metadata.bash
@@ -25,7 +25,7 @@ ebuild_f_metadata()
local key
for a in ${PALUDIS_EBUILD_MUST_NOT_SET_VARIABLES} ; do
- [[ -z "${!a}" ]] || die "\$${a} must not be set"
+ [[ "${!a-unset}" == "unset" ]] || die "\$${a} must not be set"
done
for key in ${EBUILD_METADATA_VARIABLES} ; do
diff --git a/paludis/repositories/e/ebuild/ebuild.bash b/paludis/repositories/e/ebuild/ebuild.bash
index 44829d3..8bbd370 100755
--- a/paludis/repositories/e/ebuild/ebuild.bash
+++ b/paludis/repositories/e/ebuild/ebuild.bash
@@ -28,7 +28,8 @@ eval unset LANG ${!LC_*}
# The list below should include all variables from all EAPIs
EBUILD_METADATA_VARIABLES="DEPEND RDEPEND PDEPEND IUSE SRC_URI RESTRICT \
LICENSE KEYWORDS INHERITED PROVIDE HOMEPAGE DESCRIPTION DEPENDENCIES \
- E_IUSE E_DEPEND E_RDEPEND E_PDEPEND E_KEYWORDS"
+ E_IUSE E_DEPEND E_RDEPEND E_PDEPEND E_KEYWORDS PLATFORMS E_PLATFORMS \
+ MYOPTIONS E_MYOPTIONS"
unset -v ${EBUILD_METADATA_VARIABLES}
# These can be set by C++
EBUILD_METADATA_VARIABLES="${EBUILD_METADATA_VARIABLES} SLOT EAPI"
@@ -128,8 +129,8 @@ ebuild_source_profile()
export CONFIG_PROTECT="${PALUDIS_CONFIG_PROTECT}"
export CONFIG_PROTECT_MASK="${PALUDIS_CONFIG_PROTECT_MASK}"
-save_vars="USE USE_EXPAND USE_EXPAND_HIDDEN ${USE_EXPAND}"
-save_base_vars="CONFIG_PROTECT CONFIG_PROTECT_MASK"
+save_vars="$(eval echo ${PALUDIS_SAVE_VARIABLES} )"
+save_base_vars="$(eval echo ${PALUDIS_SAVE_BASE_VARIABLES} )"
for var in ${save_vars} ${default_save_vars} ${save_base_vars} ; do
ebuild_notice "debug" "Saving ${var}=${!var}"
@@ -198,6 +199,7 @@ ebuild_scrub_environment()
unset -v PORTDIR FILESDIR ECLASSDIR DISTDIR PALUDIS_EBUILD_DIR
unset -v PALUDIS_EXTRA_DIE_MESSAGE PALUDIS_COMMAND PALUDIS_CLIENT
unset -v PALUDIS_LOADSAVEENV_DIR SKIP_FUNCTIONS PALUDIS_DO_NOTHING_SANDBOXY
+ unset -v FETCHEDDIR REPODIR
unset -v ${!PALUDIS_CMDLINE_*} PALUDIS_OPTIONS
unset -v ${!CONTRARIUS_CMDLINE_*} CONTRARIUS_OPTIONS
diff --git a/paludis/repositories/e/ebuild/exheres-0/Makefile.am b/paludis/repositories/e/ebuild/exheres-0/Makefile.am
new file mode 100644
index 0000000..520e768
--- /dev/null
+++ b/paludis/repositories/e/ebuild/exheres-0/Makefile.am
@@ -0,0 +1,27 @@
+MAINTAINERCLEANFILES = Makefile.in
+CLEANFILES = *~
+SUBDIRS = .
+
+libexecprogdir = $(libexecdir)/paludis/
+
+libexecprog_SCRIPTS = \
+ builtin_fetch.bash \
+ pkg_nofetch.bash
+
+TESTS_ENVIRONMENT = env \
+ PALUDIS_EBUILD_DIR="$(top_srcdir)/paludis/repositories/e/ebuild/" \
+ PALUDIS_EAPIS_DIR="$(top_srcdir)/paludis/eapis/" \
+ PALUDIS_DISTRIBUTIONS_DIR="$(top_srcdir)/paludis/distributions/" \
+ PALUDIS_EBUILD_LOG_LEVEL="warning" \
+ TOP_BUILD_DIR="`$(top_srcdir)/paludis/repositories/e/ebuild/utils/canonicalise $(top_builddir)/`" \
+ TEST_SCRIPT_DIR="$(srcdir)/" \
+ bash $(top_srcdir)/test/run_test.sh $(top_srcdir)/paludis/repositories/e/ebuild/run_test.bash
+
+TESTS =
+check_SCRIPTS = $(TESTS)
+
+EXTRA_DIST = $(libexecprog_SCRIPTS)
+
+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/e/ebuild/exheres-0/builtin_fetch.bash b/paludis/repositories/e/ebuild/exheres-0/builtin_fetch.bash
new file mode 100644
index 0000000..f1c9c53
--- /dev/null
+++ b/paludis/repositories/e/ebuild/exheres-0/builtin_fetch.bash
@@ -0,0 +1,138 @@
+#!/bin/bash
+# vim: set sw=4 sts=4 et :
+
+# Copyright (c) 2006, 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, version 2, as published by the Free Software Foundation.
+#
+# 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
+
+builtin_fetch()
+{
+ [[ -d "${FETCHEDDIR}" ]] || die "FETCHEDDIR \"${FETCHEDDIR}\" is not a directory"
+
+ local a nofetch unique_aa old_aa
+ for a in ${FLAT_SRC_URI} ; do
+ local aa=${a##*/}
+ hasq "${aa}" ${unique_aa} || unique_aa="${unique_aa} ${aa}"
+
+ if [[ -f "${FETCHEDDIR}/${aa}" ]] && [[ "0" != $(getfsize "${FETCHEDDIR}/${aa}") ]] ; then
+ if [[ "${old_aa}" != "${aa}" ]] ; then
+ ebuild_section "Already have ${aa}"
+ old_aa="${aa}"
+ fi
+ else
+ if [[ -f "${FETCHEDDIR}/${aa}" ]] ; then
+ ebuild_section "Trying to remove existing ${aa}..."
+ rm -f "${FETCHEDDIR}/${aa}"
+ fi
+
+ if ! hasq fetch ${RESTRICT} ; then
+ if [[ "${old_aa}" != "${aa}" ]] ; then
+ ebuild_section "Need to fetch ${aa}"
+ old_aa="${aa}"
+ fi
+ local d
+ for d in ${PALUDIS_FETCHERS_DIRS:-${PALUDIS_EBUILD_DIR}/fetchers/} ; do
+ prg=${d}/do$(echo ${a%%://*} | tr '[:upper:]' '[:lower:]' )
+ ebuild_notice "debug" "fetcher program candidate for '${a}' is '${prg}'"
+ [[ -x "${prg}" ]] && break
+ done
+ if [[ -x "${prg}" ]] ; then
+ ${prg} "${a}" "${FETCHEDDIR}/${aa}"
+ else
+ eerror "Don't know how to fetch '${a}'"
+ fi
+ else
+ if ! [[ "${old_aa}" != "${aa}" ]] ; then
+ ebuild_section "Can't fetch ${aa}"
+ old_aa="${aa}"
+ fi
+ fi
+ fi
+ done
+
+ for a in ${unique_aa} ; do
+ [[ -f ${FETCHEDDIR}/${a} ]] || nofetch="${nofetch} ${a}"
+ done
+
+ if [[ -n "${nofetch}" ]] ; then
+ local c
+ echo
+ eerror "Couldn't fetch the following components:"
+ for c in ${nofetch} ; do
+ eerror " * ${c}"
+ done
+ echo
+ die "builtin_fetch failed"
+ fi
+
+ local badfetch=
+ if [[ -f "${FILESDIR}/digest-${PN}-${PVR%-r0}" ]] ; then
+ local line items prg
+ while read line ; do
+ line=( ${line} )
+ if ! hasq "${line[2]}" ${A} ; then
+ ebuild_section "Skipping check for ${line[2]}"
+ continue
+ fi
+
+ prg="${PALUDIS_EBUILD_DIR}/digests/do$(echo ${line[0]} | tr \
+ '[[:upper:]]' '[[:lower:]]')"
+ if [[ -x "${prg}" ]] ; then
+ ebegin_unhooked "Checking ${line[0]} for ${line[2]}"
+ if [[ $("${prg}" "${FETCHEDDIR}/${line[2]}" ) == "${line[1]}" ]] ; then
+ eend 0
+ else
+ eend 1
+ hasq "${line[2]}" ${badfetch} || badfetch="${badfetch} ${line[2]}"
+ fi
+ else
+ einfo_unhooked "Can't check ${line[0]} for ${line[2]}"
+ fi
+
+ done < "${FILESDIR}"/digest-${PN}-${PVR%-r0}
+ else
+ ebuild_section "No digest file, skipping integrity checks"
+ fi
+
+ if [[ -n "${badfetch}" ]] ; then
+ local c
+ echo
+ eerror "Bad digests encountered for the following components:"
+ for c in ${badfetch} ; do
+ eerror " * ${c}"
+ done
+ echo
+ die "builtin_fetch failed"
+ fi
+}
+
+ebuild_f_fetch()
+{
+ local old_sandbox_write="${SANDBOX_WRITE}"
+ [[ -z "${PALUDIS_DO_NOTHING_SANDBOXY}" ]] && SANDBOX_WRITE="${SANDBOX_WRITE+${SANDBOX_WRITE}:}${FETCHEDDIR}"
+ if hasq "fetch" ${RESTRICT} ; then
+ ebuild_section "Skipping builtin_fetch (RESTRICT)"
+ elif hasq "fetch" ${SKIP_FUNCTIONS} ; then
+ ebuild_section "Skipping builtin_fetch (SKIP_FUNCTIONS)"
+ else
+ ebuild_section "Starting builtin_fetch"
+ builtin_fetch
+ ebuild_section "Done builtin_fetch"
+ fi
+ [[ -z "${PALUDIS_DO_NOTHING_SANDBOXY}" ]] && SANDBOX_WRITE="${old_sandbox_write}"
+ true
+}
+
+
+
diff --git a/paludis/repositories/e/ebuild/exheres-0/pkg_nofetch.bash b/paludis/repositories/e/ebuild/exheres-0/pkg_nofetch.bash
new file mode 100644
index 0000000..180f8c2
--- /dev/null
+++ b/paludis/repositories/e/ebuild/exheres-0/pkg_nofetch.bash
@@ -0,0 +1,62 @@
+#!/bin/bash
+# vim: set sw=4 sts=4 et :
+
+# Copyright (c) 2006, 2007 Ciaran McCreesh <ciaranm@ciaranm.org>
+#
+# Based in part upon ebuild.sh from Portage, which is Copyright 1995-2005
+# Gentoo Foundation and distributed under the terms of the GNU General
+# Public License v2.
+#
+# 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, version 2, as published by the Free Software Foundation.
+#
+# 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
+
+pkg_nofetch()
+{
+ [[ -z "${A}" ]] && return
+
+ local f g=
+ for f in ${A} ; do
+ [[ -f "${FETCHEDDIR}/${A}" ]] && continue
+ if [[ -z "${g}" ]] ; then
+ echo "The following files could not be fetched automatically for ${PN}:"
+ g=no
+ fi
+ echo "* ${f}"
+ done
+}
+
+ebuild_f_nofetch()
+{
+ local old_sandbox_write="${SANDBOX_WRITE}"
+ [[ -z "${PALUDIS_DO_NOTHING_SANDBOXY}" ]] && SANDBOX_WRITE="${SANDBOX_WRITE+${SANDBOX_WRITE}:}${FETCHEDDIR}"
+ if hasq "nofetch" ${SKIP_FUNCTIONS} ; then
+ ebuild_section "Skipping pkg_nofetch (SKIP_FUNCTIONS)"
+ else
+ local a f=
+ for a in ${A} ; do
+ [[ -f "${FETCHEDDIR}/${a}" ]] && continue
+ f=yes
+ done
+
+ if [[ -z "${f}" ]] ; then
+ ebuild_section "Skipping pkg_nofetch (fully fetched already)"
+ else
+ ebuild_section "Starting pkg_nofetch"
+ pkg_nofetch
+ ebuild_section "Done pkg_nofetch"
+ die "Manual fetching is required"
+ fi
+ fi
+ [[ -z "${PALUDIS_DO_NOTHING_SANDBOXY}" ]] && SANDBOX_WRITE="${old_sandbox_write}"
+ true
+}
diff --git a/paludis/repositories/e/ebuild/utils/exheres-0/Makefile.am b/paludis/repositories/e/ebuild/utils/exheres-0/Makefile.am
index f0f99f4..7e5db94 100644
--- a/paludis/repositories/e/ebuild/utils/exheres-0/Makefile.am
+++ b/paludis/repositories/e/ebuild/utils/exheres-0/Makefile.am
@@ -16,6 +16,7 @@ libexecprog_SCRIPTS = \
prepinfo \
prepdocs \
prepalldocs \
+ dounpack \
banned_in_eapi_exheres-0
AM_CXXFLAGS = -I$(top_srcdir) @PALUDIS_CXXFLAGS@
diff --git a/paludis/repositories/e/ebuild/utils/exheres-0/dounpack b/paludis/repositories/e/ebuild/utils/exheres-0/dounpack
new file mode 100755
index 0000000..6ca7817
--- /dev/null
+++ b/paludis/repositories/e/ebuild/utils/exheres-0/dounpack
@@ -0,0 +1,132 @@
+#!/bin/bash
+# vim: set sw=4 sts=4 et :
+
+# Copyright (c) 2006, 2007 Ciaran McCreesh <ciaranm@ciaranm.org>
+#
+# Based in part upon ebuild.sh from Portage, which is Copyright 1995-2005
+# Gentoo Foundation and distributed under the terms of the GNU General
+# Public License v2.
+#
+# 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
+
+die()
+{
+ echo "dounpack: error: $@" 1>&2
+ exit 123
+}
+
+unpack_one()
+{
+ [[ -z "$1" ]] && die "Bad argument for unpack_one"
+ [[ -e "$1" ]] || die "${1} doesn't exist"
+
+ if [[ -n "${UNPACKONLY}" ]] ; then
+ case "${x}" in
+ *.tar.bz2|*.tbz2)
+ ;;
+
+ *)
+ die "Can't use --only with ${x}"
+ ;;
+ esac
+ fi
+
+ case "${x}" in
+ *.tar)
+ echo tar xf "${1}" --no-same-owner "${TAR_OPTIONS[@]}" 1>&2
+ tar xf "${1}" --no-same-owner "${TAR_OPTIONS[@]}" || die "Couldn't unpack ${1}"
+ ;;
+
+ *.tar.gz|*.tgz|*.tar.Z)
+ echo tar zxf "${1}" --no-same-owner "${TAR_OPTIONS[@]}" 1>&2
+ tar zxf "${1}" --no-same-owner "${TAR_OPTIONS[@]}" || die "Couldn't unpack ${1}"
+ ;;
+
+ *.tar.bz2|*.tbz2)
+ echo tar jxf "${1}" --no-same-owner "${TAR_OPTIONS[@]}" ${UNPACKONLY} 1>&2
+ tar jxf "${1}" --no-same-owner "${TAR_OPTIONS[@]}" ${UNPACKONLY} || die "Couldn't unpack ${1}"
+ ;;
+
+ *.zip|*.ZIP|*.jar)
+ echo unzip -qo "${1}" 1>&2
+ unzip -qo "${1}" || die "Couldn't unpack ${1}"
+ ;;
+
+ *.gz|*.Z|*.z)
+ echo gzip -dc "${1}" > ${UNPACKTODIR}/$(basename "${1%.*}" ) 1>&2
+ gzip -dc "${1}" > ${UNPACKTODIR}/$(basename "${1%.*}" ) || die "Couldn't unpack ${1}"
+ ;;
+
+ *.bz2)
+ echo bzip2 -dc "${1}" > ${UNPACKTODIR}/$(basename "${1%.*}" ) 1>&2
+ bzip2 -dc "${1}" > ${UNPACKTODIR}/$(basename "${1%.*}" ) || die "Couldn't unpack ${1}"
+ ;;
+
+ *.rar|*.RAR)
+ echo unrar x -idq "${1}" 1>&2
+ unrar x -idq "${1}" || die "Couldn't unpack ${1}"
+ ;;
+
+ *.LHa|*.LHA|*.lha|*.lzh)
+ echo lha xqf "${1}" 1>&2
+ lha xqf "${1}" || die "Couldn't unpack ${1}"
+ ;;
+
+ *.a|*.deb)
+ echo ar x "${1}" 1>&2
+ ar x "${1}" 1>&2
+ ;;
+
+ *)
+ echo "Skipping unpack for ${1}"
+ ;;
+ esac
+
+}
+
+export UNPACKFROMDIR="${FETCHEDDIR}"
+export UNPACKTODIR="${PWD}"
+
+if [[ "${1}" == "--binary" ]] ; then
+ export UNPACKFROMDIR="${PKGDIR}"
+ export UNPACKTODIR="${IMAGE}"
+ shift
+fi
+
+unset UNPACKONLY
+if [[ "${1}" == "--only" ]] ; then
+ shift
+ export UNPACKONLY="${1}"
+ shift
+fi
+
+TAR_OPTIONS=( )
+while [[ "${1}" == --tar-option=* ]] ; do
+ TAR_OPTIONS[${#TAR_OPTIONS[@]}]="${1#*=}"
+ shift
+done
+
+[[ -z "$@" ]] && die "No arguments given to unpack"
+
+for x in "$@" ; do
+ x=$(echo $x )
+ echo ">>> Unpacking ${x} to ${UNPACKTODIR}"
+ [[ "${x:0:2}" == "./" ]] || x="${UNPACKFROMDIR}/${x}"
+ mkdir -p ${UNPACKTODIR}
+ cd ${UNPACKTODIR}
+ unpack_one "${x}"
+done
+
+
diff --git a/paludis/repositories/e/ebuild/write_vdb_entry.bash b/paludis/repositories/e/ebuild/write_vdb_entry.bash
index b7591d0..9e16bb6 100755
--- a/paludis/repositories/e/ebuild/write_vdb_entry.bash
+++ b/paludis/repositories/e/ebuild/write_vdb_entry.bash
@@ -65,20 +65,32 @@ main()
ebuild_section "Writing VDB entry keys ..."
+ if [[ -z "${PALUDIS_VDB_FROM_ENV_VARIABLES}" ]] ; then
+ ebuild_notice "warning" "VDB_FROM_ENV_VARIABLES not set, using defaults"
+ PALUDIS_VDB_FROM_ENV_VARIABLES="\
+ CATEGORY CHOST COUNTER DEPEND DESCRIPTION EAPI \
+ FEATURES HOMEPAGE INHERITED IUSE KEYWORDS LICENSE PDEPEND PF \
+ PROVIDE RDEPEND SLOT SRC_URI USE CONFIG_PROTECT CONFIG_PROTECT_MASK \
+ VDB_FORMAT PKGMANAGER"
+ fi
+
+ if [[ -z "${PALUDIS_VDB_FROM_ENV_UNLESS_EMPTY_VARIABLES}" ]] ; then
+ ebuild_notice "warning" "PALUDIS_VDB_FROM_ENV_UNLESS_EMPTY_VARIABLES not set, using defaults"
+ PALUDIS_VDB_FROM_ENV_UNLESS_EMPTY_VARIABLES="\
+ ASFLAGS CBUILD CC CFLAGS CHOST CTARGET CXX CXXFLAGS \
+ EXTRA_ECONF EXTRA_EINSTALL EXTRA_EMAKE LDFLAGS LIBCXXFLAGS \
+ REPOSITORY"
+ fi
+
local v VDB_FORMAT="paludis-2" COUNTER="$(date +%s )"
- for v in CATEGORY CHOST COUNTER DEPEND DESCRIPTION EAPI \
- FEATURES HOMEPAGE INHERITED IUSE KEYWORDS LICENSE PDEPEND PF \
- PROVIDE RDEPEND SLOT SRC_URI USE CONFIG_PROTECT CONFIG_PROTECT_MASK \
- VDB_FORMAT PKGMANAGER ; do
+ for v in ${PALUDIS_VDB_FROM_ENV_VARIABLES} ; do
if ! echo "${!v}" > "${vdbdir}"/${v} ; then
echo "!!! vdb write ${v} failed"
exit 1
fi
done
- for v in ASFLAGS CBUILD CC CFLAGS CHOST CTARGET CXX CXXFLAGS \
- EXTRA_ECONF EXTRA_EINSTALL EXTRA_EMAKE LDFLAGS LIBCXXFLAGS \
- REPOSITORY ; do
+ for v in ${PALUDIS_VDB_FROM_ENV_UNLESS_EMPTY_VARIABLES} ; do
[[ -z "${!v}" ]] && continue
if ! echo "${!v}" > "${vdbdir}"/${v} ; then
echo "!!! vdb write ${v} failed"
diff --git a/paludis/repositories/e/ebuild_entries.cc b/paludis/repositories/e/ebuild_entries.cc
index a52136a..12b1e3a 100644
--- a/paludis/repositories/e/ebuild_entries.cc
+++ b/paludis/repositories/e/ebuild_entries.cc
@@ -169,8 +169,8 @@ namespace
use += stringify(i->flag) + " ";
if (id.eapi()->supported)
- if (id.eapi()->supported->ebuild_options->want_arch_var)
- use += profile->environment_variable("ARCH") + " ";
+ if (! id.eapi()->supported->ebuild_environment_variables->env_arch.empty())
+ use += profile->environment_variable(id.eapi()->supported->ebuild_environment_variables->env_arch) + " ";
return use;
}
@@ -179,7 +179,8 @@ namespace
make_expand(const Environment * const env,
const PackageID & e,
tr1::shared_ptr<const ERepositoryProfile> profile,
- std::string & use)
+ std::string & use,
+ const std::string & expand_sep)
{
tr1::shared_ptr<Map<std::string, std::string> > expand_vars(
new Map<std::string, std::string>);
@@ -207,11 +208,11 @@ namespace
for (std::set<UseFlagName>::const_iterator u(possible_values.begin()), u_end(possible_values.end()) ;
u != u_end ; ++u)
{
- if (! env->query_use(UseFlagName(lower_x + "_" + stringify(*u)), e))
+ if (! env->query_use(UseFlagName(lower_x + expand_sep + stringify(*u)), e))
continue;
if (! e.eapi()->supported->ebuild_options->require_use_expand_in_iuse)
- use.append(lower_x + "_" + stringify(*u) + " ");
+ use.append(lower_x + expand_sep + stringify(*u) + " ");
std::string value;
Map<std::string, std::string>::Iterator i(expand_vars->find(stringify(*x)));
@@ -349,7 +350,7 @@ EbuildEntries::install(const tr1::shared_ptr<const PackageID> & id,
}
/* make AA */
- if (id->eapi()->supported->ebuild_options->want_aa_var)
+ if (! id->eapi()->supported->ebuild_environment_variables->env_aa.empty())
{
AAFinder g;
if (id->src_uri_key())
@@ -394,8 +395,9 @@ EbuildEntries::install(const tr1::shared_ptr<const PackageID> & id,
/* add expand to use (iuse isn't reliable for use_expand things), and make the expand
* environment variables */
+ std::string expand_sep(stringify(id->eapi()->supported->ebuild_options->use_expand_separator));
tr1::shared_ptr<Map<std::string, std::string> > expand_vars(make_expand(
- _imp->params.environment, *id, p, use));
+ _imp->params.environment, *id, p, use, expand_sep));
tr1::shared_ptr<const FSEntrySequence> exlibsdirs(_imp->e_repository->layout()->exlibsdirs(id->name()));
@@ -648,8 +650,9 @@ EbuildEntries::pretend(const tr1::shared_ptr<const PackageID> & id,
return true;
std::string use(make_use(_imp->params.environment, *id, p));
+ std::string expand_sep(stringify(id->eapi()->supported->ebuild_options->use_expand_separator));
tr1::shared_ptr<Map<std::string, std::string> > expand_vars(make_expand(
- _imp->params.environment, *id, p, use));
+ _imp->params.environment, *id, p, use, expand_sep));
tr1::shared_ptr<const FSEntrySequence> exlibsdirs(_imp->e_repository->layout()->exlibsdirs(id->name()));
diff --git a/paludis/repositories/e/make_ebin_repository.cc b/paludis/repositories/e/make_ebin_repository.cc
index a6c49a1..2317ead 100644
--- a/paludis/repositories/e/make_ebin_repository.cc
+++ b/paludis/repositories/e/make_ebin_repository.cc
@@ -148,6 +148,11 @@ paludis::make_ebin_repository(
eapi_when_unspecified = DistributionData::get_instance()->distribution_from_string(
env->default_distribution())->default_ebuild_eapi_when_unspecified;
+ std::string profile_eapi;
+ if (m->end() == m->find("profile_eapi") || ((profile_eapi = m->find("profile_eapi")->second)).empty())
+ profile_eapi = DistributionData::get_instance()->distribution_from_string(
+ env->default_distribution())->default_ebuild_profile_eapi;
+
if (m->end() != m->find("sync_exclude"))
{
Log::get_instance()->message(ll_warning, lc_no_context, "The sync_exclude key in '"
@@ -183,6 +188,7 @@ paludis::make_ebin_repository(
.write_bin_uri_prefix(write_bin_uri_prefix)
.eapi_when_unspecified(eapi_when_unspecified)
.eapi_when_unknown(eapi_when_unknown)
+ .profile_eapi(profile_eapi)
.buildroot(buildroot)));
}
diff --git a/paludis/repositories/e/make_ebuild_repository.cc b/paludis/repositories/e/make_ebuild_repository.cc
index 0fd8c9b..80c3899 100644
--- a/paludis/repositories/e/make_ebuild_repository.cc
+++ b/paludis/repositories/e/make_ebuild_repository.cc
@@ -148,6 +148,11 @@ paludis::make_ebuild_repository(
eapi_when_unspecified = DistributionData::get_instance()->distribution_from_string(
env->default_distribution())->default_ebuild_eapi_when_unspecified;
+ std::string profile_eapi;
+ if (m->end() == m->find("profile_eapi") || ((profile_eapi = m->find("profile_eapi")->second)).empty())
+ profile_eapi = DistributionData::get_instance()->distribution_from_string(
+ env->default_distribution())->default_ebuild_profile_eapi;
+
std::string names_cache;
if (m->end() == m->find("names_cache") || ((names_cache = m->find("names_cache")->second)).empty())
{
@@ -210,6 +215,7 @@ paludis::make_ebuild_repository(
.write_bin_uri_prefix("")
.eapi_when_unknown(eapi_when_unknown)
.eapi_when_unspecified(eapi_when_unspecified)
+ .profile_eapi(profile_eapi)
.buildroot(buildroot)));
}
diff --git a/paludis/repositories/e/use_desc.cc b/paludis/repositories/e/use_desc.cc
index d374a96..6ca96a5 100644
--- a/paludis/repositories/e/use_desc.cc
+++ b/paludis/repositories/e/use_desc.cc
@@ -57,7 +57,7 @@ namespace paludis
}
}
- Implementation(const FSEntry & f)
+ Implementation(const FSEntry & f, const std::string & expand_sep)
{
add(f / "use.desc", "");
add(f / "use.local.desc", "");
@@ -65,13 +65,13 @@ namespace paludis
if ((f / "desc").is_directory_or_symlink_to_directory())
for (DirIterator d(f / "desc"), d_end ; d != d_end ; ++d)
if (is_file_with_extension(*d, ".desc", IsFileWithOptions()))
- add(*d, strip_trailing_string(d->basename(), ".desc") + "_");
+ add(*d, strip_trailing_string(d->basename(), ".desc") + expand_sep);
}
};
}
-UseDesc::UseDesc(const FSEntry & f) :
- PrivateImplementationPattern<UseDesc>(new Implementation<UseDesc>(f))
+UseDesc::UseDesc(const FSEntry & f, const std::string & expand_sep) :
+ PrivateImplementationPattern<UseDesc>(new Implementation<UseDesc>(f, expand_sep))
{
}
diff --git a/paludis/repositories/e/use_desc.hh b/paludis/repositories/e/use_desc.hh
index f6c0be3..0a35885 100644
--- a/paludis/repositories/e/use_desc.hh
+++ b/paludis/repositories/e/use_desc.hh
@@ -42,7 +42,7 @@ namespace paludis
///\name Basic operations
///\{
- UseDesc(const FSEntry &);
+ UseDesc(const FSEntry &, const std::string & expand_sep);
~UseDesc();
///\}
diff --git a/paludis/repositories/e/vdb_id.cc b/paludis/repositories/e/vdb_id.cc
index f5ca6e1..5bb44c4 100644
--- a/paludis/repositories/e/vdb_id.cc
+++ b/paludis/repositories/e/vdb_id.cc
@@ -128,88 +128,116 @@ VDBID::need_keys_added() const
Context context("When loading VDB ID keys from '" + stringify(_imp->dir) + "':");
- if ((_imp->dir / "USE").exists())
+ if (! eapi()->supported)
{
- _imp->use.reset(new EUseKey(shared_from_this(), "USE", "Use flags", file_contents(_imp->dir / "USE"), mkt_internal));
- add_key(_imp->use);
+ Log::get_instance()->message(ll_debug, lc_context) << "Not loading further keys for '" << *this << "' because EAPI '"
+ << eapi()->name << "' is not supported";
+ return;
}
- if ((_imp->dir / "INHERITED").exists())
- {
- _imp->inherited.reset(new EInheritedKey(shared_from_this(), "INHERITED", "Inherited", file_contents(_imp->dir / "INHERITED"),
- mkt_internal));
- add_key(_imp->inherited);
- }
+ const tr1::shared_ptr<const EAPIEbuildMetadataVariables> vars(eapi()->supported->ebuild_metadata_variables);
+ if (! vars)
+ throw InternalError(PALUDIS_HERE, "EAPI '" + eapi()->name + "' supported but has no ebuild_metadata_variables");
- if ((_imp->dir / "IUSE").exists())
- {
- _imp->iuse.reset(new EIUseKey(shared_from_this(), "IUSE", "Used use flags", file_contents(_imp->dir / "IUSE"),
- mkt_normal));
- add_key(_imp->iuse);
- }
+ const tr1::shared_ptr<const EAPIEbuildEnvironmentVariables> env(eapi()->supported->ebuild_environment_variables);
+ if (! env)
+ throw InternalError(PALUDIS_HERE, "EAPI '" + eapi()->name + "' supported but has no ebuild_environment_variables");
- if ((_imp->dir / "LICENSE").exists())
- {
- _imp->license.reset(new ELicenseKey(shared_from_this(), "LICENSE", "License", file_contents(_imp->dir / "LICENSE"),
- mkt_normal));
- add_key(_imp->license);
- }
+ if (! env->env_use.empty())
+ if ((_imp->dir / env->env_use).exists())
+ {
+ _imp->use.reset(new EUseKey(shared_from_this(), env->env_use, env->description_use,
+ file_contents(_imp->dir / env->env_use), mkt_internal));
+ add_key(_imp->use);
+ }
- if ((_imp->dir / "PROVIDE").exists())
- {
- _imp->provide.reset(new EProvideKey(shared_from_this(), "PROVIDE", "Provides", file_contents(_imp->dir / "PROVIDE"),
- mkt_internal));
- add_key(_imp->provide);
- }
+ if (! vars->metadata_inherited.empty())
+ if ((_imp->dir / vars->metadata_inherited).exists())
+ {
+ _imp->inherited.reset(new EInheritedKey(shared_from_this(), vars->metadata_inherited, vars->description_inherited,
+ file_contents(_imp->dir / vars->metadata_inherited), mkt_internal));
+ add_key(_imp->inherited);
+ }
- if ((_imp->dir / "DEPEND").exists())
- {
- _imp->build_dependencies.reset(new EDependenciesKey(shared_from_this(), "DEPEND", "Build dependencies",
- file_contents(_imp->dir / "DEPEND"), mkt_dependencies));
- add_key(_imp->build_dependencies);
- }
+ if (! vars->metadata_iuse.empty())
+ if ((_imp->dir / vars->metadata_iuse).exists())
+ {
+ _imp->iuse.reset(new EIUseKey(shared_from_this(), vars->metadata_iuse, vars->description_iuse,
+ file_contents(_imp->dir / vars->metadata_iuse), mkt_normal));
+ add_key(_imp->iuse);
+ }
- if ((_imp->dir / "RDEPEND").exists())
- {
- _imp->run_dependencies.reset(new EDependenciesKey(shared_from_this(), "RDEPEND", "Run dependencies",
- file_contents(_imp->dir / "RDEPEND"), mkt_dependencies));
- add_key(_imp->run_dependencies);
- }
+ if (! vars->metadata_license.empty())
+ if ((_imp->dir / vars->metadata_license).exists())
+ {
+ _imp->license.reset(new ELicenseKey(shared_from_this(), vars->metadata_license, vars->description_license,
+ file_contents(_imp->dir / vars->metadata_license), mkt_normal));
+ add_key(_imp->license);
+ }
- if ((_imp->dir / "PDEPEND").exists())
- {
- _imp->post_dependencies.reset(new EDependenciesKey(shared_from_this(), "PDEPEND", "Post dependencies",
- file_contents(_imp->dir / "PDEPEND"), mkt_dependencies));
- add_key(_imp->post_dependencies);
- }
+ if (! vars->metadata_provide.empty())
+ if ((_imp->dir / vars->metadata_provide).exists())
+ {
+ _imp->provide.reset(new EProvideKey(shared_from_this(), vars->metadata_provide, vars->description_provide,
+ file_contents(_imp->dir / vars->metadata_provide), mkt_internal));
+ add_key(_imp->provide);
+ }
- if ((_imp->dir / "RESTRICT").exists())
- {
- _imp->restrictions.reset(new ERestrictKey(shared_from_this(), "RESTRICT", "Restrictions",
- file_contents(_imp->dir / "RESTRICT"), mkt_internal));
- add_key(_imp->restrictions);
- }
+ if (! vars->metadata_build_depend.empty())
+ if ((_imp->dir / vars->metadata_build_depend).exists())
+ {
+ _imp->build_dependencies.reset(new EDependenciesKey(shared_from_this(), vars->metadata_build_depend,
+ vars->description_build_depend, file_contents(_imp->dir / vars->metadata_build_depend), mkt_dependencies));
+ add_key(_imp->build_dependencies);
+ }
- if ((_imp->dir / "SRC_URI").exists())
- {
- _imp->src_uri.reset(new EURIKey(shared_from_this(), "SRC_URI", "Source URI",
- file_contents(_imp->dir / "SRC_URI"), mkt_dependencies));
- add_key(_imp->src_uri);
- }
+ if (! vars->metadata_run_depend.empty())
+ if ((_imp->dir / vars->metadata_run_depend).exists())
+ {
+ _imp->run_dependencies.reset(new EDependenciesKey(shared_from_this(), vars->metadata_run_depend,
+ vars->description_run_depend, file_contents(_imp->dir / vars->metadata_run_depend), mkt_dependencies));
+ add_key(_imp->run_dependencies);
+ }
- if ((_imp->dir / "DESCRIPTION").exists())
- {
- _imp->short_description.reset(new EStringKey(shared_from_this(), "DESCRIPTION", "Description",
- file_contents(_imp->dir / "DESCRIPTION"), mkt_significant));
- add_key(_imp->short_description);
- }
+ if (! vars->metadata_pdepend.empty())
+ if ((_imp->dir / vars->metadata_pdepend).exists())
+ {
+ _imp->post_dependencies.reset(new EDependenciesKey(shared_from_this(), vars->metadata_pdepend,
+ vars->description_pdepend, file_contents(_imp->dir / vars->metadata_pdepend), mkt_dependencies));
+ add_key(_imp->post_dependencies);
+ }
- if ((_imp->dir / "HOMEPAGE").exists())
- {
- _imp->homepage.reset(new EURIKey(shared_from_this(), "HOMEPAGE", "Homepage",
- file_contents(_imp->dir / "HOMEPAGE"), mkt_significant));
- add_key(_imp->homepage);
- }
+ if (! vars->metadata_restrict.empty())
+ if ((_imp->dir / vars->metadata_restrict).exists())
+ {
+ _imp->restrictions.reset(new ERestrictKey(shared_from_this(), vars->metadata_restrict, vars->description_restrict,
+ file_contents(_imp->dir / vars->metadata_restrict), mkt_internal));
+ add_key(_imp->restrictions);
+ }
+
+ if (! vars->metadata_src_uri.empty())
+ if ((_imp->dir / vars->metadata_src_uri).exists())
+ {
+ _imp->src_uri.reset(new EURIKey(shared_from_this(), vars->metadata_src_uri, vars->description_src_uri,
+ file_contents(_imp->dir / vars->metadata_src_uri), mkt_dependencies));
+ add_key(_imp->src_uri);
+ }
+
+ if (! vars->metadata_description.empty())
+ if ((_imp->dir / vars->metadata_description).exists())
+ {
+ _imp->short_description.reset(new EStringKey(shared_from_this(), vars->metadata_description,
+ vars->description_description, file_contents(_imp->dir / vars->metadata_description), mkt_significant));
+ add_key(_imp->short_description);
+ }
+
+ if (! vars->metadata_homepage.empty())
+ if ((_imp->dir / vars->metadata_homepage).exists())
+ {
+ _imp->homepage.reset(new EURIKey(shared_from_this(), vars->metadata_homepage, vars->description_homepage,
+ file_contents(_imp->dir / vars->metadata_homepage), mkt_significant));
+ add_key(_imp->homepage);
+ }
_imp->contents.reset(new EContentsKey(shared_from_this(), "CONTENTS", "Contents",
_imp->dir / "CONTENTS", mkt_internal));
diff --git a/paludis/util/destringify.hh b/paludis/util/destringify.hh
index 0f74f11..de5ffc2 100644
--- a/paludis/util/destringify.hh
+++ b/paludis/util/destringify.hh
@@ -127,6 +127,38 @@ namespace paludis
}
}
};
+
+ /**
+ * Specialised destringify for char.
+ *
+ * \ingroup grpdestringify
+ */
+ template <typename Exception_>
+ struct Destringifier<char, Exception_>
+ {
+ /**
+ * Do the destringification.
+ */
+ static char do_destringify(const std::string & s)
+ {
+ try
+ {
+ std::string r(Destringifier<std::string, Exception_>::do_destringify(s));
+ if (r.length() != 1)
+ throw DestringifyError(s);
+ return r[0];
+ }
+ catch (const DestringifyError &)
+ {
+ bool b;
+ std::istringstream ss(s);
+ ss >> std::boolalpha >> b;
+ if (! ss.eof() || ss.bad())
+ throw Exception_(s);
+ return b;
+ }
+ }
+ };
}
/**
diff --git a/src/output/console_install_task.cc b/src/output/console_install_task.cc
index beda3bb..6d32a0e 100644
--- a/src/output/console_install_task.cc
+++ b/src/output/console_install_task.cc
@@ -540,14 +540,18 @@ ConsoleInstallTask::display_merge_list_post_use_descriptions(const std::string &
bool prefixed(false);
for (UseFlagNameSet::Iterator f(_all_expand_prefixes->begin()),
f_end(_all_expand_prefixes->end()) ; f != f_end && ! prefixed ; ++f)
- if (0 == stringify(i->flag).compare(0, stringify(*f).length(), stringify(*f)))
- prefixed = true;
+ if (stringify(*f).length() < stringify(i->flag).length())
+ if (0 == stringify(i->flag).compare(0, stringify(*f).length(), stringify(*f)))
+ prefixed = true;
if (prefixed)
continue;
}
else
{
+ if (stringify(i->flag).length() <= prefix.length())
+ continue;
+
if (0 != stringify(i->flag).compare(0, prefix.length(), prefix))
continue;
}
@@ -590,11 +594,14 @@ ConsoleInstallTask::display_use_summary_flag(const std::string & prefix,
Set<UseDescription, UseDescriptionComparator>::Iterator i,
Set<UseDescription, UseDescriptionComparator>::Iterator i_end)
{
+ Log::get_instance()->message(ll_debug, lc_context) << "display_use_summary_flag: prefix is '" << prefix
+ << "', i->flag is '" << i->flag << "', i->package_id is '" << *i->package_id << "', i->state is '" << i->state
+ << "', i->description is '" << i->description << "'";
+
if (next(i) == i_end)
{
std::ostringstream s;
- s << std::left << std::setw(30) << (render_as_tag(
- strip_leading_string(stringify(i->flag), prefix + "_")) + ": ");
+ s << std::left << std::setw(30) << (render_as_tag(stringify(i->flag).substr(prefix.empty() ? 0 : prefix.length() + 1)) + ": ");
s << i->description;
output_starred_item(s.str());
}
@@ -608,15 +615,14 @@ ConsoleInstallTask::display_use_summary_flag(const std::string & prefix,
if (all_same)
{
std::ostringstream s;
- s << std::left << std::setw(30) << (render_as_tag(
- strip_leading_string(stringify(i->flag), prefix + "_")) + ": ");
+ s << std::left << std::setw(30) << (render_as_tag(stringify(i->flag).substr(prefix.empty() ? 0 : prefix.length() + 1)) + ": ");
s << i->description;
output_starred_item(s.str());
}
else
{
output_starred_item(render_as_tag(
- strip_leading_string(stringify(i->flag), prefix + "_")) + ":");
+ stringify(i->flag).substr(prefix.empty() ? 0 : prefix.length() + 1)) + ":");
for ( ; i != i_end ; ++i)
{
diff --git a/src/output/use_flag_pretty_printer.cc b/src/output/use_flag_pretty_printer.cc
index 5cedfbf..1edb2ac 100644
--- a/src/output/use_flag_pretty_printer.cc
+++ b/src/output/use_flag_pretty_printer.cc
@@ -24,6 +24,7 @@
#include <paludis/util/iterator.hh>
#include <paludis/util/tr1_functional.hh>
#include <paludis/util/set.hh>
+#include <paludis/util/log.hh>
#include <paludis/metadata_key.hh>
#include <libwrapiter/libwrapiter_forward_iterator.hh>
#include <libwrapiter/libwrapiter_output_iterator.hh>
@@ -52,8 +53,16 @@ UseFlagPrettyPrinter::use_expand_delim_pos(const UseFlagName & u,
const tr1::shared_ptr<const UseFlagNameSet> c) const
{
for (UseFlagNameSet::Iterator i(c->begin()), i_end(c->end()) ; i != i_end ; ++i)
- if (0 == u.data().compare(0, i->data().length(), i->data(), 0, i->data().length()))
- return i->data().length();
+ if (i->data().length() < u.data().length())
+ if (0 == u.data().compare(0, i->data().length(), i->data(), 0, i->data().length()))
+ {
+ Log::get_instance()->message(ll_debug, lc_context) << "use_expand_delim_pos for '" << u
+ << "' is '" << i->data().length() << "'";
+ return i->data().length();
+ }
+
+ Log::get_instance()->message(ll_debug, lc_context) << "use_expand_delim_pos for '" << u
+ << "' is npos";
return std::string::npos;
}