aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2008-01-18 19:02:39 +0000
committerAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2008-01-18 19:02:39 +0000
commit05c738433d2df51309dbce5c57cb9999e6eafef4 (patch)
tree41b11c30ab77d0911888951548f55cbe5d4815f1
parentcffc399f3d2e091f2c0971a054374f9f233bd896 (diff)
downloadpaludis-05c738433d2df51309dbce5c57cb9999e6eafef4.tar.gz
paludis-05c738433d2df51309dbce5c57cb9999e6eafef4.tar.xz
Kill old ebin code
-rw-r--r--paludis/repositories/e/Makefile.am31
-rw-r--r--paludis/repositories/e/e_repository_entries.cc6
-rw-r--r--paludis/repositories/e/e_repository_entries.hh4
-rw-r--r--paludis/repositories/e/ebin.cc305
-rw-r--r--paludis/repositories/e/ebin.hh202
-rw-r--r--paludis/repositories/e/ebin.se25
-rw-r--r--paludis/repositories/e/ebin.sr89
-rw-r--r--paludis/repositories/e/ebin_entries.cc479
-rw-r--r--paludis/repositories/e/ebin_entries.hh82
-rw-r--r--paludis/repositories/e/ebuild/0/Makefile.am2
-rw-r--r--paludis/repositories/e/ebuild/0/builtin_initbin.bash90
-rw-r--r--paludis/repositories/e/ebuild/0/builtin_unpackbin.bash40
-rw-r--r--paludis/repositories/e/make_ebin_repository.cc224
-rw-r--r--paludis/repositories/e/make_ebin_repository.hh52
-rw-r--r--paludis/repositories/e/registration.cc4
-rw-r--r--paludis/repositories/e/vdb_repository.cc4
16 files changed, 6 insertions, 1633 deletions
diff --git a/paludis/repositories/e/Makefile.am b/paludis/repositories/e/Makefile.am
index 1784388..d303c7e 100644
--- a/paludis/repositories/e/Makefile.am
+++ b/paludis/repositories/e/Makefile.am
@@ -6,7 +6,6 @@ DISTCLEANFILES = \
e_repository_params-se.hh e_repository_params-se.cc \
vdb_repository-sr.hh vdb_repository-sr.cc \
ebuild-sr.hh ebuild-sr.cc \
- ebin-sr.hh ebin-sr.cc ebin-se.hh ebin-se.cc \
vdb_merger-sr.hh vdb_merger-sr.cc \
vdb_unmerger-sr.hh vdb_unmerger-sr.cc \
eapi-sr.hh eapi-sr.cc \
@@ -61,10 +60,6 @@ paludis_repositories_e_include_HEADERS = \
eapi-sr.hh \
eapi-fwd.hh \
eapi_phase.hh \
- ebin-se.hh \
- ebin-sr.hh \
- ebin.hh \
- ebin_entries.hh \
ebuild-sr.hh \
ebuild.hh \
ebuild_entries.hh \
@@ -76,7 +71,6 @@ paludis_repositories_e_include_HEADERS = \
glsa-sr.hh \
glsa.hh \
layout.hh \
- make_ebin_repository.hh \
make_ebuild_repository.hh \
manifest2_entry-sr.hh \
manifest2_reader.hh \
@@ -116,8 +110,6 @@ libpaludiserepository_la_SOURCES = \
e_repository_sets.cc \
eapi.cc \
eapi_phase.cc \
- ebin.cc \
- ebin_entries.cc \
ebuild.cc \
ebuild_entries.cc \
ebuild_flat_metadata_cache.cc \
@@ -127,7 +119,6 @@ libpaludiserepository_la_SOURCES = \
fetch_visitor.cc \
glsa.cc \
layout.cc \
- make_ebin_repository.cc \
make_ebuild_repository.cc \
manifest2_reader.cc \
distfiles_size_visitor.cc \
@@ -298,12 +289,6 @@ EXTRA_DIST = \
ebuild.sr \
ebuild-sr.hh \
ebuild-sr.cc \
- ebin.sr \
- ebin-sr.hh \
- ebin-sr.cc \
- ebin.se \
- ebin-se.hh \
- ebin-se.cc \
glsa.sr \
glsa-sr.hh \
glsa-sr.cc \
@@ -361,10 +346,6 @@ BUILT_SOURCES = \
vdb_repository-sr.cc \
ebuild-sr.hh \
ebuild-sr.cc \
- ebin-sr.hh \
- ebin-sr.cc \
- ebin-se.hh \
- ebin-se.cc \
vdb_merger-sr.hh \
vdb_merger-sr.cc \
vdb_unmerger-sr.hh \
@@ -431,12 +412,6 @@ ebuild-sr.hh : ebuild.sr $(top_srcdir)/misc/make_sr.bash
ebuild-sr.cc : ebuild.sr $(top_srcdir)/misc/make_sr.bash
$(top_srcdir)/misc/make_sr.bash --source $(srcdir)/ebuild.sr > $@
-ebin-sr.hh : ebin.sr $(top_srcdir)/misc/make_sr.bash
- $(top_srcdir)/misc/make_sr.bash --header $(srcdir)/ebin.sr > $@
-
-ebin-sr.cc : ebin.sr $(top_srcdir)/misc/make_sr.bash
- $(top_srcdir)/misc/make_sr.bash --source $(srcdir)/ebin.sr > $@
-
eapi-sr.hh : eapi.sr $(top_srcdir)/misc/make_sr.bash
$(top_srcdir)/misc/make_sr.bash --header $(srcdir)/eapi.sr > $@
@@ -455,12 +430,6 @@ vdb_repository-sr.hh : vdb_repository.sr $(top_srcdir)/misc/make_sr.bash
vdb_repository-sr.cc : vdb_repository.sr $(top_srcdir)/misc/make_sr.bash
$(top_srcdir)/misc/make_sr.bash --source $(srcdir)/vdb_repository.sr > $@
-ebin-se.hh : ebin.se $(top_srcdir)/misc/make_se.bash
- if ! $(top_srcdir)/misc/make_se.bash --header $(srcdir)/ebin.se > $@ ; then rm -f $@ ; exit 1 ; fi
-
-ebin-se.cc : ebin.se $(top_srcdir)/misc/make_se.bash
- if ! $(top_srcdir)/misc/make_se.bash --source $(srcdir)/ebin.se > $@ ; then rm -f $@ ; exit 1 ; fi
-
dep_parser-se.hh : dep_parser.se $(top_srcdir)/misc/make_se.bash
if ! $(top_srcdir)/misc/make_se.bash --header $(srcdir)/dep_parser.se > $@ ; then rm -f $@ ; exit 1 ; fi
diff --git a/paludis/repositories/e/e_repository_entries.cc b/paludis/repositories/e/e_repository_entries.cc
index e342fae..376e819 100644
--- a/paludis/repositories/e/e_repository_entries.cc
+++ b/paludis/repositories/e/e_repository_entries.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
@@ -19,7 +19,6 @@
#include "e_repository_entries.hh"
#include "ebuild_entries.hh"
-#include "ebin_entries.hh"
#include <paludis/util/virtual_constructor-impl.hh>
#include <paludis/util/instantiation_policy-impl.hh>
@@ -45,8 +44,5 @@ NoSuchERepositoryEntriesType::NoSuchERepositoryEntriesType(const std::string & f
ERepositoryEntriesMaker::ERepositoryEntriesMaker()
{
register_maker("ebuild", &EbuildEntries::make_ebuild_entries);
-#if 0
- register_maker("ebin", &EbinEntries::make_ebin_entries);
-#endif
}
diff --git a/paludis/repositories/e/e_repository_entries.hh b/paludis/repositories/e/e_repository_entries.hh
index 556199e..762f996 100644
--- a/paludis/repositories/e/e_repository_entries.hh
+++ b/paludis/repositories/e/e_repository_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
@@ -111,7 +111,7 @@ namespace paludis
virtual void merge(const MergeOptions &) = 0;
/**
- * Gives the Manifest key for a given package file (for
+ * Gives the Manifest key for a given package file (for
* example, "EBUILD").
*/
virtual std::string get_package_file_manifest_key(const FSEntry &, const QualifiedPackageName &) const = 0;
diff --git a/paludis/repositories/e/ebin.cc b/paludis/repositories/e/ebin.cc
deleted file mode 100644
index 9c95df0..0000000
--- a/paludis/repositories/e/ebin.cc
+++ /dev/null
@@ -1,305 +0,0 @@
-/* vim: set sw=4 sts=4 et foldmethod=syntax : */
-
-/*
- * Copyright (c) 2007 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
- */
-
-#include <paludis/repositories/e/ebin.hh>
-#include <paludis/repositories/e/dep_parser.hh>
-#include <paludis/repositories/e/eapi.hh>
-#include <paludis/environment.hh>
-#include <paludis/util/wrapped_forward_iterator.hh>
-#include <paludis/util/system.hh>
-#include <paludis/util/log.hh>
-#include <paludis/util/strip.hh>
-#include <paludis/util/sequence.hh>
-#include <paludis/about.hh>
-#include <paludis/package_id.hh>
-#include <paludis/action.hh>
-#include <paludis/metadata_key.hh>
-#include <sys/resource.h>
-#include <sys/time.h>
-#include <unistd.h>
-
-using namespace paludis;
-
-#include <paludis/repositories/e/ebin-se.cc>
-#include <paludis/repositories/e/ebin-sr.cc>
-
-EbinCommand::EbinCommand(const EbinCommandParams & p) :
- params(p)
-{
-}
-
-EbinCommand::~EbinCommand()
-{
-}
-
-bool
-EbinCommand::success()
-{
- return true;
-}
-
-bool
-EbinCommand::use_sandbox() const
-{
- return true;
-}
-
-bool
-EbinCommand::do_run_command(const Command & cmd)
-{
- return 0 == run_command(cmd);
-}
-
-bool
-EbinCommand::operator() ()
-{
- Command cmd(getenv_with_default("PALUDIS_EBUILD_DIR", LIBEXECDIR "/paludis") +
- "/ebuild.bash '-' " + commands());
-
- if (use_sandbox())
- cmd.with_sandbox();
-
- 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());
-
- cmd = extend_command(cmd
- .with_setenv("P", stringify(params.package_id->name().package) + "-" +
- stringify(params.package_id->version().remove_revision()))
- .with_setenv("PV", stringify(params.package_id->version().remove_revision()))
- .with_setenv("PR", stringify(params.package_id->version().revision_only()))
- .with_setenv("PN", stringify(params.package_id->name().package))
- .with_setenv("PVR", stringify(params.package_id->version()))
- .with_setenv("PF", stringify(params.package_id->name().package) + "-" +
- stringify(params.package_id->version()))
- .with_setenv("CATEGORY", stringify(params.package_id->name().category))
- .with_setenv("REPOSITORY", stringify(params.package_id->repository()->name()))
- .with_setenv("PORTDIR", stringify(params.portdir))
- .with_setenv("DISTDIR", stringify(params.distdir))
- .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("PALUDIS_TMPDIR", stringify(params.builddir))
- .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(), " "))
- .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_REDUCED_GID", stringify(params.environment->reduced_gid()))
- .with_setenv("PALUDIS_REDUCED_UID", stringify(params.environment->reduced_uid()))
- .with_setenv("KV", kernel_version())
- .with_setenv("PALUDIS_EBUILD_LOG_LEVEL", stringify(Log::get_instance()->log_level()))
- .with_setenv("PALUDIS_EBUILD_DIR", getenv_with_default("PALUDIS_EBUILD_DIR", LIBEXECDIR "/paludis")));
-
- if (do_run_command(add_portage_vars(cmd)))
- return success();
- else
- return failure();
-}
-
-Command
-EbinCommand::add_portage_vars(const Command & cmd) const
-{
- return Command(cmd)
- .with_setenv("PORTAGE_BASHRC", "/dev/null")
- .with_setenv("PORTAGE_BUILDDIR", stringify(params.builddir) + "/" +
- stringify(params.package_id->name().category) + "/" +
- stringify(params.package_id->name().package) + "-" +
- stringify(params.package_id->version()))
- .with_setenv("PORTAGE_CALLER", params.environment->paludis_command())
- .with_setenv("PORTAGE_GID", "0")
- .with_setenv("PORTAGE_INST_GID", "0")
- .with_setenv("PORTAGE_INST_UID", "0")
- .with_setenv("PORTAGE_MASTER_PID", stringify(::getpid()))
- .with_setenv("PORTAGE_NICENCESS", stringify(::getpriority(PRIO_PROCESS, 0)))
- .with_setenv("PORTAGE_TMPDIR", stringify(params.builddir))
- .with_setenv("PORTAGE_TMPFS", "/dev/shm")
- .with_setenv("PORTAGE_WORKDIR_MODE", "0700");
-}
-
-std::string
-EbinFetchCommand::commands() const
-{
- return "fetchbin";
-}
-
-bool
-EbinFetchCommand::failure()
-{
- throw FetchActionError("Fetch failed for '" + stringify(*params.package_id) + "'");
-}
-
-Command
-EbinFetchCommand::extend_command(const Command & cmd)
-{
- Command result(Command(cmd)
- .with_setenv("B", fetch_params.b)
- .with_setenv("FLAT_BIN_URI", fetch_params.flat_bin_uri)
- .with_setenv("ROOT", fetch_params.root)
- .with_setenv("PALUDIS_USE_SAFE_RESUME", fetch_params.safe_resume ? "oohyesplease" : "")
- .with_setenv("ROOT", fetch_params.root)
- .with_setenv("PALUDIS_USE_SAFE_RESUME", fetch_params.safe_resume ? "oohyesplease" : ""));
-
- if (fetch_params.userpriv)
- result.with_uid_gid(params.environment->reduced_uid(), params.environment->reduced_gid());
-
- return result;
-}
-
-EbinFetchCommand::EbinFetchCommand(const EbinCommandParams & p, const EbinFetchCommandParams & f) :
- EbinCommand(p),
- fetch_params(f)
-{
-}
-
-std::string
-EbinInstallCommand::commands() const
-{
- switch (install_params.phase)
- {
- case ebin_ip_prepare:
- return "prepare";
-
- case ebin_ip_initbinenv:
- return "initbin saveenv";
-
- case ebin_ip_setup:
- return "loadenv setup saveenv";
-
- case ebin_ip_unpackbin:
- return "loadenv unpackbin saveenv";
-
- case ebin_ip_preinstall:
- return "loadenv strip preinst saveenv";
-
- case ebin_ip_postinstall:
- return "loadenv postinst saveenv";
-
- case ebin_ip_tidyup:
- return "tidyup";
-
- case last_ebin_ip:
- ;
- }
-
- throw InternalError(PALUDIS_HERE, "Bad phase");
-}
-
-bool
-EbinInstallCommand::failure()
-{
- throw InstallActionError("Install failed for '" + stringify(*params.package_id) + "'");
-}
-
-Command
-EbinInstallCommand::extend_command(const Command & cmd)
-{
- std::string debug_build;
- do
- {
- switch (install_params.debug_build)
- {
- case iado_none:
- debug_build = "none";
- continue;
-
- case iado_split:
- debug_build = "split";
- continue;
-
- case iado_internal:
- debug_build = "internal";
- continue;
-
- case last_iado:
- break;
- }
-
- throw InternalError(PALUDIS_HERE, "Bad debug_build value");
- }
- while (false);
-
- Command result(Command(cmd)
- .with_setenv("B", install_params.b)
- .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)
- .with_setenv("PALUDIS_CONFIG_PROTECT_MASK", install_params.config_protect_mask)
- .with_setenv("PALUDIS_EBUILD_OVERRIDE_CONFIG_PROTECT_MASK",
- install_params.disable_cfgpro ? "/" : "")
- .with_setenv("PALUDIS_DEBUG_BUILD", debug_build)
- .with_setenv("SLOT", stringify(install_params.slot)));
-
- return result;
-}
-
-EbinInstallCommand::EbinInstallCommand(const EbinCommandParams & p, const EbinInstallCommandParams & i) :
- EbinCommand(p),
- install_params(i)
-{
-}
-
-EbinMergeCommand::EbinMergeCommand(const EbinCommandParams & p, const EbinMergeCommandParams & m) :
- params(p),
- merge_params(m)
-{
-}
-
-void
-EbinMergeCommand::operator() ()
-{
- std::string tar(strip_trailing_string(stringify(merge_params.pkg_file_name), ".bz2"));
-
- Command build_tarball(Command("tar pcvf '" + stringify(tar) + "' ./")
- .with_chdir(merge_params.image)
- .with_echo_to_stderr());
-
- if (0 != run_command(build_tarball))
- throw InstallActionError("Error creating '" + stringify(tar) + "'");
-
- Command create_env(Command("cp -f '" + stringify(merge_params.environment_file) + "' '.paludis-binpkg-environment'")
- .with_chdir(merge_params.image)
- .with_echo_to_stderr());
-
- Command add_env_to_tarball(Command("tar rpf '" + stringify(tar) +
- "' '.paludis-binpkg-environment'")
- .with_chdir(merge_params.image)
- .with_echo_to_stderr());
-
- if (0 != run_command(create_env) || 0 != run_command(add_env_to_tarball))
- throw InstallActionError("Error adding environment to '" + tar + "'");
-
- Command clean_env(Command("rm -f '.paludis-binpkg-environment'")
- .with_chdir(merge_params.image)
- .with_echo_to_stderr());
- if (0 != run_command(clean_env))
- Log::get_instance()->message(ll_warning, lc_context, "Cleaning environment failed");
-
- Command compress_tarball(Command("bzip2 '" + tar + "'")
- .with_chdir(merge_params.image)
- .with_echo_to_stderr());
-
- if (0 != run_command(compress_tarball))
- throw InstallActionError("Error compressing '" + tar + "'");
-}
-
diff --git a/paludis/repositories/e/ebin.hh b/paludis/repositories/e/ebin.hh
deleted file mode 100644
index 9052627..0000000
--- a/paludis/repositories/e/ebin.hh
+++ /dev/null
@@ -1,202 +0,0 @@
-/* vim: set sw=4 sts=4 et foldmethod=syntax : */
-
-/*
- * Copyright (c) 2007 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
- */
-
-#ifndef PALUDIS_GUARD_PALUDIS_PALUDIS_REPOSITORIES_GENTOO_EBIN_HH
-#define PALUDIS_GUARD_PALUDIS_PALUDIS_REPOSITORIES_GENTOO_EBIN_HH 1
-
-#include <paludis/util/instantiation_policy.hh>
-#include <paludis/util/fs_entry.hh>
-#include <paludis/util/attributes.hh>
-#include <paludis/package_database.hh>
-#include <paludis/action-fwd.hh>
-#include <string>
-
-namespace paludis
-{
- class Command;
-
-#include <paludis/repositories/e/ebin-se.hh>
-#include <paludis/repositories/e/ebin-sr.hh>
-
- /**
- * A command related to a .ebin file.
- *
- * \ingroup grpebininterface
- * \nosubgrouping
- */
- class EbinCommand :
- private InstantiationPolicy<EbinCommand, instantiation_method::NonCopyableTag>
- {
- protected:
- /**
- * Our parameters.
- */
- EbinCommandParams params;
-
- ///\name Basic operations
- ///\{
-
- EbinCommand(const EbinCommandParams &);
-
- ///\}
-
- ///\name Command options
- ///\{
-
- /**
- * What commands should be run?
- */
- virtual std::string commands() const = 0;
-
- /**
- * Was our execution a success?
- */
- virtual bool success();
-
- /**
- * Should we use sandbox?
- */
- virtual bool use_sandbox() const;
-
- /**
- * Handle a failure.
- */
- virtual bool failure() = 0;
-
- /**
- * Run the command specified.
- */
- virtual bool do_run_command(const Command &);
-
- /**
- * Extend the basic command.
- */
- virtual Command extend_command(const Command &) = 0;
-
- /**
- * Add Portage emulation variables.
- */
- virtual Command add_portage_vars(const Command &) const;
-
- ///\}
-
- public:
- ///\name Basic operations
- ///\{
-
- virtual ~EbinCommand();
-
- ///\}
-
- /**
- * Run the command.
- */
- virtual bool operator() ();
- };
-
- /**
- * Fetch a .ebin's bin_uri contents.
- *
- * \ingroup grpebininterface
- * \nosubgrouping
- */
- class EbinFetchCommand :
- public EbinCommand
- {
- protected:
- /// Our parameters.
- const EbinFetchCommandParams fetch_params;
-
- virtual std::string commands() const;
-
- virtual bool failure() PALUDIS_ATTRIBUTE((noreturn));
-
- virtual Command extend_command(const Command &);
-
- public:
- ///\name Basic operations
- ///\{
-
- EbinFetchCommand(const EbinCommandParams &, const EbinFetchCommandParams &);
-
- ///\}
- };
-
- /**
- * Perform a part of a .ebin install sequence.
- *
- * \ingroup grpebininterface
- * \nosubgrouping
- */
- class EbinInstallCommand :
- public EbinCommand
- {
- protected:
- /// Our parameters.
- const EbinInstallCommandParams install_params;
-
- virtual std::string commands() const;
-
- virtual bool failure() PALUDIS_ATTRIBUTE((noreturn));
-
- virtual Command extend_command(const Command &);
-
- public:
- ///\name Basic operations
- ///\{
-
- EbinInstallCommand(const EbinCommandParams &, const EbinInstallCommandParams &);
-
- ///\}
- };
-
- /**
- * Merge to a .ebin repository.
- *
- * \ingroup grpebininterface
- * \nosubgrouping
- */
- class EbinMergeCommand
- {
- protected:
- ///\name Parameters
- ///\{
-
- const EbinCommandParams params;
- const EbinMergeCommandParams merge_params;
-
- ///\}
-
- public:
- ///\name Basic operations
- ///\{
-
- EbinMergeCommand(const EbinCommandParams &, const EbinMergeCommandParams &);
-
- ///\}
-
- /**
- * Perform the merge.
- */
- void operator() ();
- };
-}
-
-#endif
-
diff --git a/paludis/repositories/e/ebin.se b/paludis/repositories/e/ebin.se
deleted file mode 100644
index 9d1474e..0000000
--- a/paludis/repositories/e/ebin.se
+++ /dev/null
@@ -1,25 +0,0 @@
-#!/bin/bash
-# vim: set sw=4 sts=4 et ft=sh :
-
-make_enum_EbinInstallCommandPhase()
-{
- prefix ebin_ip
-
- key ebin_ip_prepare "Prepare the working directory"
- key ebin_ip_initbinenv "Extract and load the binary environment"
- key ebin_ip_setup "Perform pre-unpack setup phases"
- key ebin_ip_unpackbin "Extract the binary"
- key ebin_ip_preinstall "Preinstall to a live system"
- key ebin_ip_postinstall "Postinstall to a live system"
- key ebin_ip_tidyup "Tidy up work."
-
- doxygen_comment << "END"
- /**
- * Which phase of an EbinInstallCommand to run.
- *
- * \see EbinInstallCommand
- * \ingroup grperepository
- */
-END
-}
-
diff --git a/paludis/repositories/e/ebin.sr b/paludis/repositories/e/ebin.sr
deleted file mode 100644
index 20d5ce5..0000000
--- a/paludis/repositories/e/ebin.sr
+++ /dev/null
@@ -1,89 +0,0 @@
-#!/bin/bash
-# vim: set sw=4 sts=4 et :
-
-make_class_EbinCommandParams()
-{
- key environment "const Environment *"
- key package_id "tr1::shared_ptr<const PackageID>"
- key portdir FSEntry
- key distdir FSEntry
- key builddir FSEntry
-
- doxygen_comment << "END"
- /**
- * Parameters for an EbinCommand.
- *
- * \see EbinCommand
- * \ingroup grpebuildinterface
- * \nosubgrouping
- */
-END
-
- allow_named_args
-}
-
-make_class_EbinFetchCommandParams()
-{
- key b std::string
- key flat_bin_uri std::string
- key root std::string
- key safe_resume bool
- key userpriv bool
-
- doxygen_comment << "END"
- /**
- * Parameters for an EbinFetchCommand.
- *
- * \see EbinFetchCommand
- * \ingroup grpebuildinterface
- * \nosubgrouping
- */
-END
-
- allow_named_args
-}
-
-make_class_EbinInstallCommandParams()
-{
- key b std::string
- key root std::string
- key disable_cfgpro bool
- key debug_build InstallActionDebugOption
- key slot SlotName
- key phase EbinInstallCommandPhase
- key config_protect std::string
- key config_protect_mask std::string
- key loadsaveenv_dir FSEntry
-
- doxygen_comment << "END"
- /**
- * Parameters for an EbinInstallCommand.
- *
- * \see EbinInstallCommand
- * \ingroup grpebuildinterface
- * \nosubgrouping
- */
-END
-
- allow_named_args
-}
-
-make_class_EbinMergeCommandParams()
-{
- key image FSEntry
- key environment_file FSEntry
- key pkg_file_name FSEntry
-
- doxygen_comment << "END"
- /**
- * Parameters for an EbinMergeCommand.
- *
- * \see EbinMergeCommand
- * \ingroup grpebuildinterface
- * \nosubgrouping
- */
-END
-
- allow_named_args
-}
-
diff --git a/paludis/repositories/e/ebin_entries.cc b/paludis/repositories/e/ebin_entries.cc
deleted file mode 100644
index 9a9dd83..0000000
--- a/paludis/repositories/e/ebin_entries.cc
+++ /dev/null
@@ -1,479 +0,0 @@
-/* vim: set sw=4 sts=4 et foldmethod=syntax : */
-
-/*
- * Copyright (c) 2007 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
- */
-
-#include "ebin_entries.hh"
-#include <paludis/repositories/e/ebin.hh>
-#include <paludis/repositories/e/e_repository.hh>
-#include <paludis/repositories/e/eapi.hh>
-#include <paludis/repositories/e/dep_parser.hh>
-#include <paludis/repositories/e/dep_spec_pretty_printer.hh>
-#include <paludis/util/config_file.hh>
-#include <paludis/dep_spec_flattener.hh>
-#include <paludis/environment.hh>
-#include <paludis/package_id.hh>
-#include <paludis/metadata_key.hh>
-#include <paludis/util/strip.hh>
-#include <paludis/util/log.hh>
-#include <paludis/util/system.hh>
-#include <paludis/util/join.hh>
-#include <paludis/util/private_implementation_pattern-impl.hh>
-#include <paludis/util/is_file_with_extension.hh>
-#include <paludis/util/visitor-impl.hh>
-#include <set>
-#include <fstream>
-
-using namespace paludis;
-
-#if 0
-
-namespace paludis
-{
- template<>
- struct Implementation<EbinEntries>
- {
- const Environment * const environment;
- ERepository * const portage_repository;
- const ERepositoryParams params;
-
- Implementation(const Environment * const e, ERepository * const p,
- const ERepositoryParams & k) :
- environment(e),
- portage_repository(p),
- params(k)
- {
- }
- };
-}
-
-EbinEntries::EbinEntries(
- const Environment * const e, ERepository * const p, const ERepositoryParams & k) :
- PrivateImplementationPattern<EbinEntries>(new Implementation<EbinEntries>(e, p, k))
-{
-}
-
-EbinEntries::~EbinEntries()
-{
-}
-
-tr1::shared_ptr<VersionMetadata>
-EbinEntries::generate_version_metadata(const QualifiedPackageName & q,
- const VersionSpec & v) const
-{
- Context context("When generating version metadata for '" + stringify(q) + "-" + stringify(v) + "':");
-
- tr1::shared_ptr<EbinVersionMetadata> result(new EbinVersionMetadata(SlotName("unset")));
-
- KeyValueConfigFile f(_imp->portage_repository->layout()->package_directory(q) /
- (stringify(q.package) + "-" + stringify(v) + ".ebin"),
- KeyValueConfigFileOptions() + kvcfo_disallow_continuations + kvcfo_disallow_comments +
- kvcfo_disallow_space_around_equals + kvcfo_disallow_source);
-
- result->set_run_depend(f.get("RDEPEND"));
- result->set_post_depend(f.get("PDEPEND"));
- result->set_suggested_depend(f.get("SDEPEND"));
-
- result->set_license(f.get("LICENSE"));
-
- result->source.reset();
- result->binary.reset();
-
- result->slot = SlotName(f.get("SLOT"));
- result->set_homepage(f.get("HOMEPAGE"));
- result->description = f.get("DESCRIPTION");
- result->eapi = EAPIData::get_instance()->eapi_from_string(f.get("EAPI"));
-
- result->set_provide(f.get("PROVIDE"));
- result->set_src_uri(f.get("SRC_URI"));
- result->set_restrictions(f.get("RESTRICT"));
- result->set_keywords(f.get("KEYWORDS"));
- result->set_iuse(f.get("IUSE"));
- result->set_inherited(f.get("INHERITED"));
-
- result->set_bin_uri(f.get("BIN_URI"));
-
- return result;
-}
-
-namespace
-{
- FSEntry
- get_root(tr1::shared_ptr<const DestinationsCollection> destinations)
- {
- if (destinations)
- for (DestinationsCollection::Iterator d(destinations->begin()), d_end(destinations->end()) ;
- d != d_end ; ++d)
- if ((*d)->installed_interface)
- return (*d)->installed_interface->root();
-
- return FSEntry("/");
- }
-}
-
-void
-EbinEntries::install(const tr1::shared_ptr<const PackageID> & id,
- const InstallOptions & o, tr1::shared_ptr<const ERepositoryProfile>) const
-{
- std::string binaries, flat_bin_uri;
- {
- std::set<std::string> already_in_binaries;
-
- /* make B and FLAT_BIN_URI */
- DepSpecFlattener f(_imp->params.environment, id);
- if (id->bin_uri_key())
- id->bin_uri_key()->value()->accept(f);
-
- for (DepSpecFlattener::Iterator ff(f.begin()), ff_end(f.end()) ; ff != ff_end ; ++ff)
- {
- std::string::size_type pos((*ff)->text().rfind('/'));
- if (std::string::npos == pos)
- {
- if (already_in_binaries.end() == already_in_binaries.find((*ff)->text()))
- {
- binaries.append((*ff)->text());
- already_in_binaries.insert((*ff)->text());
- }
- }
- else
- {
- if (already_in_binaries.end() == already_in_binaries.find((*ff)->text().substr(pos + 1)))
- {
- binaries.append((*ff)->text().substr(pos + 1));
- already_in_binaries.insert((*ff)->text().substr(pos + 1));
- }
- }
- binaries.append(" ");
-
- /* add * mirror entries */
- tr1::shared_ptr<const MirrorsCollection> star_mirrors(_imp->params.environment->mirrors("*"));
- for (MirrorsCollection::Iterator m(star_mirrors->begin()), m_end(star_mirrors->end()) ; m != m_end ; ++m)
- flat_bin_uri.append(*m + "/" + (*ff)->text().substr(pos + 1) + " ");
-
- if (0 == (*ff)->text().compare(0, 9, "mirror://"))
- {
- std::string mirror((*ff)->text().substr(9));
- std::string::size_type spos(mirror.find('/'));
-
- if (std::string::npos == spos)
- throw PackageInstallActionError("Can't install '" + stringify(*id) + "' since BIN_URI is broken");
-
- tr1::shared_ptr<const MirrorsCollection> mirrors(_imp->params.environment->mirrors(mirror.substr(0, spos)));
- if (! _imp->portage_repository->is_mirror(mirror.substr(0, spos)) &&
- mirrors->empty())
- throw PackageInstallActionError("Can't install '" + stringify(*id)
- + "' since BIN_URI references unknown mirror:// '" +
- mirror.substr(0, spos) + "'");
-
- for (MirrorsCollection::Iterator m(mirrors->begin()), m_end(mirrors->end()) ; m != m_end ; ++m)
- flat_bin_uri.append(*m + "/" + mirror.substr(spos + 1) + " ");
-
- for (RepositoryMirrorsInterface::MirrorsIterator
- m(_imp->portage_repository->begin_mirrors(mirror.substr(0, spos))),
- m_end(_imp->portage_repository->end_mirrors(mirror.substr(0, spos))) ;
- m != m_end ; ++m)
- flat_bin_uri.append(m->second + "/" + mirror.substr(spos + 1) + " ");
- }
- else
- flat_bin_uri.append((*ff)->text());
- flat_bin_uri.append(" ");
-
- /* add mirror://gentoo/ entries */
- std::string master_mirror(strip_trailing_string(stringify(_imp->portage_repository->name()), "x-"));
- if (_imp->portage_repository->is_mirror(master_mirror))
- {
- tr1::shared_ptr<const MirrorsCollection> repo_mirrors(_imp->params.environment->mirrors(master_mirror));
- for (MirrorsCollection::Iterator m(repo_mirrors->begin()), m_end(repo_mirrors->end()) ; m != m_end ; ++m)
- flat_bin_uri.append(*m + "/" + (*ff)->text().substr(pos + 1) + " ");
-
- for (RepositoryMirrorsInterface::MirrorsIterator
- m(_imp->portage_repository->begin_mirrors(master_mirror)),
- m_end(_imp->portage_repository->end_mirrors(master_mirror)) ;
- m != m_end ; ++m)
- flat_bin_uri.append(m->second + "/" + (*ff)->text().substr(pos + 1) + " ");
- }
- }
- }
-
- EbinCommandParams command_params(EbinCommandParams::create()
- .environment(_imp->params.environment)
- .package_id(id)
- .portdir(_imp->params.master_repository ? _imp->params.master_repository->params().location :
- _imp->params.location)
- .distdir(_imp->params.distdir)
- .buildroot(_imp->params.buildroot));
-
- bool fetch_userpriv_ok(_imp->environment->reduced_gid() != getgid());
- if (fetch_userpriv_ok)
- {
- FSEntry f(_imp->params.distdir);
- Context c("When checking permissions on '" + stringify(f) + "' for userpriv:");
-
- if (f.exists())
- {
- if (f.group() != _imp->environment->reduced_gid())
- {
- Log::get_instance()->message(ll_warning, lc_context, "Directory '" +
- stringify(f) + "' owned by group '" +
- stringify(get_group_name(f.group())) + "', not '" +
- stringify(get_group_name(_imp->environment->reduced_gid())) +
- "', so cannot enable userpriv");
- fetch_userpriv_ok = false;
- }
- else if (! f.has_permission(fs_ug_group, fs_perm_write))
- {
- Log::get_instance()->message(ll_warning, lc_context, "Directory '" +
- stringify(f) + "' does not group write permission," +
- "cannot enable userpriv");
- fetch_userpriv_ok = false;
- }
- }
- }
-
- if (! o.destination)
- throw PackageInstallActionError("Can't install '" + stringify(*id)
- + "' because no destination was provided");
-
- EbinFetchCommand fetch_cmd(command_params,
- EbinFetchCommandParams::create()
- .b(binaries)
- .flat_bin_uri(flat_bin_uri)
- .root(o.destination->installed_interface ? stringify(o.destination->installed_interface->root()) : "/")
- .safe_resume(o.safe_resume)
- .userpriv(false));
-
- fetch_cmd();
-
- if (o.fetch_only)
- return;
-
- EbinInstallCommandParams install_params(
- EbinInstallCommandParams::create()
- .b(binaries)
- .root(o.destination->installed_interface ? stringify(o.destination->installed_interface->root()) : "/")
- .debug_build(o.debug_build)
- .phase(ebin_ip_prepare)
- .disable_cfgpro(o.no_config_protect)
- .config_protect(_imp->portage_repository->profile_variable("CONFIG_PROTECT"))
- .config_protect_mask(_imp->portage_repository->profile_variable("CONFIG_PROTECT_MASK"))
- .loadsaveenv_dir(_imp->params.buildroot / stringify(id->name().category) / (
- stringify(id->name().package) + "-" + stringify(id->version())) / "temp")
- .slot(SlotName(id->slot())));
-
- EbinInstallCommand prepare_cmd(command_params, install_params);
- prepare_cmd();
-
- install_params.phase = ebin_ip_initbinenv;
- EbinInstallCommand initbinenv_cmd(command_params, install_params);
- initbinenv_cmd();
-
- install_params.phase = ebin_ip_setup;
- EbinInstallCommand setup_cmd(command_params, install_params);
- setup_cmd();
-
- install_params.phase = ebin_ip_unpackbin;
- EbinInstallCommand unpackbin_cmd(command_params, install_params);
- unpackbin_cmd();
-
- if (! o.destination->destination_interface)
- throw PackageInstallActionError("Can't install '" + stringify(*id)
- + "' to destination '" + stringify(o.destination->name())
- + "' because destination does not provide destination_interface");
-
- if (o.destination->destination_interface->want_pre_post_phases())
- {
- install_params.phase = ebin_ip_preinstall;
- install_params.root = o.destination->installed_interface ?
- stringify(o.destination->installed_interface->root()) : "/";
- EbinInstallCommand preinst_cmd(command_params, install_params);
- preinst_cmd();
- }
-
- o.destination->destination_interface->merge(
- MergeOptions::create()
- .package_id(id)
- .image_dir(_imp->params.buildroot / stringify(id->name().category) / (stringify(id->name().package) + "-"
- + stringify(id->version())) / "image")
- .environment_file(_imp->params.buildroot / stringify(id->name().category) / (stringify(id->name().package) + "-"
- + stringify(id->version())) / "temp" / "loadsaveenv")
- .rewrite_symlinks(true)
- );
-
- if (o.destination->destination_interface->want_pre_post_phases())
- {
- install_params.phase = ebin_ip_postinstall;
- install_params.root = o.destination->installed_interface ?
- stringify(o.destination->installed_interface->root()) : "/";
- EbinInstallCommand postinst_cmd(command_params, install_params);
- postinst_cmd();
- }
-
- install_params.phase = ebin_ip_tidyup;
- EbinInstallCommand tidyup_cmd(command_params, install_params);
- tidyup_cmd();
-}
-
-tr1::shared_ptr<ERepositoryEntries>
-EbinEntries::make_ebin_entries(
- const Environment * const e, ERepository * const r, const ERepositoryParams & p)
-{
- return tr1::shared_ptr<ERepositoryEntries>(new EbinEntries(e, r, p));
-}
-
-std::string
-EbinEntries::get_environment_variable(const tr1::shared_ptr<const PackageID> & id,
- const std::string & var, tr1::shared_ptr<const ERepositoryProfile>) const
-{
- PackageID::Iterator i(id->find(var));
- if (id->end() != i)
- {
- MetadataKeyRawPrinter p;
- i->accept(p);
- return stringify(p);
- }
-
- throw EnvironmentVariableActionError("Couldn't get environment variable '" +
- stringify(var) + "' for package '" + stringify(*id) + "'");
-}
-
-void
-EbinEntries::merge(const MergeOptions & m)
-{
- Context context("When merging '" + stringify(*m.package_id) + "' at '" + stringify(m.image_dir)
- + "' to ebin repository '" + stringify(_imp->portage_repository->name()) + "':");
-
- if (! _imp->portage_repository->destination_interface->is_suitable_destination_for(m.package()))
- throw PackageInstallActionError("Not a suitable destination for '" + stringify(*m.package()) + "'");
-
- FSEntry ebin_dir(_imp->params.location);
- ebin_dir /= stringify(m.package_id->name().category);
- ebin_dir.mkdir();
- ebin_dir /= stringify(m.package_id->name().package);
- ebin_dir.mkdir();
-
- FSEntry ebin_file_name(ebin_dir / (stringify(m.package_id->name.package()) + "-" +
- stringify(m.package_id->version()) + ".ebin.incomplete"));
- std::ofstream ebin_file(stringify(ebin_file_name).c_str());
- if (! ebin_file)
- throw PackageInstallActionError("Cannot write to '" + stringify(ebin_file_name) + "'");
-
- if (metadata->deps_interface)
- {
- DepSpecPrettyPrinter r(0, false), p(0, false), s(0, false);
- metadata->deps_interface->run_depend()->accept(r);
- metadata->deps_interface->post_depend()->accept(p);
- metadata->deps_interface->suggested_depend()->accept(s);
- ebin_file << "RDEPEND=" << r << std::endl;
- ebin_file << "PDEPEND=" << p << std::endl;
- ebin_file << "SDEPEND=" << s << std::endl;
- }
-
- if (metadata->license_interface)
- {
- DepSpecPrettyPrinter l(0, false);
- metadata->license_interface->license()->accept(l);
- ebin_file << "LICENSE=" << l << std::endl;
- }
-
- ebin_file << "SLOT=" << metadata->slot << std::endl;
- DepSpecPrettyPrinter h(0, false);
- metadata->homepage()->accept(h);
- ebin_file << "HOMEPAGE=" << h << std::endl;
- ebin_file << "DESCRIPTION=" << metadata->description << std::endl;
- ebin_file << "EAPI=" << metadata->eapi->name << std::endl;
-
- if (metadata->ebuild_interface)
- {
- DepSpecPrettyPrinter p(0, false), s(0, false), r(0, false);
- metadata->ebuild_interface->provide()->accept(p);
- metadata->ebuild_interface->src_uri()->accept(s);
- metadata->ebuild_interface->restrictions()->accept(r);
- ebin_file << "PROVIDE=" << p << std::endl;
- ebin_file << "SRC_URI=" << s << std::endl;
- ebin_file << "RESTRICT=" << r << std::endl;
- ebin_file << "KEYWORDS=" << join(metadata->ebuild_interface->keywords()->begin(),
- metadata->ebuild_interface->keywords()->end(), " ") << std::endl;
- ebin_file << "IUSE=" << join(metadata->ebuild_interface->iuse()->begin(),
- metadata->ebuild_interface->iuse()->end(), " ") << std::endl;
- ebin_file << "INHERITED=" << join(metadata->ebuild_interface->inherited()->begin(),
- metadata->ebuild_interface->inherited()->end(), " ") << std::endl;
- }
-
- FSEntry pkg_file_name(_imp->params.distdir / (
- stringify(_imp->portage_repository->name()) + "--" +
- stringify(m.package_id->name.category) + "--" +
- stringify(m.package_id->name.package) + "-" +
- stringify(m.package_id->version) + ".tar.bz2"));
-
- ebin_file << "BIN_URI=" << _imp->params.write_bin_uri_prefix << pkg_file_name.basename() << std::endl;
-
- if (pkg_file_name.exists())
- pkg_file_name.unlink();
-
- EbinCommandParams command_params(EbinCommandParams::create()
- .environment(_imp->params.environment)
- .db_entry(&m.package)
- .portdir(_imp->params.master_repository ? _imp->params.master_repository->params().location :
- _imp->params.location)
- .distdir(_imp->params.distdir)
- .buildroot(_imp->params.buildroot));
-
- EbinMergeCommand merge_cmd(
- command_params,
- EbinMergeCommandParams::create()
- .pkg_file_name(pkg_file_name)
- .image(m.image_dir)
- .environment_file(m.environment_file));
-
- merge_cmd();
-
- FSEntry real_ebin_file_name(ebin_dir / (stringify(m.package_id->name.package) + "-" + stringify(m.package_id->version) + ".ebin"));
- if (real_ebin_file_name.exists())
- real_ebin_file_name.unlink();
- ebin_file_name.rename(real_ebin_file_name);
-}
-
-bool
-EbinEntries::is_package_file(const QualifiedPackageName & n, const FSEntry & e) const
-{
- return is_file_with_prefix_extension(e, stringify(n.package) + "-", ".ebin", IsFileWithOptions());
-}
-
-VersionSpec
-EbinEntries::extract_package_file_version(const QualifiedPackageName & n, const FSEntry & e) const
-{
- Context context("When extracting version from '" + stringify(e) + "':");
- return VersionSpec(strip_leading_string(strip_trailing_string(e.basename(), ".ebin"), stringify(n.package) + "-"));
-}
-
-bool
-EbinEntries::pretend(const QualifiedPackageName &, const VersionSpec &,
- tr1::shared_ptr<const ERepositoryProfile>) const
-{
- return true;
-}
-
-std::string
-EbinEntries::get_package_file_manifest_key(const FSEntry & f, const QualifiedPackageName & q) const
-{
- if (is_package_file(q, f)
- return "EBIN";
- return "";
-}
-
-#endif
-
diff --git a/paludis/repositories/e/ebin_entries.hh b/paludis/repositories/e/ebin_entries.hh
deleted file mode 100644
index f25e31d..0000000
--- a/paludis/repositories/e/ebin_entries.hh
+++ /dev/null
@@ -1,82 +0,0 @@
-/* vim: set sw=4 sts=4 et foldmethod=syntax : */
-
-/*
- * Copyright (c) 2007 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
- */
-
-#ifndef PALUDIS_GUARD_PALUDIS_REPOSITORIES_GENTOO_EBIN_ENTRIES_HH
-#define PALUDIS_GUARD_PALUDIS_REPOSITORIES_GENTOO_EBIN_ENTRIES_HH 1
-
-#include <paludis/repositories/e/e_repository_entries.hh>
-#include <paludis/repositories/e/e_repository_params.hh>
-#include <paludis/util/private_implementation_pattern.hh>
-
-namespace paludis
-{
- class FSEntry;
- class ERepository;
-
- namespace erepository
- {
- /**
- * ERepositoryEntries handler for ebins.
- *
- * \ingroup grperepository
- */
- class PALUDIS_VISIBLE EbinEntries :
- public ERepositoryEntries,
- private PrivateImplementationPattern<EbinEntries>
- {
- public:
- /**
- * Create an EbinEntries instance.
- */
- static tr1::shared_ptr<ERepositoryEntries> make_ebin_entries(const Environment * const,
- ERepository * const, const ERepositoryParams &);
-
- ///\name Basic operations
- ///\{
-
- EbinEntries(const Environment * const,
- ERepository * const e_repository,
- const ERepositoryParams &);
-
- virtual ~EbinEntries();
-
- ///\}
-
- virtual bool is_package_file(const QualifiedPackageName &, const FSEntry &) const
- PALUDIS_ATTRIBUTE((warn_unused_result));
-
- virtual VersionSpec extract_package_file_version(const QualifiedPackageName &, const FSEntry &) const
- PALUDIS_ATTRIBUTE((warn_unused_result));
-
- virtual const tr1::shared_ptr<const ERepositoryID> make_id(const QualifiedPackageName &, const VersionSpec &,
- const FSEntry &, const std::string &) const
- PALUDIS_ATTRIBUTE((warn_unused_result));
-
- virtual std::string get_environment_variable(const tr1::shared_ptr<const ERepositoryID> &, const std::string & var,
- tr1::shared_ptr<const ERepositoryProfile>) const;
-
- virtual void merge(const MergeOptions &);
-
- virtual std::string get_package_file_manifest_key(const FSEntry &, const QualifiedPackageName &) const;
- };
- }
-}
-
-
-#endif
diff --git a/paludis/repositories/e/ebuild/0/Makefile.am b/paludis/repositories/e/ebuild/0/Makefile.am
index 0b32f0f..25b347a 100644
--- a/paludis/repositories/e/ebuild/0/Makefile.am
+++ b/paludis/repositories/e/ebuild/0/Makefile.am
@@ -7,14 +7,12 @@ libexecprog0dir = $(libexecdir)/paludis/0/
libexecprog0_SCRIPTS = \
builtin_infovars.bash \
builtin_init.bash \
- builtin_initbin.bash \
builtin_loadenv.bash \
builtin_metadata.bash \
builtin_prepare.bash \
builtin_saveenv.bash \
builtin_strip.bash \
builtin_tidyup.bash \
- builtin_unpackbin.bash \
builtin_variable.bash \
conditional_functions.bash \
eclass_functions.bash \
diff --git a/paludis/repositories/e/ebuild/0/builtin_initbin.bash b/paludis/repositories/e/ebuild/0/builtin_initbin.bash
deleted file mode 100644
index 42b4b71..0000000
--- a/paludis/repositories/e/ebuild/0/builtin_initbin.bash
+++ /dev/null
@@ -1,90 +0,0 @@
-#!/bin/bash
-# vim: set sw=4 sts=4 et :
-
-# Copyright (c) 2006, 2007 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_initbin()
-{
- export ROOT="${ROOT//+(\/)//}"
-
- local a
- for a in P PV PR PN PVR PF CATEGORY PORTDIR \
- DISTDIR KV PALUDIS_TMPDIR PALUDIS_EBUILD_LOG_LEVEL PALUDIS_EBUILD_DIR \
- CHOST PALUDIS_COMMAND ROOT PALUDIS_LOADSAVEENV_DIR ; do
- [[ -z "${!a}" ]] && die "\$${a} unset or empty"
- done
-
- for a in DISTDIR ; do
- [[ -d "${!a}" ]] || die "\$${a} (\"${!a}\") not a directory"
- done
-
- if [[ -e "${PALUDIS_TMPDIR}/${CATEGORY}/${PF}" ]] ; then
- if type -p chflags &>/dev/null; then
- chflags -R 0 "${PALUDIS_TMPDIR}/${CATEGORY}/${PF}" || die "Couldn't remove flags from workdir"
- fi
- rm -fr "${PALUDIS_TMPDIR}/${CATEGORY}/${PF}" || die "Couldn't remove previous work"
- fi
-
- export WORKDIR="${PALUDIS_TMPDIR}/${CATEGORY}/${PF}/work"
- mkdir -p "${WORKDIR}" || die "Couldn't create \$WORKDIR (\"${WORKDIR}\")"
-
- export T="${PALUDIS_TMPDIR}/${CATEGORY}/${PF}/temp/"
- mkdir -p "${T}" || die "Couldn't create \$T (\"${T}\")"
- export HOME="${T}"
-
- export D="${PALUDIS_TMPDIR}/${CATEGORY}/${PF}/image/"
- export D="${D//+(\/)//}"
- mkdir -p "${D}" || die "Couldn't create \$D (\"${D}\")"
-
- export IMAGE="${D}"
-
- export S="${WORKDIR}/${P}"
-
- [[ -n "${B}" ]] && unpack --binary --only .paludis-binpkg-environment ${B}
-
- [[ -f "${IMAGE}/.paludis-binpkg-environment" ]] || \
- die "No saved environment in binary tarball"
-
- local save_PALUDIS_EXTRA_DIE_MESSAGE="${PALUDIS_EXTRA_DIE_MESSAGE}"
-
- echo ebuild_scrub_environment "${IMAGE}/.paludis-binpkg-environment" 1>&2
- ebuild_scrub_environment "${IMAGE}/.paludis-binpkg-environment" \
- || die "Can't load saved environment for cleaning"
-
- echo source "${IMAGE}/.paludis-binpkg-environment" 1>&2
- source "${IMAGE}/.paludis-binpkg-environment" \
- || die "Can't load saved environment"
-
- export PALUDIS_EXTRA_DIE_MESSAGE="${save_PALUDIS_EXTRA_DIE_MESSAGE}"
-
- echo rm "${IMAGE}/.paludis-binpkg-environment" 1>&2
- rm "${IMAGE}/.paludis-binpkg-environment"
-}
-
-ebuild_f_initbin()
-{
- if hasq "initbin" ${RESTRICT} ; then
- ebuild_section "Skipping builtin_initbin (RESTRICT)"
- elif hasq "init" ${SKIP_FUNCTIONS} ; then
- ebuild_section "Skipping builtin_initbin (SKIP_FUNCTIONS)"
- else
- ebuild_section "Starting builtin_initbin"
- builtin_initbin
- ebuild_section "Done builtin_initbin"
- fi
-}
-
-
diff --git a/paludis/repositories/e/ebuild/0/builtin_unpackbin.bash b/paludis/repositories/e/ebuild/0/builtin_unpackbin.bash
deleted file mode 100644
index 33ddbda..0000000
--- a/paludis/repositories/e/ebuild/0/builtin_unpackbin.bash
+++ /dev/null
@@ -1,40 +0,0 @@
-#!/bin/bash
-# vim: set sw=4 sts=4 et :
-
-# Copyright (c) 2006, 2007 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_unpackbin()
-{
- [[ -n "${B}" ]] && unpack --binary ${B}
- rm -f ${D}/.paludis-binpkg-environment
-}
-
-ebuild_f_unpackbin()
-{
- cd ${WORKDIR} || die "cd to \${WORKDIR} (\"${WORKDIR}\") failed"
-
- if hasq "unpackbin" ${RESTRICT} ; then
- ebuild_section "Skipping builtin_unpackbin (RESTRICT)"
- elif hasq "unpackbin" ${SKIP_FUNCTIONS} ; then
- ebuild_section "Skipping builtin_unpackbin (SKIP_FUNCTIONS)"
- else
- ebuild_section "Starting builtin_unpackbin"
- builtin_unpackbin
- ebuild_section "Done builtin_unpackbin"
- fi
-}
-
-
diff --git a/paludis/repositories/e/make_ebin_repository.cc b/paludis/repositories/e/make_ebin_repository.cc
deleted file mode 100644
index 682f445..0000000
--- a/paludis/repositories/e/make_ebin_repository.cc
+++ /dev/null
@@ -1,224 +0,0 @@
-/* vim: set sw=4 sts=4 et foldmethod=syntax : */
-
-/*
- * Copyright (c) 2007 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
- */
-
-#include "make_ebin_repository.hh"
-#include <paludis/util/log.hh>
-#include <paludis/util/tokeniser.hh>
-#include <paludis/util/map.hh>
-#include <paludis/util/sequence.hh>
-#include <paludis/util/destringify.hh>
-#include <paludis/util/create_iterator-impl.hh>
-#include <paludis/util/wrapped_forward_iterator.hh>
-#include <paludis/util/wrapped_output_iterator.hh>
-#include <paludis/repositories/e/e_repository_exceptions.hh>
-#include <paludis/environment.hh>
-#include <paludis/distribution.hh>
-#include <paludis/metadata_key.hh>
-
-using namespace paludis;
-
-tr1::shared_ptr<ERepository>
-paludis::make_ebin_repository(
- Environment * const env,
- tr1::shared_ptr<const Map<std::string, std::string> > m)
-{
- std::string repo_file(m->end() == m->find("repo_file") ? std::string("?") :
- m->find("repo_file")->second);
-
- Context context("When making ebin repository from repo_file '" + repo_file + "':");
-
- std::string location;
- if (m->end() == m->find("location") || ((location = m->find("location")->second)).empty())
- throw ERepositoryConfigurationError("Key 'location' not specified or empty");
-
- tr1::shared_ptr<const RepositoryName> master_repository_name;
- tr1::shared_ptr<const ERepository> master_repository;
- if (m->end() != m->find("master_repository") && ! m->find("master_repository")->second.empty())
- {
- Context context_local("When finding configuration information for master_repository '"
- + stringify(m->find("master_repository")->second) + "':");
-
- master_repository_name.reset(new RepositoryName(m->find("master_repository")->second));
-
- tr1::shared_ptr<const Repository> master_repository_uncasted(
- env->package_database()->fetch_repository(*master_repository_name));
-
- std::string format("unknown");
- if (master_repository_uncasted->format_key())
- format = master_repository_uncasted->format_key()->value();
- if (format != "ebuild" && format != "ebin")
- throw ERepositoryConfigurationError("Master repository format is '" +
- stringify(format) + "', not 'ebuild' or 'ebin'");
-
- master_repository = tr1::static_pointer_cast<const ERepository>(master_repository_uncasted);
-
- if (master_repository->params().master_repository)
- throw ERepositoryConfigurationError("Requested master repository has a master_repository of '" +
- stringify(master_repository->params().master_repository->name()) + "', so it cannot "
- "be used as a master repository");
- }
-
- tr1::shared_ptr<FSEntrySequence> profiles(new FSEntrySequence);
- if (m->end() != m->find("profiles"))
- tokenise_whitespace(m->find("profiles")->second,
- create_inserter<FSEntry>(std::back_inserter(*profiles)));
-
- if (profiles->empty())
- {
- if (master_repository)
- std::copy(master_repository->params().profiles->begin(),
- master_repository->params().profiles->end(), profiles->back_inserter());
- else
- throw ERepositoryConfigurationError("No profiles have been specified");
- }
-
- tr1::shared_ptr<FSEntrySequence> eclassdirs(new FSEntrySequence);
-
- std::string setsdir;
- if (m->end() == m->find("setsdir") || ((setsdir = m->find("setsdir")->second)).empty())
- setsdir = location + "/sets";
-
- std::string securitydir;
- if (m->end() == m->find("securitydir") || ((securitydir = m->find("securitydir")->second)).empty())
- securitydir = location + "/metadata/glsa";
-
- std::string newsdir;
- if (m->end() == m->find("newsdir") || ((newsdir = m->find("newsdir")->second)).empty())
- newsdir = location + "/metadata/news";
-
- std::string names_cache;
- if (m->end() == m->find("names_cache") || ((names_cache = m->find("names_cache")->second)).empty())
- {
- Log::get_instance()->message(ll_warning, lc_no_context, "The names_cache key is not set in '"
- + repo_file + "'. You should read the Paludis documentation and select an "
- "appropriate value.");
- names_cache = "/var/empty";
- }
-
- std::string distdir;
- if (m->end() == m->find("distdir") || ((distdir = m->find("distdir")->second)).empty())
- {
- if (master_repository)
- distdir = stringify(master_repository->params().distdir);
- else
- {
- distdir = DistributionData::get_instance()->distribution_from_string(
- env->default_distribution())->default_ebuild_distdir;
- if (distdir.empty())
- distdir = location + "/distfiles";
- else if ('/' != distdir.at(0))
- distdir = location + "/" + distdir;
- }
- }
-
- std::string sync;
- if (m->end() != m->find("sync"))
- sync = m->find("sync")->second;
-
- std::string write_bin_uri_prefix;
- if (m->end() != m->find("write_bin_uri_prefix"))
- write_bin_uri_prefix = m->find("write_bin_uri_prefix")->second;
-
- std::string sync_options;
- if (m->end() != m->find("sync_options"))
- sync_options = m->find("sync_options")->second;
-
- std::string layout;
- if (m->end() == m->find("layout") || ((layout = m->find("layout")->second)).empty())
- layout = DistributionData::get_instance()->distribution_from_string(
- env->default_distribution())->default_ebuild_layout;
-
- std::string eapi_when_unknown;
- if (m->end() == m->find("eapi_when_unknown") || ((eapi_when_unknown = m->find("eapi_when_unknown")->second)).empty())
- eapi_when_unknown = DistributionData::get_instance()->distribution_from_string(
- env->default_distribution())->default_ebuild_eapi_when_unknown;
-
- std::string eapi_when_unspecified;
- if (m->end() == m->find("eapi_when_unspecified") || ((eapi_when_unspecified = m->find("eapi_when_unspecified")->second)).empty())
- 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 '"
- + repo_file + "' is deprecated in favour of sync_options = --exclude-from=");
- if (! sync_options.empty())
- sync_options += " ";
- sync_options += "--exclude-from='" + m->find("sync_exclude")->second + "'";
- }
-
- std::string builddir;
- if (m->end() == m->find("builddir") || ((builddir = m->find("builddir")->second)).empty())
- {
- if (m->end() == m->find("buildroot") || ((builddir = m->find("buildroot")->second)).empty())
- builddir = DistributionData::get_instance()->distribution_from_string(
- env->default_distribution())->default_ebuild_builddir;
- else
- Log::get_instance()->message(ll_warning, lc_context) << "Key 'buildroot' is deprecated, use 'builddir' instead";
- }
-
- erepository::UseManifest use_manifest(erepository::manifest_use);
- if (m->end() != m->find("use_manifest") && ! m->find("use_manifest")->second.empty())
- {
- Context item_context("When handling use_manifest key:");
- use_manifest = destringify<erepository::UseManifest>(m->find("use_manifest")->second);
- }
-
- return tr1::shared_ptr<ERepository>(new ERepository(ERepositoryParams::create()
- .entry_format("ebin")
- .layout(layout)
- .environment(env)
- .location(location)
- .profiles(profiles)
- .cache(FSEntry("/var/empty"))
- .write_cache(FSEntry("/var/empty"))
- .names_cache(names_cache)
- .eclassdirs(tr1::shared_ptr<const FSEntrySequence>(new FSEntrySequence))
- .distdir(FSEntry("/var/empty"))
- .securitydir(securitydir)
- .setsdir(setsdir)
- .newsdir(newsdir)
- .sync(sync)
- .sync_options(sync_options)
- .master_repository(master_repository)
- .enable_destinations(true)
- .write_bin_uri_prefix(write_bin_uri_prefix)
- .eapi_when_unspecified(eapi_when_unspecified)
- .eapi_when_unknown(eapi_when_unknown)
- .profile_eapi(profile_eapi)
- .use_manifest(use_manifest)
- .append_repository_name_to_write_cache(true)
- .ignore_deprecated_profiles(false)
- .builddir(builddir)));
-}
-
-tr1::shared_ptr<Repository>
-paludis::make_ebin_repository_wrapped(
- Environment * const env,
- tr1::shared_ptr<const Map<std::string, std::string> > m)
-{
- return make_ebin_repository(env, m);
-}
-
-
diff --git a/paludis/repositories/e/make_ebin_repository.hh b/paludis/repositories/e/make_ebin_repository.hh
deleted file mode 100644
index d2c05a0..0000000
--- a/paludis/repositories/e/make_ebin_repository.hh
+++ /dev/null
@@ -1,52 +0,0 @@
-/* vim: set sw=4 sts=4 et foldmethod=syntax : */
-
-/*
- * Copyright (c) 2007 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
- */
-
-#ifndef PALUDIS_GUARD_PALUDIS_REPOSITORIES_GENTOO_MAKE_EBIN_REPOSITORY_HH
-#define PALUDIS_GUARD_PALUDIS_REPOSITORIES_GENTOO_MAKE_EBIN_REPOSITORY_HH 1
-
-#include <paludis/repositories/e/e_repository.hh>
-#include <paludis/util/map-fwd.hh>
-
-namespace paludis
-{
- /**
- * Create an ebin format repository.
- *
- * \see ERepository
- * \ingroup grperepository
- */
- tr1::shared_ptr<ERepository>
- make_ebin_repository(
- Environment * const,
- tr1::shared_ptr<const Map<std::string, std::string> >) PALUDIS_VISIBLE;
-
- /**
- * Create an ebin format repository (wrapper for our virtual constructor).
- *
- * \see ERepository
- * \ingroup grperepository
- */
- tr1::shared_ptr<Repository>
- make_ebin_repository_wrapped(
- Environment * const env,
- tr1::shared_ptr<const Map<std::string, std::string> > m);
-}
-
-
-#endif
diff --git a/paludis/repositories/e/registration.cc b/paludis/repositories/e/registration.cc
index 4529330..a7ae39c 100644
--- a/paludis/repositories/e/registration.cc
+++ b/paludis/repositories/e/registration.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
@@ -19,7 +19,6 @@
#include <paludis/repository_maker.hh>
#include <paludis/repositories/e/make_ebuild_repository.hh>
-#include <paludis/repositories/e/make_ebin_repository.hh>
#include <paludis/repositories/e/vdb_repository.hh>
#include <paludis/util/log.hh>
#include <paludis/util/wrapped_forward_iterator.hh>
@@ -59,7 +58,6 @@ void register_repositories(RepositoryMaker * maker)
{
maker->register_maker("ebuild", &make_ebuild_repository_wrapped);
maker->register_maker("exheres", &make_ebuild_repository_wrapped);
- maker->register_maker("ebin", &make_ebin_repository_wrapped);
maker->register_maker("portage", &make_portage_repository);
maker->register_maker("vdb", &VDBRepository::make_vdb_repository);
}
diff --git a/paludis/repositories/e/vdb_repository.cc b/paludis/repositories/e/vdb_repository.cc
index ee682cb..0948e5f 100644
--- a/paludis/repositories/e/vdb_repository.cc
+++ b/paludis/repositories/e/vdb_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
@@ -1065,7 +1065,7 @@ bool
VDBRepository::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";
+ return f == "ebuild";
}
bool