aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2011-09-02 21:30:47 +0100
committerAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2011-09-02 21:30:47 +0100
commitd491d36b4c3fcb18818841a9ae08a8c99b48fc66 (patch)
tree1eb1fae3794b00c63d0be9964b4399c7834e5fee
parenta12fcfad377089b874926a30c6d5ec03e5635e70 (diff)
downloadpaludis-d491d36b4c3fcb18818841a9ae08a8c99b48fc66.tar.gz
paludis-d491d36b4c3fcb18818841a9ae08a8c99b48fc66.tar.xz
Move permit_destination into MergeParams
-rw-r--r--paludis/merger-fwd.hh15
-rw-r--r--paludis/merger.hh9
-rw-r--r--paludis/repositories/accounts/accounts_id.cc2
-rw-r--r--paludis/repositories/e/do_install_action.cc2
-rw-r--r--paludis/repositories/e/e_repository.cc2
-rw-r--r--paludis/repositories/e/exndbam_repository.cc2
-rw-r--r--paludis/repositories/e/vdb_repository.cc2
-rw-r--r--paludis/repositories/unavailable/unavailable_repository_id.cc2
-rw-r--r--paludis/repositories/unpackaged/installed_repository.cc2
-rw-r--r--paludis/repositories/unpackaged/unpackaged_id.cc1
-rw-r--r--paludis/repository.hh4
11 files changed, 28 insertions, 15 deletions
diff --git a/paludis/merger-fwd.hh b/paludis/merger-fwd.hh
index 5897aa1..13e3548 100644
--- a/paludis/merger-fwd.hh
+++ b/paludis/merger-fwd.hh
@@ -1,7 +1,7 @@
/* vim: set sw=4 sts=4 et foldmethod=syntax : */
/*
- * Copyright (c) 2010 Ciaran McCreesh
+ * Copyright (c) 2010, 2011 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
@@ -20,9 +20,11 @@
#ifndef PALUDIS_GUARD_PALUDIS_MERGER_FWD_HH
#define PALUDIS_GUARD_PALUDIS_MERGER_FWD_HH 1
-#include <iosfwd>
#include <paludis/util/attributes.hh>
#include <paludis/util/options-fwd.hh>
+#include <paludis/util/fs_path-fwd.hh>
+#include <iosfwd>
+#include <functional>
namespace paludis
{
@@ -38,6 +40,15 @@ namespace paludis
typedef Options<MergerOption> MergerOptions;
class Merger;
+
+ /**
+ * Whether to allow merging to a particular destination.
+ *
+ * \ingroup g_repository
+ * \see MergerParams
+ * \since 0.66
+ */
+ typedef std::function<bool (const FSPath &)> PermitDestinationFn;
}
#endif
diff --git a/paludis/merger.hh b/paludis/merger.hh
index 800c56f..72520f0 100644
--- a/paludis/merger.hh
+++ b/paludis/merger.hh
@@ -48,15 +48,6 @@ namespace paludis
}
/**
- * Whether to allow merging to a particular destination.
- *
- * \ingroup g_repository
- * \see MergerParams
- * \since 0.66
- */
- typedef std::function<bool (const FSPath &)> PermitDestinationFn;
-
- /**
* Parameters for a basic Merger.
*
* \see Merger
diff --git a/paludis/repositories/accounts/accounts_id.cc b/paludis/repositories/accounts/accounts_id.cc
index 086ad62..cd0db56 100644
--- a/paludis/repositories/accounts/accounts_id.cc
+++ b/paludis/repositories/accounts/accounts_id.cc
@@ -32,6 +32,7 @@
#include <paludis/util/wrapped_output_iterator.hh>
#include <paludis/util/make_null_shared_ptr.hh>
#include <paludis/util/singleton-impl.hh>
+#include <paludis/util/return_literal_function.hh>
#include <paludis/output_manager.hh>
#include <paludis/name.hh>
#include <paludis/version_spec.hh>
@@ -483,6 +484,7 @@ AccountsID::perform_action(Action & action) const
n::output_manager() = output_manager,
n::package_id() = shared_from_this(),
n::perform_uninstall() = install_action->options.perform_uninstall(),
+ n::permit_destination() = std::bind(return_literal_function(true)),
n::replacing() = install_action->options.replacing(),
n::used_this_for_config_protect() = std::bind(
&used_this_for_config_protect, std::ref(used_config_protect), std::placeholders::_1)
diff --git a/paludis/repositories/e/do_install_action.cc b/paludis/repositories/e/do_install_action.cc
index 38273e0..19c6466 100644
--- a/paludis/repositories/e/do_install_action.cc
+++ b/paludis/repositories/e/do_install_action.cc
@@ -38,6 +38,7 @@
#include <paludis/util/log.hh>
#include <paludis/util/join.hh>
#include <paludis/util/make_null_shared_ptr.hh>
+#include <paludis/util/return_literal_function.hh>
#include <paludis/action.hh>
#include <paludis/dep_spec_flattener.hh>
@@ -262,6 +263,7 @@ paludis::erepository::do_install_action(
n::output_manager() = output_manager,
n::package_id() = id,
n::perform_uninstall() = install_action.options.perform_uninstall(),
+ n::permit_destination() = std::bind(return_literal_function(true)),
n::replacing() = install_action.options.replacing(),
n::used_this_for_config_protect() = std::bind(
&used_this_for_config_protect, std::ref(used_config_protect), std::placeholders::_1)
diff --git a/paludis/repositories/e/e_repository.cc b/paludis/repositories/e/e_repository.cc
index b9d9ab4..7621639 100644
--- a/paludis/repositories/e/e_repository.cc
+++ b/paludis/repositories/e/e_repository.cc
@@ -1728,7 +1728,7 @@ ERepository::merge(const MergeParams & m)
n::options() = m.options(),
n::output_manager() = m.output_manager(),
n::package_id() = m.package_id(),
- n::permit_destination() = std::bind(return_literal_function(true)),
+ n::permit_destination() = m.permit_destination(),
n::root() = FSPath("/"),
n::tar_file() = _imp->params.binary_distdir() / (bin_dist_base + pbin_tar_extension)
));
diff --git a/paludis/repositories/e/exndbam_repository.cc b/paludis/repositories/e/exndbam_repository.cc
index c4e8160..a7ba233 100644
--- a/paludis/repositories/e/exndbam_repository.cc
+++ b/paludis/repositories/e/exndbam_repository.cc
@@ -445,7 +445,7 @@ ExndbamRepository::merge(const MergeParams & m)
n::options() = m.options(),
n::output_manager() = m.output_manager(),
n::package_id() = m.package_id(),
- n::permit_destination() = std::bind(return_literal_function(true)),
+ n::permit_destination() = m.permit_destination(),
n::root() = installed_root_key()->parse_value()
));
diff --git a/paludis/repositories/e/vdb_repository.cc b/paludis/repositories/e/vdb_repository.cc
index 00f734a..0129849 100644
--- a/paludis/repositories/e/vdb_repository.cc
+++ b/paludis/repositories/e/vdb_repository.cc
@@ -672,7 +672,7 @@ VDBRepository::merge(const MergeParams & m)
n::options() = m.options(),
n::output_manager() = m.output_manager(),
n::package_id() = m.package_id(),
- n::permit_destination() = std::bind(return_literal_function(true)),
+ n::permit_destination() = m.permit_destination(),
n::root() = installed_root_key()->parse_value()
));
diff --git a/paludis/repositories/unavailable/unavailable_repository_id.cc b/paludis/repositories/unavailable/unavailable_repository_id.cc
index 2ed9f31..9e054ea 100644
--- a/paludis/repositories/unavailable/unavailable_repository_id.cc
+++ b/paludis/repositories/unavailable/unavailable_repository_id.cc
@@ -28,6 +28,7 @@
#include <paludis/util/make_named_values.hh>
#include <paludis/util/make_null_shared_ptr.hh>
#include <paludis/util/singleton-impl.hh>
+#include <paludis/util/return_literal_function.hh>
#include <paludis/name.hh>
#include <paludis/version_spec.hh>
#include <paludis/metadata_key.hh>
@@ -229,6 +230,7 @@ UnavailableRepositoryID::perform_action(Action & action) const
n::output_manager() = output_manager,
n::package_id() = shared_from_this(),
n::perform_uninstall() = install_action->options.perform_uninstall(),
+ n::permit_destination() = std::bind(return_literal_function(true)),
n::replacing() = install_action->options.replacing(),
n::used_this_for_config_protect() = std::bind(
&used_this_for_config_protect, std::ref(used_config_protect), std::placeholders::_1)
diff --git a/paludis/repositories/unpackaged/installed_repository.cc b/paludis/repositories/unpackaged/installed_repository.cc
index 67a6c94..d9aecc2 100644
--- a/paludis/repositories/unpackaged/installed_repository.cc
+++ b/paludis/repositories/unpackaged/installed_repository.cc
@@ -378,7 +378,7 @@ InstalledUnpackagedRepository::merge(const MergeParams & m)
n::options() = m.options(),
n::output_manager() = m.output_manager(),
n::package_id() = m.package_id(),
- n::permit_destination() = std::bind(return_literal_function(true)),
+ n::permit_destination() = m.permit_destination(),
n::root() = installed_root_key()->parse_value()
));
diff --git a/paludis/repositories/unpackaged/unpackaged_id.cc b/paludis/repositories/unpackaged/unpackaged_id.cc
index fc52de8..9c72cf5 100644
--- a/paludis/repositories/unpackaged/unpackaged_id.cc
+++ b/paludis/repositories/unpackaged/unpackaged_id.cc
@@ -420,6 +420,7 @@ UnpackagedID::perform_action(Action & action) const
n::output_manager() = output_manager,
n::package_id() = shared_from_this(),
n::perform_uninstall() = install_action->options.perform_uninstall(),
+ n::permit_destination() = std::bind(return_literal_function(true)),
n::replacing() = install_action->options.replacing(),
n::used_this_for_config_protect() = std::bind(
&used_this_for_config_protect, std::ref(used_config_protect), std::placeholders::_1)
diff --git a/paludis/repository.hh b/paludis/repository.hh
index 0fbbd1a..3d0c523 100644
--- a/paludis/repository.hh
+++ b/paludis/repository.hh
@@ -72,6 +72,7 @@ namespace paludis
typedef Name<struct name_package_id> package_id;
typedef Name<struct name_path> path;
typedef Name<struct name_perform_uninstall> perform_uninstall;
+ typedef Name<struct name_permit_destination> permit_destination;
typedef Name<struct name_profile> profile;
typedef Name<struct name_replacing> replacing;
typedef Name<struct name_status> status;
@@ -141,6 +142,9 @@ namespace paludis
const std::shared_ptr<const PackageID> &,
const UninstallActionOptions &)> > perform_uninstall;
+ ///\since 0.66
+ NamedValue<n::permit_destination, PermitDestinationFn> permit_destination;
+
/**
* Someone needs to replace these (either the merge or the install).
*