aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2009-01-11 19:41:50 +0000
committerAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2009-01-11 19:41:50 +0000
commit01e05d7963d67818635b44e60e15f8c15f08ea1e (patch)
tree272d9e212b8189e239a64bf825062960efb22e4f
parent3932acf512bbf016d53ce0182ee02cbca60bcca0 (diff)
downloadpaludis-01e05d7963d67818635b44e60e15f8c15f08ea1e.tar.gz
paludis-01e05d7963d67818635b44e60e15f8c15f08ea1e.tar.xz
define merge and strip phases for unpackaged
Fixes: ticket:699
-rw-r--r--paludis/repositories/unpackaged/unpackaged_id.cc70
1 files changed, 51 insertions, 19 deletions
diff --git a/paludis/repositories/unpackaged/unpackaged_id.cc b/paludis/repositories/unpackaged/unpackaged_id.cc
index d9e76a4..3a3e232 100644
--- a/paludis/repositories/unpackaged/unpackaged_id.cc
+++ b/paludis/repositories/unpackaged/unpackaged_id.cc
@@ -1,7 +1,7 @@
/* vim: set sw=4 sts=4 et foldmethod=syntax : */
/*
- * Copyright (c) 2007, 2008 Ciaran McCreesh
+ * Copyright (c) 2007, 2008, 2009 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
@@ -311,24 +311,56 @@ UnpackagedID::perform_action(Action & action) const
std::tr1::shared_ptr<const ChoiceValue> split_choice(choices_key()->value()->find_by_name_with_prefix(
ELikeSplitChoiceValue::canonical_name_with_prefix()));
- UnpackagedStripper stripper(make_named_values<UnpackagedStripperOptions>(
- value_for<n::debug_dir>(fs_location_key()->value() / "usr" / libdir / "debug"),
- value_for<n::image_dir>(fs_location_key()->value()),
- value_for<n::package_id>(shared_from_this()),
- value_for<n::split>(split_choice && split_choice->enabled()),
- value_for<n::strip>(strip_choice && strip_choice->enabled())
- ));
-
- stripper.strip();
-
- (*install_action->options.destination()).destination_interface()->merge(
- make_named_values<MergeParams>(
- value_for<n::environment_file>(FSEntry("/dev/null")),
- value_for<n::image_dir>(fs_location_key()->value()),
- value_for<n::options>(MergerOptions() + mo_rewrite_symlinks + mo_allow_empty_dirs),
- value_for<n::package_id>(shared_from_this()),
- value_for<n::used_this_for_config_protect>(install_action->options.used_this_for_config_protect())
- ));
+ switch (install_action->options.want_phase()("strip"))
+ {
+ case wp_yes:
+ {
+ UnpackagedStripper stripper(make_named_values<UnpackagedStripperOptions>(
+ value_for<n::debug_dir>(fs_location_key()->value() / "usr" / libdir / "debug"),
+ value_for<n::image_dir>(fs_location_key()->value()),
+ value_for<n::package_id>(shared_from_this()),
+ value_for<n::split>(split_choice && split_choice->enabled()),
+ value_for<n::strip>(strip_choice && strip_choice->enabled())
+ ));
+
+ stripper.strip();
+ }
+ break;
+
+ case wp_skip:
+ break;
+
+ case wp_abort:
+ throw InstallActionError("Told to abort install");
+
+ case last_wp:
+ throw InternalError(PALUDIS_HERE, "bad WantPhase");
+ }
+
+ switch (install_action->options.want_phase()("merge"))
+ {
+ case wp_yes:
+ {
+ (*install_action->options.destination()).destination_interface()->merge(
+ make_named_values<MergeParams>(
+ value_for<n::environment_file>(FSEntry("/dev/null")),
+ value_for<n::image_dir>(fs_location_key()->value()),
+ value_for<n::options>(MergerOptions() + mo_rewrite_symlinks + mo_allow_empty_dirs),
+ value_for<n::package_id>(shared_from_this()),
+ value_for<n::used_this_for_config_protect>(install_action->options.used_this_for_config_protect())
+ ));
+ }
+ break;
+
+ case wp_skip:
+ break;
+
+ case wp_abort:
+ throw InstallActionError("Told to abort install");
+
+ case last_wp:
+ throw InternalError(PALUDIS_HERE, "bad WantPhase");
+ }
}
void