aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2008-01-19 00:02:29 +0000
committerAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2008-01-19 00:02:29 +0000
commit65b149c78f21883d0e4184a8ae8291f7c852c358 (patch)
treefea87388c98b1100b11de3736052cebf821f5118
parent31d62bdfa5664f56557164ce9f78174ea10a61db (diff)
downloadpaludis-65b149c78f21883d0e4184a8ae8291f7c852c358.tar.gz
paludis-65b149c78f21883d0e4184a8ae8291f7c852c358.tar.xz
Merge in pbins. Not for real world use.
-rw-r--r--configure.ac1
-rw-r--r--paludis/repositories/e/e_repository.cc23
-rw-r--r--paludis/repositories/e/e_repository_entries.hh6
-rw-r--r--paludis/repositories/e/e_repository_params.sr6
-rw-r--r--paludis/repositories/e/eapi.cc13
-rw-r--r--paludis/repositories/e/eapi.sr6
-rw-r--r--paludis/repositories/e/eapis/0.conf10
-rw-r--r--paludis/repositories/e/eapis/1.conf158
-rw-r--r--paludis/repositories/e/eapis/Makefile.am6
-rw-r--r--paludis/repositories/e/eapis/exheres-0.conf10
-rw-r--r--paludis/repositories/e/eapis/paludis-1.conf12
-rw-r--r--paludis/repositories/e/eapis/pbin-1+0.conf36
-rw-r--r--paludis/repositories/e/eapis/pbin-1+1.conf37
-rw-r--r--paludis/repositories/e/eapis/pbin-1+exheres-0.conf36
-rw-r--r--paludis/repositories/e/eapis/pbin-1+paludis-1.conf37
-rw-r--r--paludis/repositories/e/ebuild.cc84
-rw-r--r--paludis/repositories/e/ebuild.hh29
-rw-r--r--paludis/repositories/e/ebuild.sr25
-rw-r--r--paludis/repositories/e/ebuild/Makefile.am6
-rw-r--r--paludis/repositories/e/ebuild/binary_functions.bash79
-rwxr-xr-xpaludis/repositories/e/ebuild/ebuild.bash16
-rw-r--r--paludis/repositories/e/ebuild/pbin-1/Makefile.am38
-rw-r--r--paludis/repositories/e/ebuild/pbin-1/builtin_installbin.bash47
-rw-r--r--paludis/repositories/e/ebuild/pbin-1/builtin_pivotbin.bash57
-rwxr-xr-xpaludis/repositories/e/ebuild/source_functions.bash3
-rw-r--r--paludis/repositories/e/ebuild/write_binary_ebuild.bash134
-rw-r--r--paludis/repositories/e/ebuild_entries.cc41
-rw-r--r--paludis/repositories/e/ebuild_entries.hh7
-rw-r--r--paludis/repositories/e/exheres_layout.cc10
-rw-r--r--paludis/repositories/e/exheres_layout.hh6
-rw-r--r--paludis/repositories/e/layout.hh6
-rw-r--r--paludis/repositories/e/make_ebuild_repository.cc29
-rw-r--r--paludis/repositories/e/traditional_layout.cc10
-rw-r--r--paludis/repositories/e/traditional_layout.hh6
-rw-r--r--vim/syntax/paludis-repositories-conf.vim4
35 files changed, 846 insertions, 188 deletions
diff --git a/configure.ac b/configure.ac
index f1285da..6058ba2 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1328,6 +1328,7 @@ AC_OUTPUT(
paludis/repositories/e/ebuild/Makefile
paludis/repositories/e/ebuild/exheres-0/Makefile
paludis/repositories/e/ebuild/paludis-1/Makefile
+ paludis/repositories/e/ebuild/pbin-1/Makefile
paludis/repositories/e/ebuild/utils/Makefile
paludis/repositories/e/ebuild/utils/exheres-0/Makefile
paludis/repositories/e/qa/Makefile
diff --git a/paludis/repositories/e/e_repository.cc b/paludis/repositories/e/e_repository.cc
index ab14546..15060bf 100644
--- a/paludis/repositories/e/e_repository.cc
+++ b/paludis/repositories/e/e_repository.cc
@@ -1,7 +1,7 @@
/* vim: set sw=4 sts=4 et foldmethod=syntax : */
/*
- * Copyright (c) 2005, 2006, 2007 Ciaran McCreesh
+ * Copyright (c) 2005, 2006, 2007, 2008 Ciaran McCreesh
* Copyright (c) 2006 Danny van Dyk
*
* This file is part of the Paludis package manager. Paludis is free software;
@@ -260,6 +260,9 @@ namespace paludis
tr1::shared_ptr<const MetadataStringKey> profile_eapi_key;
tr1::shared_ptr<const MetadataStringKey> use_manifest_key;
tr1::shared_ptr<const MetadataSectionKey> info_pkgs_key;
+ tr1::shared_ptr<const MetadataStringKey> binary_destination_key;
+ tr1::shared_ptr<const MetadataStringKey> binary_src_uri_prefix_key;
+ tr1::shared_ptr<const MetadataStringKey> binary_keywords;
};
Implementation<ERepository>::Implementation(ERepository * const r,
@@ -329,7 +332,13 @@ namespace paludis
info_pkgs_key((layout->info_packages_file(params.location / "profiles")).exists() ?
tr1::shared_ptr<MetadataSectionKey>(new PkgInfoSectionKey(
params.environment, layout->info_packages_file(params.location / "profiles"), params.profile_eapi)) :
- tr1::shared_ptr<MetadataSectionKey>())
+ tr1::shared_ptr<MetadataSectionKey>()),
+ binary_destination_key(new LiteralMetadataStringKey(
+ "binary_destination", "binary_destination", mkt_normal, stringify(params.binary_destination))),
+ binary_src_uri_prefix_key(new LiteralMetadataStringKey(
+ "binary_uri_prefix", "binary_uri_prefix", mkt_normal, params.binary_uri_prefix)),
+ binary_keywords(new LiteralMetadataStringKey(
+ "binary_keywords", "binary_keywords", mkt_normal, params.binary_keywords))
{
}
@@ -452,7 +461,7 @@ ERepository::ERepository(const ERepositoryParams & p) :
.virtuals_interface(DistributionData::get_instance()->distribution_from_string(
p.environment->default_distribution())->support_old_style_virtuals ? this : 0)
.provides_interface(0)
- .destination_interface(p.enable_destinations ? this : 0)
+ .destination_interface(p.binary_destination ? this : 0)
.make_virtuals_interface(0)
.e_interface(this)
#ifdef ENABLE_QA
@@ -501,6 +510,9 @@ ERepository::_add_metadata_keys() const
add_metadata_key(_imp->use_manifest_key);
if (_imp->info_pkgs_key)
add_metadata_key(_imp->info_pkgs_key);
+ add_metadata_key(_imp->binary_destination_key);
+ add_metadata_key(_imp->binary_src_uri_prefix_key);
+ add_metadata_key(_imp->binary_keywords);
}
bool
@@ -1085,7 +1097,10 @@ bool
ERepository::is_suitable_destination_for(const PackageID & e) const
{
std::string f(e.repository()->format_key() ? e.repository()->format_key()->value() : "");
- return f == "ebuild" || f == "ebin";
+ if (f == "ebuild")
+ return static_cast<const erepository::ERepositoryID &>(e).eapi()->supported->can_be_pbin;
+ else
+ return false;
}
bool
diff --git a/paludis/repositories/e/e_repository_entries.hh b/paludis/repositories/e/e_repository_entries.hh
index 762f996..1b3d7d6 100644
--- a/paludis/repositories/e/e_repository_entries.hh
+++ b/paludis/repositories/e/e_repository_entries.hh
@@ -115,6 +115,12 @@ namespace paludis
* example, "EBUILD").
*/
virtual std::string get_package_file_manifest_key(const FSEntry &, const QualifiedPackageName &) const = 0;
+
+ /**
+ * Generate the name for a binary ebuild.
+ */
+ virtual std::string binary_ebuild_name(const QualifiedPackageName &, const VersionSpec &, const std::string &) const
+ PALUDIS_ATTRIBUTE((warn_unused_result)) = 0;
};
/**
diff --git a/paludis/repositories/e/e_repository_params.sr b/paludis/repositories/e/e_repository_params.sr
index b59ef51..8a7785f 100644
--- a/paludis/repositories/e/e_repository_params.sr
+++ b/paludis/repositories/e/e_repository_params.sr
@@ -23,7 +23,6 @@ make_class_ERepositoryParams()
key sync_options std::string
key builddir FSEntry
key master_repository "tr1::shared_ptr<const ERepository>"
- key enable_destinations bool
key write_bin_uri_prefix std::string
key eapi_when_unknown std::string
key eapi_when_unspecified std::string
@@ -31,6 +30,11 @@ make_class_ERepositoryParams()
key use_manifest "erepository::UseManifest"
key ignore_deprecated_profiles bool
+ key binary_destination bool
+ key binary_uri_prefix std::string
+ key binary_distdir FSEntry
+ key binary_keywords std::string
+
doxygen_comment << "END"
/**
* Parameters used to create a ERepository
diff --git a/paludis/repositories/e/eapi.cc b/paludis/repositories/e/eapi.cc
index 86bf77b..f92b912 100644
--- a/paludis/repositories/e/eapi.cc
+++ b/paludis/repositories/e/eapi.cc
@@ -100,12 +100,16 @@ namespace paludis
iuse_flag_parse_options += destringify<IUseFlagParseOption>(*t);
}
- tr1::shared_ptr<EAPI> eapi(new EAPI(strip_trailing_string(d->basename(), ".conf"), make_shared_ptr(new SupportedEAPI(
+ tr1::shared_ptr<EAPI> eapi(new EAPI(
+ strip_trailing_string(d->basename(), ".conf"),
+ k.get("exported_name"),
+ make_shared_ptr(new SupportedEAPI(
SupportedEAPI::create()
.package_dep_spec_parse_options(package_dep_spec_parse_options)
.dependency_spec_tree_parse_options(dependency_spec_tree_parse_options)
.iuse_flag_parse_options(iuse_flag_parse_options)
.breaks_portage(destringify<bool>(k.get("breaks_portage")))
+ .can_be_pbin(destringify<bool>(k.get("can_be_pbin")))
.ebuild_options(make_shared_ptr(new EAPIEbuildOptions(
EAPIEbuildOptions::create()
@@ -118,6 +122,7 @@ namespace paludis
.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"))
+ .binary_from_env_variables(k.get("binary_from_env_variables"))
.source_merged_variables(k.get("source_merged_variables"))
.bracket_merged_variables(k.get("bracket_merged_variables"))
.must_not_change_variables(k.get("must_not_change_variables"))
@@ -134,6 +139,8 @@ namespace paludis
.restrict_primaryuri(make_shared_ptr(new Set<std::string>))
.merge_rewrite_symlinks(destringify<bool>(k.get("merge_rewrite_symlinks")))
.f_function_prefix(k.get("f_function_prefix"))
+ .ignore_pivot_env_variables(k.get("ignore_pivot_env_variables"))
+ .ignore_pivot_env_functions(k.get("ignore_pivot_env_functions"))
)))
.pipe_commands(make_shared_ptr(new EAPIPipeCommands(
@@ -250,13 +257,13 @@ EAPIData::eapi_from_string(const std::string & s) const
if (i != _imp->values.end())
return i->second;
- return make_shared_ptr(new EAPI(s, tr1::shared_ptr<SupportedEAPI>()));
+ return make_shared_ptr(new EAPI(s, s, tr1::shared_ptr<SupportedEAPI>()));
}
tr1::shared_ptr<const EAPI>
EAPIData::unknown_eapi() const
{
- return make_shared_ptr(new EAPI("UNKNOWN", tr1::shared_ptr<SupportedEAPI>()));
+ return make_shared_ptr(new EAPI("UNKNOWN", "UNKNOWN", tr1::shared_ptr<SupportedEAPI>()));
}
namespace paludis
diff --git a/paludis/repositories/e/eapi.sr b/paludis/repositories/e/eapi.sr
index f225d13..d76534b 100644
--- a/paludis/repositories/e/eapi.sr
+++ b/paludis/repositories/e/eapi.sr
@@ -136,8 +136,12 @@ make_class_EAPIEbuildOptions()
key save_unmodifiable_variables std::string
key vdb_from_env_variables std::string
key vdb_from_env_unless_empty_variables std::string
+ key binary_from_env_variables std::string
key f_function_prefix std::string
+ key ignore_pivot_env_variables std::string
+ key ignore_pivot_env_functions std::string
+
key merge_rewrite_symlinks bool
key restrict_fetch "tr1::shared_ptr<Set<std::string> >"
@@ -175,6 +179,7 @@ make_class_SupportedEAPI()
key iuse_flag_parse_options IUseFlagParseOptions
key breaks_portage bool
+ key can_be_pbin bool
key ebuild_options "tr1::shared_ptr<const EAPIEbuildOptions>"
key ebuild_phases "tr1::shared_ptr<const EAPIEbuildPhases>"
@@ -201,6 +206,7 @@ make_class_EAPI()
visible
key name std::string
+ key exported_name std::string
key supported "tr1::shared_ptr<const SupportedEAPI>"
allow_named_args
diff --git a/paludis/repositories/e/eapis/0.conf b/paludis/repositories/e/eapis/0.conf
index 14d8f92..c59882c 100644
--- a/paludis/repositories/e/eapis/0.conf
+++ b/paludis/repositories/e/eapis/0.conf
@@ -1,6 +1,9 @@
# Configuration for EAPI 0
# EAPI 0 is the default EAPI used by Gentoo. It is specified in PMS.
+exported_name = 0
+can_be_pbin = true
+
package_dep_spec_parse_options =
dependency_spec_tree_parse_options =
iuse_flag_parse_options =
@@ -27,6 +30,13 @@ vdb_from_env_unless_empty_variables = \
EXTRA_ECONF EXTRA_EINSTALL EXTRA_EMAKE LDFLAGS LIBCXXFLAGS \
REPOSITORY RESTRICT
+binary_from_env_variables = \
+ CHOST DEPEND DESCRIPTION EAPI HOMEPAGE IUSE LICENSE PDEPEND \
+ PROVIDE RDEPEND SLOT SRC_URI USE GENERATED_USING GENERATED_TIME \
+ USE_EXPAND ASFLAGS CBUILD CC CFLAGS CHOST CTARGET CXX CXXFLAGS \
+ EXTRA_ECONF EXTRA_EINSTALL EXTRA_EMAKE LDFLAGS LIBCXXFLAGS \
+ GENERATED_FROM_REPOSITORY KEYWORDS BINARY_KEYWORDS BINARY_URI
+
non_empty_variables = \
P PV PR PN PVR PF CATEGORY FILESDIR ECLASSDIR PORTDIR \
DISTDIR KV PALUDIS_TMPDIR PALUDIS_EBUILD_LOG_LEVEL PALUDIS_EBUILD_DIR \
diff --git a/paludis/repositories/e/eapis/1.conf b/paludis/repositories/e/eapis/1.conf
index dad827b..46f8bb4 100644
--- a/paludis/repositories/e/eapis/1.conf
+++ b/paludis/repositories/e/eapis/1.conf
@@ -1,161 +1,11 @@
# Configuration for EAPI 1
# EAPI 1 is specified in PMS.
+source ${PALUDIS_EAPIS_DIR}/0.conf
+exported_name = 1
+can_be_pbin = true
+
package_dep_spec_parse_options = allow_slot_deps
-dependency_spec_tree_parse_options =
iuse_flag_parse_options = allow_iuse_defaults
-breaks_portage = false
-rdepend_defaults_to_depend = 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 = 1 0
-merge_rewrite_symlinks = true
-f_function_prefix = ebuild_f
-
-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 USE_EXPAND
-
-vdb_from_env_unless_empty_variables = \
- ASFLAGS CBUILD CC CFLAGS CHOST CTARGET CXX CXXFLAGS \
- EXTRA_ECONF EXTRA_EINSTALL EXTRA_EMAKE LDFLAGS LIBCXXFLAGS \
- REPOSITORY RESTRICT
-
-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
-
-bracket_merged_variables =
-
-must_not_change_variables = \
- SLOT
-
-save_variables = \
- USE USE_EXPAND USE_EXPAND_HIDDEN \$USE_EXPAND
-
-save_base_variables = \
- CONFIG_PROTECT CONFIG_PROTECT_MASK
-
-save_unmodifiable_variables = \
- SLOT EAPI KEYWORDS ROOT \
- PALUDIS_TMPDIR PALUDIS_CONFIG_DIR PALUDIS_BASHRC_FILES \
- PALUDIS_HOOK_DIRS PALUDIS_FETCHERS_DIRS PALUDIS_SYNCERS_DIRS \
- PALUDIS_COMMAND PALUDIS_REDUCED_UID PALUDIS_REDUCED_GID \
- PALUDIS_EBUILD_LOG_LEVEL PALUDIS_EBUILD_DIR PALUDIS_UTILITY_PATH_SUFFIXES \
- PALUDIS_EBUILD_MODULE_SUFFIXES PALUDIS_NON_EMPTY_VARIABLES \
- PALUDIS_DIRECTORY_VARIABLES PALUDIS_EBUILD_MUST_NOT_SET_VARIABLES \
- PALUDIS_SAVE_VARIABLES PALUDIS_SAVE_BASE_VARIABLES \
- PALUDIS_DIRECTORY_IF_EXISTS_VARIABLES PALUDIS_SOURCE_MERGED_VARIABLES \
- PALUDIS_MUST_NOT_CHANGE_VARIABLES PALUDIS_RDEPEND_DEFAULTS_TO_DEPEND \
- ECLASSDIR ECLASSDIRS EXLIBSDIRS PALUDIS_VARIABLE PALUDIS_PROFILE_DIR \
- PALUDIS_PROFILE_DIRS PALUDIS_LOADSAVEENV_DIR PALUDIS_BRACKET_MERGED_VARIABLES
-
-ebuild_install = \
- : prepare ; \
- userpriv sandbox : init saveenv ; \
- : loadenv setup saveenv ; \
- sandbox userpriv : loadenv unpack compile saveenv ; \
- sandbox userpriv checkphase checks=always : loadenv test saveenv ; \
- sandbox : loadenv install saveenv ; \
- prepost : loadenv strip preinst saveenv ; \
- merge : ; \
- prepost : loadenv postinst saveenv ; \
- : tidyup
-
-ebuild_uninstall = \
- : prerm saveenv ; \
- unmerge : ; \
- : loadenv postrm ;
-
-ebuild_pretend =
-
-ebuild_info = \
- sandbox userpriv installed=true : infovars info ; \
- sandbox userpriv installed=false : infovars
-
-ebuild_metadata = \
- sandbox userpriv noexec : metadata
-
-ebuild_nofetch = \
- sandbox userpriv : nofetch
-
-ebuild_variable = \
- sandbox userpriv : 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_description = DESCRIPTION
-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_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
-
-uri_labels = \
- default = URIMirrorsThenListedLabel ; \
- default-restrict-fetch = URIManualOnlyLabel ; \
- default-restrict-mirror = URILocalMirrorsOnlyLabel ; \
- default-restrict-primaryuri = URIListedThenMirrorsLabel
-
-restrict_mirror = mirror nomirror
-restrict_fetch = fetch nofetch
-restrict_primaryuri = primaryuri
-
-pipe_commands_rewrite_virtuals = true
-pipe_commands_no_slot_or_repo = true
diff --git a/paludis/repositories/e/eapis/Makefile.am b/paludis/repositories/e/eapis/Makefile.am
index ada387c..ed27090 100644
--- a/paludis/repositories/e/eapis/Makefile.am
+++ b/paludis/repositories/e/eapis/Makefile.am
@@ -6,7 +6,11 @@ eapis = \
0.conf \
1.conf \
exheres-0.conf \
- paludis-1.conf
+ paludis-1.conf \
+ pbin-1+0.conf \
+ pbin-1+1.conf \
+ pbin-1+paludis-1.conf \
+ pbin-1+exheres-0.conf
eapidir = $(datadir)/paludis/eapis/
diff --git a/paludis/repositories/e/eapis/exheres-0.conf b/paludis/repositories/e/eapis/exheres-0.conf
index 7dbd1c8..1bf0a04 100644
--- a/paludis/repositories/e/eapis/exheres-0.conf
+++ b/paludis/repositories/e/eapis/exheres-0.conf
@@ -2,6 +2,9 @@
# This is an experimental EAPI for exheres. It is not stable. When a stable
# version is available, it will be snapshotted as exheres-1.
+exported_name = exheres-0
+can_be_pbin = true
+
package_dep_spec_parse_options = allow_slot_deps allow_square_bracket_deps \
allow_tilde_greater_deps strict_star_operator strict_parsing
dependency_spec_tree_parse_options = disallow_any_use uri_supports_arrow
@@ -29,6 +32,13 @@ vdb_from_env_unless_empty_variables = \
EXTRA_ECONF EXTRA_EINSTALL EXTRA_EMAKE LDFLAGS LIBCXXFLAGS \
REPOSITORY RESTRICT
+binary_from_env_variables = \
+ CHOST DEPENDENCIES DESCRIPTION EAPI HOMEPAGE INHERITED MYOPTIONS PLATFORMS LICENSE \
+ SLOT SRC_URI OPTIONS GENERATED_USING GENERATED_TIME SUBOPTIONS \
+ ASFLAGS CBUILD CC CFLAGS CHOST CTARGET CXX CXXFLAGS \
+ EXTRA_ECONF EXTRA_EINSTALL EXTRA_EMAKE LDFLAGS LIBCXXFLAGS \
+ GENERATED_FROM_REPOSITORY PLATFORMS BINARY_PLATFORMS
+
non_empty_variables = \
P PV PR PN PVR PF CATEGORY FILESDIR EXLIBSDIRS FETCHEDDIR REPODIR \
PALUDIS_TMPDIR PALUDIS_EBUILD_LOG_LEVEL PALUDIS_EBUILD_DIR \
diff --git a/paludis/repositories/e/eapis/paludis-1.conf b/paludis/repositories/e/eapis/paludis-1.conf
index 0fd5825..f0c4c6a 100644
--- a/paludis/repositories/e/eapis/paludis-1.conf
+++ b/paludis/repositories/e/eapis/paludis-1.conf
@@ -2,6 +2,9 @@
# This is an internal EAPI supporting most Paludis extra features. It is not
# particularly stable or ideal for third party use.
+exported_name = paludis-1
+can_be_pbin = true
+
package_dep_spec_parse_options = allow_slot_deps allow_square_bracket_deps \
allow_repository_deps allow_tilde_greater_deps strict_parsing
dependency_spec_tree_parse_options = disallow_any_use uri_supports_arrow
@@ -27,7 +30,14 @@ vdb_from_env_variables = \
vdb_from_env_unless_empty_variables = \
ASFLAGS CBUILD CC CFLAGS CHOST CTARGET CXX CXXFLAGS \
EXTRA_ECONF EXTRA_EINSTALL EXTRA_EMAKE LDFLAGS LIBCXXFLAGS \
- REPOSITORY SUBOPTIONS
+ REPOSITORY
+
+binary_from_env_variables = \
+ CHOST DEPEND DESCRIPTION EAPI HOMEPAGE IUSE LICENSE PDEPEND \
+ PROVIDE RDEPEND SLOT SRC_URI USE GENERATED_USING GENERATED_TIME \
+ USE_EXPAND ASFLAGS CBUILD CC CFLAGS CHOST CTARGET CXX CXXFLAGS \
+ EXTRA_ECONF EXTRA_EINSTALL EXTRA_EMAKE LDFLAGS LIBCXXFLAGS \
+ GENERATED_FROM_REPOSITORY KEYWORDS BINARY_KEYWORDS BINARY_URI
non_empty_variables = \
P PV PR PN PVR PF CATEGORY FILESDIR ECLASSDIR PORTDIR \
diff --git a/paludis/repositories/e/eapis/pbin-1+0.conf b/paludis/repositories/e/eapis/pbin-1+0.conf
new file mode 100644
index 0000000..bae0552
--- /dev/null
+++ b/paludis/repositories/e/eapis/pbin-1+0.conf
@@ -0,0 +1,36 @@
+# Configuration for EAPI 0, used by Paludis binary format 1.
+# EAPI 0 is the default EAPI used by Gentoo. It is specified in PMS.
+
+source ${PALUDIS_EAPIS_DIR}/0.conf
+can_be_pbin = false
+
+ebuild_module_suffixes = pbin-1 ${ebuild_module_suffixes}
+merge_rewrite_symlinks = true
+
+ignore_pivot_env_variables = \
+ A S D WORKDIR IMAGE
+
+ignore_pivot_env_functions = \
+ src_unpack src_compile src_test src_install
+
+ebuild_install = \
+ : prepare ; \
+ userpriv sandbox : init saveenv ; \
+ : loadenv pivotbin setup saveenv ; \
+ sandbox : loadenv installbin saveenv ; \
+ prepost : loadenv strip preinst saveenv ; \
+ merge : ; \
+ prepost : loadenv postinst saveenv ; \
+ : tidyup
+
+description_generated_using = Generated using
+description_generated_time = Generated time
+description_keywords = Binary keywords
+description_src_uri = Binary URI
+description_use = Selected USE flags
+
+metadata_generated_using = GENERATED_USING
+metadata_generated_time = GENERATED_TIME
+metadata_keywords = BINARY_KEYWORDS
+metadata_src_uri = BINARY_URI
+metadata_use = USE
diff --git a/paludis/repositories/e/eapis/pbin-1+1.conf b/paludis/repositories/e/eapis/pbin-1+1.conf
new file mode 100644
index 0000000..1b4dd94
--- /dev/null
+++ b/paludis/repositories/e/eapis/pbin-1+1.conf
@@ -0,0 +1,37 @@
+# Configuration for EAPI 0, used by Paludis binary format 1.
+# EAPI 0 is the default EAPI used by Gentoo. It is specified in PMS.
+
+source ${PALUDIS_EAPIS_DIR}/1.conf
+can_be_pbin = false
+
+ebuild_module_suffixes = pbin-1 ${ebuild_module_suffixes}
+merge_rewrite_symlinks = true
+
+ignore_pivot_env_variables = \
+ A S D WORKDIR IMAGE
+
+ignore_pivot_env_functions = \
+ src_unpack src_compile src_test src_install
+
+ebuild_install = \
+ : prepare ; \
+ userpriv sandbox : init saveenv ; \
+ : loadenv pivotbin setup saveenv ; \
+ sandbox : loadenv installbin saveenv ; \
+ prepost : loadenv strip preinst saveenv ; \
+ merge : ; \
+ prepost : loadenv postinst saveenv ; \
+ : tidyup
+
+description_generated_using = Generated using
+description_generated_time = Generated time
+description_keywords = Binary keywords
+description_src_uri = Binary URI
+description_use = Selected USE flags
+
+metadata_generated_using = GENERATED_USING
+metadata_generated_time = GENERATED_TIME
+metadata_keywords = BINARY_KEYWORDS
+metadata_src_uri = BINARY_URI
+metadata_use = USE
+
diff --git a/paludis/repositories/e/eapis/pbin-1+exheres-0.conf b/paludis/repositories/e/eapis/pbin-1+exheres-0.conf
new file mode 100644
index 0000000..087caed
--- /dev/null
+++ b/paludis/repositories/e/eapis/pbin-1+exheres-0.conf
@@ -0,0 +1,36 @@
+# Configuration for EAPI 0, used by Paludis binary format 1.
+# EAPI 0 is the default EAPI used by Gentoo. It is specified in PMS.
+
+source ${PALUDIS_EAPIS_DIR}/exheres-0.conf
+can_be_pbin = false
+
+ebuild_module_suffixes = pbin-1 ${ebuild_module_suffixes}
+merge_rewrite_symlinks = true
+
+ignore_pivot_env_variables = \
+ A S D WORKDIR IMAGE
+
+ignore_pivot_env_functions = \
+ src_unpack src_compile src_test src_install
+
+ebuild_install = \
+ : prepare ; \
+ userpriv sandbox : init saveenv ; \
+ : loadenv pivotbin setup saveenv ; \
+ sandbox : loadenv installbin saveenv ; \
+ prepost : loadenv strip preinst saveenv ; \
+ merge : ; \
+ prepost : loadenv postinst saveenv ; \
+ : tidyup
+
+description_generated_using = Generated using
+description_generated_time = Generated time
+description_src_uri = Binary URI
+description_keywords = Binary platforms
+description_use = Selected option flags
+
+metadata_generated_using = GENERATED_USING
+metadata_generated_time = GENERATED_TIME
+metadata_keywords = BINARY_PLATFORMS
+metadata_src_uri = BINARY_URI
+metadata_use = OPTIONS
diff --git a/paludis/repositories/e/eapis/pbin-1+paludis-1.conf b/paludis/repositories/e/eapis/pbin-1+paludis-1.conf
new file mode 100644
index 0000000..acb7f36
--- /dev/null
+++ b/paludis/repositories/e/eapis/pbin-1+paludis-1.conf
@@ -0,0 +1,37 @@
+# Configuration for EAPI 0, used by Paludis binary format 1.
+# EAPI 0 is the default EAPI used by Gentoo. It is specified in PMS.
+
+source ${PALUDIS_EAPIS_DIR}/paludis-1.conf
+can_be_pbin = false
+
+ebuild_module_suffixes = pbin-1 ${ebuild_module_suffixes}
+merge_rewrite_symlinks = true
+
+ignore_pivot_env_variables = \
+ A S D WORKDIR IMAGE
+
+ignore_pivot_env_functions = \
+ src_unpack src_compile src_test src_install
+
+ebuild_install = \
+ : prepare ; \
+ userpriv sandbox : init saveenv ; \
+ : loadenv pivotbin setup saveenv ; \
+ sandbox : loadenv installbin saveenv ; \
+ prepost : loadenv strip preinst saveenv ; \
+ merge : ; \
+ prepost : loadenv postinst saveenv ; \
+ : tidyup
+
+description_generated_using = Generated using
+description_generated_time = Generated time
+description_keywords = Binary keywords
+description_src_uri = Binary URI
+description_use = Selected USE flags
+
+metadata_generated_using = GENERATED_USING
+metadata_generated_time = GENERATED_TIME
+metadata_keywords = BINARY_KEYWORDS
+metadata_src_uri = BINARY_URI
+metadata_use = USE
+
diff --git a/paludis/repositories/e/ebuild.cc b/paludis/repositories/e/ebuild.cc
index 07a925b..f60de2d 100644
--- a/paludis/repositories/e/ebuild.cc
+++ b/paludis/repositories/e/ebuild.cc
@@ -54,6 +54,7 @@
#include <sys/resource.h>
#include <sys/time.h>
#include <unistd.h>
+#include <time.h>
#include <list>
@@ -123,7 +124,7 @@ 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("EAPI", stringify(params.package_id->eapi()->name))
+ .with_setenv("EAPI", stringify(params.package_id->eapi()->exported_name))
.with_setenv("PKGMANAGER", PALUDIS_PACKAGE "-" + stringify(PALUDIS_VERSION_MAJOR) + "." +
stringify(PALUDIS_VERSION_MINOR) + "." +
stringify(PALUDIS_VERSION_MICRO) + stringify(PALUDIS_VERSION_SUFFIX) +
@@ -167,7 +168,13 @@ EbuildCommand::operator() ()
.with_setenv("PALUDIS_RDEPEND_DEFAULTS_TO_DEPEND",
params.package_id->eapi()->supported->ebuild_options->rdepend_defaults_to_depend ? "yes" : "")
.with_setenv("PALUDIS_F_FUNCTION_PREFIX",
- params.package_id->eapi()->supported->ebuild_options->f_function_prefix)
+ params.package_id->eapi()->supported->ebuild_options->f_function_prefix)
+ .with_setenv("PALUDIS_IGNORE_PIVOT_ENV_FUNCTIONS",
+ params.package_id->eapi()->supported->ebuild_options->ignore_pivot_env_functions)
+ .with_setenv("PALUDIS_IGNORE_PIVOT_ENV_VARIABLES",
+ params.package_id->eapi()->supported->ebuild_options->ignore_pivot_env_variables)
+ .with_setenv("PALUDIS_BINARY_DISTDIR_VARIABLE",
+ params.package_id->eapi()->supported->ebuild_environment_variables->env_distdir)
.with_setenv("PALUDIS_PIPE_COMMANDS_SUPPORTED", "yes")
)
.with_setenv("SLOT", "")
@@ -697,6 +704,7 @@ WriteVDBEntryCommand::operator() ()
stringify(PALUDIS_VERSION_MICRO) +
(std::string(PALUDIS_SUBVERSION_REVISION).empty() ?
std::string("") : "-r" + std::string(PALUDIS_SUBVERSION_REVISION)))
+ .with_setenv("EAPI", stringify(params.package_id->eapi()->exported_name))
.with_setenv("PALUDIS_CONFIG_DIR", SYSCONFDIR "/paludis/")
.with_setenv("PALUDIS_BASHRC_FILES", join(bashrc_files->begin(), bashrc_files->end(), " "))
.with_setenv("PALUDIS_HOOK_DIRS", join(hook_dirs->begin(), hook_dirs->end(), " "))
@@ -711,6 +719,10 @@ WriteVDBEntryCommand::operator() ()
params.package_id->eapi()->supported->ebuild_options->vdb_from_env_unless_empty_variables)
.with_setenv("PALUDIS_F_FUNCTION_PREFIX",
params.package_id->eapi()->supported->ebuild_options->f_function_prefix)
+ .with_setenv("PALUDIS_IGNORE_PIVOT_ENV_FUNCTIONS",
+ params.package_id->eapi()->supported->ebuild_options->ignore_pivot_env_functions)
+ .with_setenv("PALUDIS_IGNORE_PIVOT_ENV_VARIABLES",
+ params.package_id->eapi()->supported->ebuild_options->ignore_pivot_env_variables)
.with_pipe_command_handler(tr1::bind(&pipe_command_handler, params.environment, params.package_id, _1))
);
@@ -846,3 +858,71 @@ EbuildInfoCommand::EbuildInfoCommand(const EbuildCommandParams & p,
{
}
+WriteBinaryEbuildCommand::WriteBinaryEbuildCommand(const WriteBinaryEbuildCommandParams & p) :
+ params(p)
+{
+}
+
+void
+WriteBinaryEbuildCommand::operator() ()
+{
+ using namespace tr1::placeholders;
+
+ if (! EAPIData::get_instance()->eapi_from_string("pbin-1+" + params.package_id->eapi()->exported_name)->supported)
+ throw InstallActionError("Don't know how to write binary ebuilds using EAPI 'pbin-1+" + params.package_id->eapi()->exported_name);
+
+ std::string cookie("1." + stringify(getpid()) + "." + stringify(time(0)));
+
+ std::string bindistfile(stringify(params.destination_repository->name()) + "--" + stringify(params.package_id->name().category)
+ + "--" + stringify(params.package_id->name().package) + "-" + stringify(params.package_id->version())
+ + "--" + cookie);
+
+ std::string ebuild_cmd(getenv_with_default("PALUDIS_EBUILD_DIR", LIBEXECDIR "/paludis") +
+ "/write_binary_ebuild.bash '" +
+ stringify(params.binary_ebuild_location) + "' '" +
+ stringify(params.binary_distdir / bindistfile) + "' '" +
+ stringify(params.environment_file) + "' '" +
+ stringify(params.image) + "'");
+
+ tr1::shared_ptr<const FSEntrySequence> syncers_dirs(params.environment->syncers_dirs());
+ tr1::shared_ptr<const FSEntrySequence> bashrc_files(params.environment->bashrc_files());
+ tr1::shared_ptr<const FSEntrySequence> fetchers_dirs(params.environment->fetchers_dirs());
+ tr1::shared_ptr<const FSEntrySequence> hook_dirs(params.environment->hook_dirs());
+
+ Command cmd(Command(ebuild_cmd)
+ .with_setenv("PKGMANAGER", PALUDIS_PACKAGE "-" + stringify(PALUDIS_VERSION_MAJOR) + "." +
+ stringify(PALUDIS_VERSION_MINOR) + "." +
+ stringify(PALUDIS_VERSION_MICRO) +
+ (std::string(PALUDIS_SUBVERSION_REVISION).empty() ?
+ std::string("") : "-r" + std::string(PALUDIS_SUBVERSION_REVISION)))
+ .with_setenv("EAPI", stringify(params.package_id->eapi()->exported_name))
+ .with_setenv("PALUDIS_CONFIG_DIR", SYSCONFDIR "/paludis/")
+ .with_setenv("PALUDIS_TMPDIR", stringify(params.builddir))
+ .with_setenv("PALUDIS_BASHRC_FILES", join(bashrc_files->begin(), bashrc_files->end(), " "))
+ .with_setenv("PALUDIS_HOOK_DIRS", join(hook_dirs->begin(), hook_dirs->end(), " "))
+ .with_setenv("PALUDIS_FETCHERS_DIRS", join(fetchers_dirs->begin(), fetchers_dirs->end(), " "))
+ .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_BINARY_FROM_ENV_VARIABLES",
+ params.package_id->eapi()->supported->ebuild_options->binary_from_env_variables)
+ .with_setenv("PALUDIS_F_FUNCTION_PREFIX",
+ params.package_id->eapi()->supported->ebuild_options->f_function_prefix)
+ .with_setenv("PALUDIS_IGNORE_PIVOT_ENV_FUNCTIONS",
+ params.package_id->eapi()->supported->ebuild_options->ignore_pivot_env_functions)
+ .with_setenv("PALUDIS_IGNORE_PIVOT_ENV_VARIABLES",
+ params.package_id->eapi()->supported->ebuild_options->ignore_pivot_env_variables)
+ .with_setenv("PALUDIS_BINARY_URI_PREFIX", params.destination_repository->params().binary_uri_prefix)
+ .with_setenv("PALUDIS_BINARY_KEYWORDS", params.destination_repository->params().binary_keywords)
+ .with_setenv("PALUDIS_BINARY_KEYWORDS_VARIABLE", EAPIData::get_instance()->eapi_from_string("pbin-1+"
+ + params.package_id->eapi()->exported_name)->supported->ebuild_metadata_variables->metadata_keywords)
+ .with_setenv("PALUDIS_BINARY_DISTDIR_VARIABLE", EAPIData::get_instance()->eapi_from_string("pbin-1+"
+ + params.package_id->eapi()->exported_name)->supported->ebuild_environment_variables->env_distdir)
+ .with_pipe_command_handler(tr1::bind(&pipe_command_handler, params.environment, params.package_id, _1))
+ );
+
+ if (0 != (run_command(cmd)))
+ throw InstallActionError("Write binary command failed");
+}
+
diff --git a/paludis/repositories/e/ebuild.hh b/paludis/repositories/e/ebuild.hh
index 9101c6d..57ac3a5 100644
--- a/paludis/repositories/e/ebuild.hh
+++ b/paludis/repositories/e/ebuild.hh
@@ -1,7 +1,7 @@
/* vim: set sw=4 sts=4 et foldmethod=syntax : */
/*
- * Copyright (c) 2006, 2007 Ciaran McCreesh
+ * Copyright (c) 2006, 2007, 2008 Ciaran McCreesh
*
* 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
@@ -38,6 +38,7 @@ namespace paludis
{
class Environment;
class Command;
+ class ERepository;
namespace erepository
{
@@ -342,6 +343,32 @@ namespace paludis
};
/**
+ * Command for generating binary ebuild entries (not a regular EbuildCommand).
+ *
+ * \ingroup grpebuildinterface
+ */
+ class WriteBinaryEbuildCommand :
+ private InstantiationPolicy<WriteVDBEntryCommand, instantiation_method::NonCopyableTag>
+ {
+ protected:
+ /**
+ * Our parameters.
+ */
+ const WriteBinaryEbuildCommandParams params;
+
+ public:
+ /**
+ * Constructor.
+ */
+ WriteBinaryEbuildCommand(const WriteBinaryEbuildCommandParams &);
+
+ /**
+ * Run the command.
+ */
+ void operator() ();
+ };
+
+ /**
* Command to be run after a VDB merge.
*
* \ingroup grpebuildinterface
diff --git a/paludis/repositories/e/ebuild.sr b/paludis/repositories/e/ebuild.sr
index 9e9c3c9..930f8bd 100644
--- a/paludis/repositories/e/ebuild.sr
+++ b/paludis/repositories/e/ebuild.sr
@@ -185,6 +185,31 @@ END
allow_named_args
}
+make_class_WriteBinaryEbuildCommandParams()
+{
+ key environment "const Environment *"
+ key destination_repository "const ERepository *"
+ key package_id "tr1::shared_ptr<const erepository::ERepositoryID>"
+ key binary_ebuild_location "FSEntry"
+ key binary_distdir "FSEntry"
+ key environment_file "FSEntry"
+ key image "FSEntry"
+ key rewrite_symlinks "bool"
+ key builddir FSEntry
+
+ doxygen_comment << "END"
+ /**
+ * Parameters for writing a binary ebuild.
+ *
+ * \see WriteBinaryEbuildCommand
+ * \ingroup grpebuildinterface
+ * \nosubgrouping
+ */
+END
+
+ allow_named_args
+}
+
make_class_VDBPostMergeCommandParams()
{
key root "FSEntry"
diff --git a/paludis/repositories/e/ebuild/Makefile.am b/paludis/repositories/e/ebuild/Makefile.am
index cfea137..0287d4a 100644
--- a/paludis/repositories/e/ebuild/Makefile.am
+++ b/paludis/repositories/e/ebuild/Makefile.am
@@ -1,12 +1,13 @@
MAINTAINERCLEANFILES = Makefile.in
CLEANFILES = *~
-SUBDIRS = . 0 1 exheres-0 paludis-1 utils
+SUBDIRS = . 0 1 exheres-0 paludis-1 pbin-1 utils
AM_CXXFLAGS = -I$(top_srcdir) @PALUDIS_CXXFLAGS@
libexecprogdir = $(libexecdir)/paludis/
libexecprog_SCRIPTS = \
+ binary_functions.bash \
build_functions.bash \
die_functions.bash \
ebuild.bash \
@@ -17,7 +18,8 @@ libexecprog_SCRIPTS = \
sandbox.bash \
source_functions.bash \
usage_error.bash \
- write_vdb_entry.bash
+ write_vdb_entry.bash \
+ write_binary_ebuild.bash
TESTS_ENVIRONMENT = env \
PALUDIS_EBUILD_DIR="$(top_srcdir)/paludis/repositories/e/ebuild/" \
diff --git a/paludis/repositories/e/ebuild/binary_functions.bash b/paludis/repositories/e/ebuild/binary_functions.bash
new file mode 100644
index 0000000..3d05d78
--- /dev/null
+++ b/paludis/repositories/e/ebuild/binary_functions.bash
@@ -0,0 +1,79 @@
+#!/bin/bash
+# vim: set sw=4 sts=4 et :
+
+# Copyright (c) 2008 Ciaran McCreesh
+#
+# 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
+
+make_binary_tarball()
+{
+ local imagedir="${1}" envfile="${2}" bindistfile="${3}"
+ local tmpdir="${PALUDIS_TMPDIR}/pbin-$(basename "${bindistfile}" )"
+
+ echo tar cvf "${bindistfile}".tar --files-from /dev/null 1>&2
+ tar cvf "${bindistfile}".tar --files-from /dev/null || die "making tarball failed"
+
+ echo find "${imagedir}" -mindepth 1 -maxdepth 1 -printf '%f\0' \| \
+ xargs -0 tar rpvf "${bindistfile}".tar -C "${imagedir}" 1>&2
+ find "${imagedir}" -mindepth 1 -maxdepth 1 -printf '%f\0' | \
+ xargs -0 tar rpvf "${bindistfile}".tar -C "${imagedir}" \
+ || die "adding image to tarball failed"
+
+ echo rm -fr "${tmpdir}" 1>&2
+ rm -fr "${tmpdir}"
+
+ echo mkdir "${tmpdir}" 1>&2
+ mkdir "${tmpdir}" || die "mkdir ${tmpdir} failed"
+
+ echo mkdir "${tmpdir}"/PBIN 1>&2
+ mkdir "${tmpdir}"/PBIN 1>&2
+
+ echo bzip2 \< "${envfile}" \> "${tmpdir}/PBIN/environment.bz2" 1>&2
+ bzip2 < "${envfile}" > "${tmpdir}/PBIN/environment.bz2"
+
+ echo "tar rvf "${bindistfile}".tar -C "${tmpdir}" 'PBIN'" 1>&2
+ tar rvf "${bindistfile}".tar -C "${tmpdir}" 'PBIN' || die "adding env to tarball failed"
+
+ echo bzip2 "${bindistfile}".tar 1>&2
+ bzip2 "${bindistfile}".tar || die "compressing tarball failed"
+}
+
+make_binary_ebuild()
+{
+ local ebuildfile="${1}" bin_uri="${2}" binary_keywords="${3}"
+
+ export GENERATED_TIME=$(date +%s )
+ export GENERATED_USING=${PKGMANAGER}
+ export BINARY_URI="${bin_uri}"
+ export EAPI="pbin-1+${EAPI}"
+ echo export ${PALUDIS_BINARY_KEYWORDS_VARIABLE}="${binary_keywords}" 1>&2
+ export ${PALUDIS_BINARY_KEYWORDS_VARIABLE}="${binary_keywords}"
+
+ echo "# Created by $PKGMANAGER on $(date )" > ${ebuildfile} || die "Couldn't write ${ebuildfile}"
+
+ local p
+ for p in ${PALUDIS_BINARY_FROM_ENV_VARIABLES} ; do
+ set -o noglob
+ local k=${!p}
+ k=${k//\\/\\\\}
+ k=${k//\"/\\\"}
+ # {"} fix vim syntax highlighting
+ k=${k//\$/\\\$}
+ echo "${p}=\""${k}"\"" >> "${ebuildfile}"
+ set +o noglob
+ done
+
+ sed -e 's,^, ,' < ${ebuildfile}
+}
+
diff --git a/paludis/repositories/e/ebuild/ebuild.bash b/paludis/repositories/e/ebuild/ebuild.bash
index d9cd3a7..6ad2791 100755
--- a/paludis/repositories/e/ebuild/ebuild.bash
+++ b/paludis/repositories/e/ebuild/ebuild.bash
@@ -31,10 +31,11 @@ eval unset LANG ${!LC_*}
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 PLATFORMS E_PLATFORMS \
- MYOPTIONS E_MYOPTIONS E_DEPENDENCIES"
+ MYOPTIONS E_MYOPTIONS E_DEPENDENCIES BINARY_KEYWORDS BINARY_URI \
+ GENERATED_USING GENERATED_TIME BINARY_PLATFORMS"
unset -v ${EBUILD_METADATA_VARIABLES} ${PALUDIS_EBUILD_MUST_NOT_SET_VARIABLES}
# These can be set by C++
-EBUILD_METADATA_VARIABLES="${EBUILD_METADATA_VARIABLES} SLOT EAPI"
+EBUILD_METADATA_VARIABLES="${EBUILD_METADATA_VARIABLES} SLOT EAPI OPTIONS USE"
if [[ -z "${PALUDIS_DO_NOTHING_SANDBOXY}" ]] ; then
export SANDBOX_PREDICT="${SANDBOX_PREDICT+${SANDBOX_PREDICT}:}"
@@ -264,6 +265,11 @@ ebuild_scrub_environment()
unset -f diefunc perform_hook inherit builtin_loadenv builtin_saveenv
unset -f ebuild_safe_source portageq best_version has_version paludis_pipe_command
+ if [[ "${2}" == "--pivot" ]] ; then
+ unset -f ${PALUDIS_IGNORE_PIVOT_ENV_FUNCTIONS}
+ unset -v ${PALUDIS_IGNORE_PIVOT_ENV_VARIABLES}
+ fi
+
unset -v ROOTPATH T HOME TMPDIR PALUDIS_TMPDIR PALUDIS_EBUILD_LOG_LEVEL
unset -v PORTDIR FILESDIR ECLASSDIR DISTDIR PALUDIS_EBUILD_DIR
unset -v PALUDIS_EXTRA_DIE_MESSAGE PALUDIS_COMMAND SKIP_FUNCTIONS
@@ -333,8 +339,8 @@ ebuild_load_environment()
|| die "Can't copy ${PALUDIS_LOAD_ENVIRONMENT}"
fi
- echo ebuild_scrub_environment "${PALUDIS_TMPDIR}/environment-${CATEGORY}-${PF}-$$" 1>&2
- ebuild_scrub_environment "${PALUDIS_TMPDIR}/environment-${CATEGORY}-${PF}-$$" \
+ echo ebuild_scrub_environment "${PALUDIS_TMPDIR}/environment-${CATEGORY}-${PF}-$$" "$@" 1>&2
+ ebuild_scrub_environment "${PALUDIS_TMPDIR}/environment-${CATEGORY}-${PF}-$$" "$@" \
|| die "Can't load saved environment for cleaning"
echo ebuild_safe_source "${PALUDIS_TMPDIR}/environment-${CATEGORY}-${PF}-$$" 1>&2
@@ -436,7 +442,7 @@ ebuild_main()
for action in $@ ; do
case ${action} in
metadata|variable|init|prepare|merge|unmerge|tidyup|\
- strip|loadenv|saveenv|initbin|unpackbin|infovars)
+ strip|loadenv|saveenv|initbin|unpackbin|infovars|pivotbin|installbin)
ebuild_load_module builtin_${action}
;;
diff --git a/paludis/repositories/e/ebuild/pbin-1/Makefile.am b/paludis/repositories/e/ebuild/pbin-1/Makefile.am
new file mode 100644
index 0000000..f0c07de
--- /dev/null
+++ b/paludis/repositories/e/ebuild/pbin-1/Makefile.am
@@ -0,0 +1,38 @@
+MAINTAINERCLEANFILES = Makefile.in
+CLEANFILES = *~
+SUBDIRS = .
+
+libexecprogpaludisbinary1dir = $(libexecdir)/paludis/pbin-1
+libexecprogpaludisbinary1_SCRIPTS = \
+ builtin_installbin.bash \
+ builtin_pivotbin.bash
+
+TESTS_ENVIRONMENT = env \
+ PALUDIS_EBUILD_DIR="$(top_srcdir)/paludis/repositories/e/ebuild/" \
+ PALUDIS_EBUILD_DIR_FALLBACK="`$(top_srcdir)/paludis/repositories/e/ebuild/utils/canonicalise $(top_builddir)/paludis/repositories/e/ebuild/`" \
+ PALUDIS_EBUILD_MODULE_SUFFIXES="1 0" \
+ PALUDIS_EAPIS_DIR="$(top_srcdir)/paludis/eapis/" \
+ PALUDIS_DISTRIBUTIONS_DIR="$(top_srcdir)/paludis/distributions/" \
+ PALUDIS_DISTRIBUTION="gentoo" \
+ 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
+
+EXTRA_DIST = $(libexecprogpaludisbinary1_SCRIPTS)
+
+TESTS =
+check_SCRIPTS = $(TESTS)
+
+built-sources : $(BUILT_SOURCES)
+ for s in `echo $(SUBDIRS) | tr -d .` ; do $(MAKE) -C $$s built-sources || exit 1 ; done
+
+distcheck-deps-local : $(DISTCHECK_DEPS)
+
+distcheck-deps : distcheck-deps-subdirs
+
+distcheck-deps-subdirs :
+ for s in $(SUBDIRS) . ; do if test x$$s = x. ; then $(MAKE) distcheck-deps-local || exit 1 ; \
+ else $(MAKE) -C $$s distcheck-deps || exit 1 ; fi ; done
+
+
diff --git a/paludis/repositories/e/ebuild/pbin-1/builtin_installbin.bash b/paludis/repositories/e/ebuild/pbin-1/builtin_installbin.bash
new file mode 100644
index 0000000..1e3368d
--- /dev/null
+++ b/paludis/repositories/e/ebuild/pbin-1/builtin_installbin.bash
@@ -0,0 +1,47 @@
+#!/bin/bash
+# vim: set sw=4 sts=4 et :
+
+# Copyright (c) 2008 Ciaran McCreesh
+#
+# 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_installbin()
+{
+ echo tar jvxpf ${!PALUDIS_BINARY_DISTDIR_VARIABLE}/${A} -C "${IMAGE}"/ --exclude PBIN 1>&2
+ tar jvxpf ${!PALUDIS_BINARY_DISTDIR_VARIABLE}/${A} -C "${IMAGE}"/ --exclude PBIN || die "Couldn't extract image"
+}
+
+generic_internal_installbin()
+{
+ if hasq "installbin" ${RESTRICT} ; then
+ ebuild_section "Skipping builtin_installbin (RESTRICT)"
+ elif hasq "init" ${SKIP_FUNCTIONS} ; then
+ ebuild_section "Skipping builtin_installbin (SKIP_FUNCTIONS)"
+ else
+ ebuild_section "Starting builtin_installbin"
+ builtin_installbin
+ ebuild_section "Done builtin_installbin"
+ fi
+}
+
+ebuild_f_installbin()
+{
+ generic_internal_installbin "$@"
+}
+
+exheres_internal_installbin()
+{
+ generic_internal_installbin "$@"
+}
+
diff --git a/paludis/repositories/e/ebuild/pbin-1/builtin_pivotbin.bash b/paludis/repositories/e/ebuild/pbin-1/builtin_pivotbin.bash
new file mode 100644
index 0000000..5f8152a
--- /dev/null
+++ b/paludis/repositories/e/ebuild/pbin-1/builtin_pivotbin.bash
@@ -0,0 +1,57 @@
+#!/bin/bash
+# vim: set sw=4 sts=4 et :
+
+# Copyright (c) 2008 Ciaran McCreesh
+#
+# 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_pivotbin()
+{
+ [[ -z "${T}" ]] || [[ ! -d "${T}" ]] && die "Can't use \$T=$T"
+
+ ebuild_section "Extracting package environment"
+ echo tar jxvf "${DISTDIR}"/"${A}" -C "${T}" --strip-components 1 PBIN/environment.bz2 1>&2
+ tar jxvf "${DISTDIR}"/"${A}" -C "${T}" --strip-components 1 PBIN/environment.bz2 || die "Couldn't extract env"
+
+ ebuild_section "Switching to package environment"
+ export PALUDIS_LOAD_ENVIRONMENT="${T}/environment.bz2"
+ ebuild_load_environment --pivot
+ export EAPI="${EAPI#pbin-1+}"
+
+ ebuild_section "Continuing using package environment"
+}
+
+generic_internal_pivotbin()
+{
+ if hasq "pivotbin" ${RESTRICT} ; then
+ ebuild_section "Skipping builtin_pivotbin (RESTRICT)"
+ elif hasq "init" ${SKIP_FUNCTIONS} ; then
+ ebuild_section "Skipping builtin_pivotbin (SKIP_FUNCTIONS)"
+ else
+ ebuild_section "Starting builtin_pivotbin"
+ builtin_pivotbin
+ ebuild_section "Done builtin_pivotbin"
+ fi
+}
+
+ebuild_f_pivotbin()
+{
+ generic_internal_pivotbin "$@"
+}
+
+exheres_internal_pivotbin()
+{
+ generic_internal_pivotbin "$@"
+}
+
diff --git a/paludis/repositories/e/ebuild/source_functions.bash b/paludis/repositories/e/ebuild/source_functions.bash
index 2975ab6..35d0772 100755
--- a/paludis/repositories/e/ebuild/source_functions.bash
+++ b/paludis/repositories/e/ebuild/source_functions.bash
@@ -26,7 +26,8 @@ ebuild_safe_source()
EUID PPID UID FUNCNAME GROUPS SHELLOPTS \
'BASH_@(ARGC|ARGV|LINENO|SOURCE|VERSINFO|REMATCH)' \
'BASH_COMPLETEION?(_DIR)' 'bash+([0-9])?([a-z])' \
- EBUILD_KILL_PID PALUDIS_LOADSAVEENV_DIR PALUDIS_DO_NOTHING_SANDBOXY SANDBOX_ACTIVE
+ EBUILD_KILL_PID PALUDIS_LOADSAVEENV_DIR PALUDIS_DO_NOTHING_SANDBOXY SANDBOX_ACTIVE \
+ PALUDIS_IGNORE_PIVOT_ENV_FUNCTIONS PALUDIS_IGNORE_PIVOT_ENV_VARIABLES
trap DEBUG
set -T
diff --git a/paludis/repositories/e/ebuild/write_binary_ebuild.bash b/paludis/repositories/e/ebuild/write_binary_ebuild.bash
new file mode 100644
index 0000000..db0f257
--- /dev/null
+++ b/paludis/repositories/e/ebuild/write_binary_ebuild.bash
@@ -0,0 +1,134 @@
+#!/bin/bash
+# vim: set sw=4 sts=4 et :
+
+# Copyright (c) 2006, 2007, 2008 Ciaran McCreesh
+#
+# 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
+
+unalias -a
+set +C
+unset GZIP BZIP BZIP2 CDPATH GREP_OPTIONS GREP_COLOR GLOBIGNORE
+eval unset LANG ${!LC_*}
+
+shopt -s expand_aliases
+shopt -s extglob
+
+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
+
+# Force a few more things into PATH, since some users have crazy setups.
+# See ticket:374.
+export PATH="${PATH}:/bin:/sbin:/usr/bin:/usr/sbin"
+
+EBUILD_MODULES_DIR=$(canonicalise $(dirname $0 ) )
+if ! [[ -d ${EBUILD_MODULES_DIR} ]] ; then
+ echo "${EBUILD_MODULES_DIR} is not a directory" 1>&2
+ exit 123
+fi
+
+[[ -z "${PALUDIS_EBUILD_MODULE_SUFFIXES}" ]] && PALUDIS_EBUILD_MODULE_SUFFIXES=0
+for p in ${PALUDIS_EBUILD_MODULE_SUFFIXES}; do
+ EBUILD_MODULES_DIRS="${EBUILD_MODULES_DIRS} ${EBUILD_MODULES_DIR}/${p}"
+done
+for p in ${PALUDIS_EXTRA_EBUILD_MODULES_DIRS} ; do
+ EBUILD_MODULES_DIRS="${EBUILD_MODULES_DIRS} ${p}"
+done
+EBUILD_MODULES_DIRS="${EBUILD_MODULES_DIRS} ${EBUILD_MODULES_DIR}"
+
+export PALUDIS_EBUILD_MODULES_DIR="${EBUILD_MODULES_DIR}"
+
+ebuild_load_module()
+{
+ for d in ${EBUILD_MODULES_DIRS}; do
+ if [[ -f "${d}/${1}.bash" ]]; then
+ if ! source "${d}/${1}.bash"; then
+ type die &>/dev/null && eval die "\"Error loading module \${1}\""
+ echo "Error loading module ${1}" 1>&2
+ exit 123
+ fi
+ return
+ fi
+ done
+ type die &>/dev/null && eval die "\"Couldn't find module \${1}\""
+ echo "Couldn't find module ${1}" 1>&2
+ exit 123
+}
+
+ebuild_load_module die_functions
+ebuild_load_module 0/output_functions
+ebuild_load_module echo_functions
+ebuild_load_module source_functions
+ebuild_load_module binary_functions
+
+export PALUDIS_HOME="$(canonicalise ${PALUDIS_HOME:-${HOME}} )"
+
+main()
+{
+ local ebuildfile="${1}" bindistfile="${2}" envfile="${3}" imagedir="${4}"
+
+ if ! [[ -d $(dirname "${ebuildfile}" ) ]] ; then
+ die "dirname(ebuildfile) \"$(dirname "${ebuildfile}" )\" is not a directory"
+ fi
+
+ if [[ -e "${ebuildfile}" ]] && ! [[ -f "${ebuildfile}" ]] ; then
+ die "ebuildfile \"${ebuildfile}\" exists and is not a regular file"
+ fi
+
+ if ! [[ -d $(dirname "${bindistfile}" ) ]] ; then
+ die "dirname(bindistfile) \"$(dirname "${bindistfile}" )\" is not a directory"
+ fi
+
+ if [[ -e "${bindistfile}".tar ]] ; then
+ die "bindistfile \"${bindistfile}.tar\" already exists, not overwriting"
+ fi
+
+ if [[ -e "${bindistfile}".tar.bz2 ]] ; then
+ die "bindistfile \"${bindistfile}.tar.bz2\" already exists, not overwriting"
+ fi
+
+ if ! [[ -f "${envfile}" ]] ; then
+ die "envfile \"${envfile}\" is not a file"
+ fi
+
+ if ! [[ -d "${imagedir}" ]] ; then
+ die "imagedir \"${imagedir}\" is not a directory"
+ fi
+
+ ebuild_section "Writing binary tarball to '${bindistfile}.tar.bz2'..."
+
+ make_binary_tarball "${imagedir}" "${envfile}" "${bindistfile}"
+
+ ebuild_section "Loading saved environment..."
+
+ ebuild_safe_source ${envfile}
+
+ ebuild_section "Writing binary ebuild to '${ebuildfile}'..."
+
+ make_binary_ebuild \
+ "${ebuildfile}" \
+ "${PALUDIS_BINARY_URI_PREFIX}""$(basename ${bindistfile} ).tar.bz2" \
+ "${PALUDIS_BINARY_KEYWORDS}"
+
+ ebuild_section "Finished writing binary"
+
+ true
+}
+
+main $@
+
diff --git a/paludis/repositories/e/ebuild_entries.cc b/paludis/repositories/e/ebuild_entries.cc
index 30bf258..4b902ba 100644
--- a/paludis/repositories/e/ebuild_entries.cc
+++ b/paludis/repositories/e/ebuild_entries.cc
@@ -1,7 +1,7 @@
/* vim: set sw=4 sts=4 et foldmethod=syntax : */
/*
- * Copyright (c) 2005, 2006, 2007 Ciaran McCreesh
+ * Copyright (c) 2005, 2006, 2007, 2008 Ciaran McCreesh
*
* 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
@@ -725,9 +725,35 @@ EbuildEntries::make_ebuild_entries(
}
void
-EbuildEntries::merge(const MergeOptions &)
+EbuildEntries::merge(const MergeOptions & m)
{
- throw InternalError(PALUDIS_HERE, "Cannot merge to ERepository with ebuild entries");
+ Context context("When merging '" + stringify(*m.package_id) + "' at '" + stringify(m.image_dir)
+ + "' to E repository '" + stringify(_imp->e_repository->name()) + "':");
+
+ if (! _imp->e_repository->is_suitable_destination_for(*m.package_id))
+ throw InstallActionError("Not a suitable destination for '" + stringify(*m.package_id) + "'");
+
+ FSEntry binary_ebuild_location(_imp->e_repository->layout()->binary_ebuild_location(
+ m.package_id->name(), m.package_id->version(),
+ "pbin-1+" + tr1::static_pointer_cast<const ERepositoryID>(m.package_id)->eapi()->name));
+
+ binary_ebuild_location.dirname().dirname().mkdir();
+ binary_ebuild_location.dirname().mkdir();
+
+ WriteBinaryEbuildCommand write_binary_ebuild_command(
+ WriteBinaryEbuildCommandParams::create()
+ .environment(_imp->params.environment)
+ .package_id(tr1::static_pointer_cast<const ERepositoryID>(m.package_id))
+ .binary_ebuild_location(binary_ebuild_location)
+ .binary_distdir(_imp->params.binary_distdir)
+ .environment_file(m.environment_file)
+ .image(m.image_dir)
+ .destination_repository(_imp->e_repository)
+ .builddir(_imp->params.builddir)
+ .rewrite_symlinks(tr1::static_pointer_cast<const ERepositoryID>(m.package_id)
+ ->eapi()->supported->ebuild_options->merge_rewrite_symlinks));
+
+ write_binary_ebuild_command();
}
bool
@@ -821,3 +847,12 @@ EbuildEntries::get_package_file_manifest_key(const FSEntry & f, const QualifiedP
return "EXHERES";
}
+std::string
+EbuildEntries::binary_ebuild_name(const QualifiedPackageName & q, const VersionSpec & v, const std::string & e) const
+{
+ if (_imp->e_repository->layout()->eapi_ebuild_suffix())
+ return stringify(q.package) + "-" + stringify(v) + "." + e;
+ else
+ return stringify(q.package) + "-" + stringify(v) + ".ebuild";
+}
+
diff --git a/paludis/repositories/e/ebuild_entries.hh b/paludis/repositories/e/ebuild_entries.hh
index 4c629f5..ba6e3bc 100644
--- a/paludis/repositories/e/ebuild_entries.hh
+++ b/paludis/repositories/e/ebuild_entries.hh
@@ -1,7 +1,7 @@
/* vim: set sw=4 sts=4 et foldmethod=syntax : */
/*
- * Copyright (c) 2006, 2007 Ciaran McCreesh
+ * Copyright (c) 2006, 2007, 2008 Ciaran McCreesh
*
* 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
@@ -64,7 +64,7 @@ namespace paludis
///\}
- virtual void merge(const MergeOptions &) PALUDIS_ATTRIBUTE((noreturn));
+ virtual void merge(const MergeOptions &);
virtual bool is_package_file(const QualifiedPackageName &, const FSEntry &) const
PALUDIS_ATTRIBUTE((warn_unused_result));
@@ -92,6 +92,9 @@ namespace paludis
tr1::shared_ptr<const ERepositoryProfile>) const;
virtual std::string get_package_file_manifest_key(const FSEntry &, const QualifiedPackageName &) const;
+
+ virtual std::string binary_ebuild_name(const QualifiedPackageName &, const VersionSpec &, const std::string &) const
+ PALUDIS_ATTRIBUTE((warn_unused_result));
};
}
}
diff --git a/paludis/repositories/e/exheres_layout.cc b/paludis/repositories/e/exheres_layout.cc
index 666d3e8..dde7108 100644
--- a/paludis/repositories/e/exheres_layout.cc
+++ b/paludis/repositories/e/exheres_layout.cc
@@ -1,7 +1,7 @@
/* vim: set sw=4 sts=4 et foldmethod=syntax : */
/*
- * Copyright (c) 2007 Ciaran McCreesh
+ * Copyright (c) 2007, 2008 Ciaran McCreesh
*
* 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
@@ -575,3 +575,11 @@ ExheresLayout::invalidate_masks()
it2_end != it2; ++it2)
(*it2)->invalidate_masks();
}
+
+FSEntry
+ExheresLayout::binary_ebuild_location(const QualifiedPackageName & q, const VersionSpec & v,
+ const std::string & eapi) const
+{
+ return package_directory(q) / _imp->entries->binary_ebuild_name(q, v, eapi);
+}
+
diff --git a/paludis/repositories/e/exheres_layout.hh b/paludis/repositories/e/exheres_layout.hh
index 59c3071..3b8669a 100644
--- a/paludis/repositories/e/exheres_layout.hh
+++ b/paludis/repositories/e/exheres_layout.hh
@@ -1,7 +1,7 @@
/* vim: set sw=4 sts=4 et foldmethod=syntax : */
/*
- * Copyright (c) 2007 Ciaran McCreesh
+ * Copyright (c) 2007, 2008 Ciaran McCreesh
*
* 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
@@ -88,6 +88,10 @@ namespace paludis
virtual FSEntry package_file(const PackageID &) const
PALUDIS_ATTRIBUTE((warn_unused_result));
+ virtual FSEntry binary_ebuild_location(const QualifiedPackageName &, const VersionSpec &,
+ const std::string & eapi) const
+ PALUDIS_ATTRIBUTE((warn_unused_result));
+
virtual tr1::shared_ptr<const FSEntrySequence> arch_list_files() const
PALUDIS_ATTRIBUTE((warn_unused_result));
diff --git a/paludis/repositories/e/layout.hh b/paludis/repositories/e/layout.hh
index f6d8fb2..486c026 100644
--- a/paludis/repositories/e/layout.hh
+++ b/paludis/repositories/e/layout.hh
@@ -1,7 +1,7 @@
/* vim: set sw=4 sts=4 et foldmethod=syntax : */
/*
- * Copyright (c) 2005, 2006, 2007 Ciaran McCreesh
+ * Copyright (c) 2005, 2006, 2007, 2008 Ciaran McCreesh
* Copyright (c) 2006 Danny van Dyk
*
* This file is part of the Paludis package manager. Paludis is free software;
@@ -108,6 +108,10 @@ namespace paludis
virtual FSEntry package_file(const PackageID &) const
PALUDIS_ATTRIBUTE((warn_unused_result)) = 0;
+ virtual FSEntry binary_ebuild_location(const QualifiedPackageName &, const VersionSpec &,
+ const std::string & eapi) const
+ PALUDIS_ATTRIBUTE((warn_unused_result)) = 0;
+
virtual tr1::shared_ptr<const FSEntrySequence> arch_list_files() const
PALUDIS_ATTRIBUTE((warn_unused_result)) = 0;
diff --git a/paludis/repositories/e/make_ebuild_repository.cc b/paludis/repositories/e/make_ebuild_repository.cc
index febc375..5de781a 100644
--- a/paludis/repositories/e/make_ebuild_repository.cc
+++ b/paludis/repositories/e/make_ebuild_repository.cc
@@ -1,7 +1,7 @@
/* vim: set sw=4 sts=4 et foldmethod=syntax : */
/*
- * Copyright (c) 2006, 2007 Ciaran McCreesh
+ * Copyright (c) 2006, 2007, 2008 Ciaran McCreesh
*
* 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
@@ -249,6 +249,28 @@ paludis::make_ebuild_repository(
use_manifest = destringify<erepository::UseManifest>(m->find("use_manifest")->second);
}
+ bool binary_destination(false);
+ if (m->end() != m->find("binary_destination") && ! m->find("binary_destination")->second.empty())
+ {
+ Context item_context("When handling binary_destination key:");
+ binary_destination = destringify<bool>(m->find("binary_destination")->second);
+ }
+
+ std::string binary_uri_prefix;
+ if (m->end() != m->find("binary_uri_prefix"))
+ binary_uri_prefix = m->find("binary_uri_prefix")->second;
+
+ std::string binary_distdir;
+ if (m->end() == m->find("binary_distdir") || ((binary_distdir = m->find("binary_distdir")->second)).empty())
+ binary_distdir = distdir;
+
+ std::string binary_keywords;
+ if (m->end() == m->find("binary_keywords") || ((binary_keywords = m->find("binary_keywords")->second)).empty())
+ {
+ if (binary_destination)
+ throw ERepositoryConfigurationError("binary_destination = true, but binary_keywords is unset or empty");
+ }
+
return tr1::shared_ptr<ERepository>(new ERepository(ERepositoryParams::create()
.entry_format("ebuild")
.layout(layout)
@@ -266,7 +288,6 @@ paludis::make_ebuild_repository(
.sync(sync)
.sync_options(sync_options)
.master_repository(master_repository)
- .enable_destinations(false)
.write_bin_uri_prefix("")
.eapi_when_unknown(eapi_when_unknown)
.eapi_when_unspecified(eapi_when_unspecified)
@@ -274,6 +295,10 @@ paludis::make_ebuild_repository(
.use_manifest(use_manifest)
.append_repository_name_to_write_cache(append_repository_name_to_write_cache)
.ignore_deprecated_profiles(ignore_deprecated_profiles)
+ .binary_destination(binary_destination)
+ .binary_uri_prefix(binary_uri_prefix)
+ .binary_distdir(binary_distdir)
+ .binary_keywords(binary_keywords)
.builddir(builddir)));
}
diff --git a/paludis/repositories/e/traditional_layout.cc b/paludis/repositories/e/traditional_layout.cc
index 986b2fe..e3aca65 100644
--- a/paludis/repositories/e/traditional_layout.cc
+++ b/paludis/repositories/e/traditional_layout.cc
@@ -1,7 +1,7 @@
/* vim: set sw=4 sts=4 et foldmethod=syntax : */
/*
- * Copyright (c) 2005, 2006, 2007 Ciaran McCreesh
+ * Copyright (c) 2005, 2006, 2007, 2008 Ciaran McCreesh
* Copyright (c) 2006 Danny van Dyk
*
* This file is part of the Paludis package manager. Paludis is free software;
@@ -598,3 +598,11 @@ TraditionalLayout::invalidate_masks()
it2_end != it2; ++it2)
(*it2)->invalidate_masks();
}
+
+FSEntry
+TraditionalLayout::binary_ebuild_location(const QualifiedPackageName & q, const VersionSpec & v,
+ const std::string & eapi) const
+{
+ return package_directory(q) / _imp->entries->binary_ebuild_name(q, v, eapi);
+}
+
diff --git a/paludis/repositories/e/traditional_layout.hh b/paludis/repositories/e/traditional_layout.hh
index c40993a..f53c7b8 100644
--- a/paludis/repositories/e/traditional_layout.hh
+++ b/paludis/repositories/e/traditional_layout.hh
@@ -1,7 +1,7 @@
/* vim: set sw=4 sts=4 et foldmethod=syntax : */
/*
- * Copyright (c) 2005, 2006, 2007 Ciaran McCreesh
+ * Copyright (c) 2005, 2006, 2007, 2008 Ciaran McCreesh
* Copyright (c) 2006 Danny van Dyk
*
* This file is part of the Paludis package manager. Paludis is free software;
@@ -89,6 +89,10 @@ namespace paludis
virtual FSEntry package_file(const PackageID &) const
PALUDIS_ATTRIBUTE((warn_unused_result));
+ virtual FSEntry binary_ebuild_location(const QualifiedPackageName &, const VersionSpec &,
+ const std::string & eapi) const
+ PALUDIS_ATTRIBUTE((warn_unused_result));
+
virtual tr1::shared_ptr<const FSEntrySequence> arch_list_files() const
PALUDIS_ATTRIBUTE((warn_unused_result));
diff --git a/vim/syntax/paludis-repositories-conf.vim b/vim/syntax/paludis-repositories-conf.vim
index 546657e..f3218ba 100644
--- a/vim/syntax/paludis-repositories-conf.vim
+++ b/vim/syntax/paludis-repositories-conf.vim
@@ -1,7 +1,7 @@
" Vim syntax file
" Language: Paludis repositories/*.conf files
" Author: Ciaran McCreesh
-" Copyright: Copyright (c) 2007 Ciaran McCreesh
+" Copyright: Copyright (c) 2007, 2008 Ciaran McCreesh
" Licence: You may redistribute this under the same terms as Vim itself
"
" Syntax highlighting for Paludis repositories/*.conf files.
@@ -43,6 +43,8 @@ syn keyword PaludisRepositoriesConfKnownKey contained
\ master_repository profiles pkgdir setsdir securitydir newsdir
\ names_cache sync sync_options eclassdirs cache write_cache
\ world provides_cache importance layout use_manifest
+ \ binary_uri_prefix binary_keywords binary_destination
+ \ eapi_when_unspecified eapi_when_unknown profile_eapi
syn keyword PaludisRepositoriesConfKnownValue contained
\ use require ignore