aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAvatar David Leverton <levertond@googlemail.com> 2007-05-24 00:45:22 +0000
committerAvatar David Leverton <levertond@googlemail.com> 2007-05-24 00:45:22 +0000
commitcf616f5e930fafe86d91915d7c90a04118916380 (patch)
tree011a376bf936e11f472a272aacbeeef9ca58fc5f
parent4af5e94330ce7d8f9e3fbab11eca8971a8f6be60 (diff)
downloadpaludis-cf616f5e930fafe86d91915d7c90a04118916380.tar.gz
paludis-cf616f5e930fafe86d91915d7c90a04118916380.tar.xz
Rename _skip hooks to _override; accept "force" as hook output instead of "noskip".
-rw-r--r--paludis/merger/merger.cc12
-rw-r--r--paludis/merger/merger.hh2
-rw-r--r--paludis/merger/merger_TEST.cc20
-rwxr-xr-xpaludis/merger/merger_TEST_setup.sh34
-rw-r--r--paludis/merger/unmerger.cc20
-rw-r--r--paludis/repositories/gentoo/vdb_merger.cc2
-rw-r--r--paludis/repositories/gentoo/vdb_merger.hh2
7 files changed, 46 insertions, 46 deletions
diff --git a/paludis/merger/merger.cc b/paludis/merger/merger.cc
index 728524b..bd66601 100644
--- a/paludis/merger/merger.cc
+++ b/paludis/merger/merger.cc
@@ -207,7 +207,7 @@ Merger::on_file(bool is_check, const FSEntry & src, const FSEntry & dst)
if (! is_check)
{
HookResult hr(_options.environment->perform_hook(extend_hook(
- Hook("merger_install_file_skip")
+ Hook("merger_install_file_override")
("INSTALL_SOURCE", stringify(src))
("INSTALL_DESTINATION", stringify(dst / src.basename()))
.grab_output(Hook::AllowedOutputValues()("skip")))));
@@ -218,7 +218,7 @@ Merger::on_file(bool is_check, const FSEntry & src, const FSEntry & dst)
else if (hr.output == "skip")
{
std::string tidy(stringify((dst / src.basename()).strip_leading(_options.root)));
- display_skip("--- [skp] " + tidy);
+ display_override("--- [skp] " + tidy);
return;
}
}
@@ -279,7 +279,7 @@ Merger::on_dir(bool is_check, const FSEntry & src, const FSEntry & dst)
if (! is_check)
{
HookResult hr(_options.environment->perform_hook(extend_hook(
- Hook("merger_install_dir_skip")
+ Hook("merger_install_dir_override")
("INSTALL_SOURCE", stringify(src))
("INSTALL_DESTINATION", stringify(dst / src.basename()))
.grab_output(Hook::AllowedOutputValues()("skip")))));
@@ -290,7 +290,7 @@ Merger::on_dir(bool is_check, const FSEntry & src, const FSEntry & dst)
else if (hr.output == "skip")
{
std::string tidy(stringify((dst / src.basename()).strip_leading(_options.root)));
- display_skip("--- [skp] " + tidy);
+ display_override("--- [skp] " + tidy);
_skip_dir = true;
return;
}
@@ -353,7 +353,7 @@ Merger::on_sym(bool is_check, const FSEntry & src, const FSEntry & dst)
if (! is_check)
{
HookResult hr(_options.environment->perform_hook(extend_hook(
- Hook("merger_install_sym_skip")
+ Hook("merger_install_sym_override")
("INSTALL_SOURCE", stringify(src))
("INSTALL_DESTINATION", stringify(dst / src.basename()))
.grab_output(Hook::AllowedOutputValues()("skip")))));
@@ -364,7 +364,7 @@ Merger::on_sym(bool is_check, const FSEntry & src, const FSEntry & dst)
else if (hr.output == "skip")
{
std::string tidy(stringify((dst / src.basename()).strip_leading(_options.root)));
- display_skip("--- [skp] " + tidy);
+ display_override("--- [skp] " + tidy);
return;
}
}
diff --git a/paludis/merger/merger.hh b/paludis/merger/merger.hh
index 14c12a7..b581777 100644
--- a/paludis/merger/merger.hh
+++ b/paludis/merger/merger.hh
@@ -155,7 +155,7 @@ namespace paludis
*/
virtual void on_warn(bool is_check, const std::string &) = 0;
- virtual void display_skip(const std::string &) const = 0;
+ virtual void display_override(const std::string &) const = 0;
///\name Configuration protection
///\{
diff --git a/paludis/merger/merger_TEST.cc b/paludis/merger/merger_TEST.cc
index 9b10c0c..c812df5 100644
--- a/paludis/merger/merger_TEST.cc
+++ b/paludis/merger/merger_TEST.cc
@@ -107,7 +107,7 @@ namespace
{
}
- void display_skip(const std::string &) const
+ void display_override(const std::string &) const
{
}
@@ -423,30 +423,30 @@ namespace test_cases
}
} test_merger_file_dir;
- struct MergerSkipTest : MergerTest
+ struct MergerOverrideTest : MergerTest
{
- MergerSkipTest() : MergerTest("skip") { }
+ MergerOverrideTest() : MergerTest("override") { }
void run()
{
TEST_CHECK((image_dir / "dir_skip_me").is_directory());
- TEST_CHECK((image_dir / "dir_noskip_me").is_directory());
+ TEST_CHECK((image_dir / "dir_force_me").is_directory());
TEST_CHECK((image_dir / "file_skip_me").is_regular_file());
- TEST_CHECK((image_dir / "file_noskip_me").is_regular_file());
+ TEST_CHECK((image_dir / "file_force_me").is_regular_file());
TEST_CHECK((image_dir / "sym_skip_me").is_symbolic_link());
- TEST_CHECK((image_dir / "sym_noskip_me").is_symbolic_link());
+ TEST_CHECK((image_dir / "sym_force_me").is_symbolic_link());
TEST_CHECK(merger.check());
merger.merge();
TEST_CHECK(! (root_dir / "dir_skip_me").exists());
- TEST_CHECK((root_dir / "dir_noskip_me").is_directory());
+ TEST_CHECK((root_dir / "dir_force_me").is_directory());
TEST_CHECK(! (root_dir / "file_skip_me").exists());
- TEST_CHECK((root_dir / "file_noskip_me").is_regular_file());
+ TEST_CHECK((root_dir / "file_force_me").is_regular_file());
TEST_CHECK(! (root_dir / "sym_skip_me").exists());
- TEST_CHECK((root_dir / "sym_noskip_me").is_symbolic_link());
+ TEST_CHECK((root_dir / "sym_force_me").is_symbolic_link());
}
- } test_merger_skip;
+ } test_merger_override;
}
diff --git a/paludis/merger/merger_TEST_setup.sh b/paludis/merger/merger_TEST_setup.sh
index cb41d4e..f8597ab 100755
--- a/paludis/merger/merger_TEST_setup.sh
+++ b/paludis/merger/merger_TEST_setup.sh
@@ -71,42 +71,42 @@ mkdir image_file_over_dir root_file_over_dir
> image_file_over_dir/file
mkdir root_file_over_dir/file
-mkdir image_skip root_skip
-mkdir image_skip/dir_skip_me/
-mkdir image_skip/dir_noskip_me/
-> image_skip/file_skip_me
-> image_skip/file_noskip_me
-ln -s image_skip/file_skip_me image_skip/sym_skip_me
-ln -s image_skip/file_noskip_me image_skip/sym_noskip_me
+mkdir image_override root_override
+mkdir image_override/dir_skip_me/
+mkdir image_override/dir_force_me/
+> image_override/file_skip_me
+> image_override/file_force_me
+ln -s image_override/file_skip_me image_override/sym_skip_me
+ln -s image_override/file_force_me image_override/sym_force_me
mkdir hooks
cd hooks
mkdir \
-merger_install_file_skip \
-merger_install_sym_skip \
-merger_install_dir_skip
+merger_install_file_override \
+merger_install_sym_override \
+merger_install_dir_override
-cat <<"END" > universal_skip.hook
-hook_run_merger_install_file_skip() {
+cat <<"END" > universal_override.hook
+hook_run_merger_install_file_override() {
if [[ "${INSTALL_DESTINATION}" == *"/file_skip_me" ]]; then
echo "skip"
fi
}
-hook_run_merger_install_sym_skip() {
+hook_run_merger_install_sym_override() {
if [[ "${INSTALL_DESTINATION}" == *"/sym_skip_me" ]]; then
echo "skip"
fi
}
-hook_run_merger_install_dir_skip() {
+hook_run_merger_install_dir_override() {
if [[ "${INSTALL_DESTINATION}" == *"/dir_skip_me" ]]; then
echo "skip"
fi
}
END
-chmod +x universal_skip.hook
-for dir in merger_install_*_skip; do
- ln -s ../universal_skip.hook ${dir}
+chmod +x universal_override.hook
+for dir in merger_install_*_override; do
+ ln -s ../universal_override.hook ${dir}
done
diff --git a/paludis/merger/unmerger.cc b/paludis/merger/unmerger.cc
index 761c9ea..2ce8154 100644
--- a/paludis/merger/unmerger.cc
+++ b/paludis/merger/unmerger.cc
@@ -121,15 +121,15 @@ Unmerger::unmerge_file(FSEntry & f) const
FSEntry f_real(_imp->options.root / f);
HookResult hr(_imp->options.environment->perform_hook(extend_hook(
- Hook("unmerger_unlink_file_skip")
+ Hook("unmerger_unlink_file_override")
("UNLINK_TARGET", stringify(f_real))
- .grab_output(Hook::AllowedOutputValues()("skip")("noskip")))));
+ .grab_output(Hook::AllowedOutputValues()("skip")("force")))));
if (hr.max_exit_status != 0)
throw UnmergerError("Unmerge of '" + stringify(f) + "' aborted by hook");
else if (hr.output == "skip")
display("--- [skip ] " + stringify(f));
- else if (hr.output == "noskip")
+ else if (hr.output == "force")
{
display("<<< [force] " + stringify(f));
unlink_file(f_real);
@@ -147,15 +147,15 @@ Unmerger::unmerge_sym(FSEntry & f) const
FSEntry f_real(_imp->options.root / f);
HookResult hr(_imp->options.environment->perform_hook(extend_hook(
- Hook("unmerger_unlink_sym_skip")
+ Hook("unmerger_unlink_sym_override")
("UNLINK_TARGET", stringify(f_real))
- .grab_output(Hook::AllowedOutputValues()("skip")("noskip")))));
+ .grab_output(Hook::AllowedOutputValues()("skip")("force")))));
if (hr.max_exit_status != 0)
throw UnmergerError("Unmerge of '" + stringify(f) + "' aborted by hook");
else if (hr.output == "skip")
display("--- [skip ] " + stringify(f));
- else if (hr.output == "noskip")
+ else if (hr.output == "force")
{
display("<<< [force] " + stringify(f));
unlink_sym(f_real);
@@ -173,7 +173,7 @@ Unmerger::unmerge_dir(FSEntry & f) const
FSEntry f_real(_imp->options.root / f);
HookResult hr(_imp->options.environment->perform_hook(extend_hook(
- Hook("unmerger_unlink_dir_skip")
+ Hook("unmerger_unlink_dir_override")
("UNLINK_TARGET", stringify(f_real))
.grab_output(Hook::AllowedOutputValues()("skip")))));
@@ -194,15 +194,15 @@ Unmerger::unmerge_misc(FSEntry & f) const
FSEntry f_real(_imp->options.root / f);
HookResult hr(_imp->options.environment->perform_hook(extend_hook(
- Hook("unmerger_unlink_misc_skip")
+ Hook("unmerger_unlink_misc_override")
("UNLINK_TARGET", stringify(f_real))
- .grab_output(Hook::AllowedOutputValues()("skip")("noskip")))));
+ .grab_output(Hook::AllowedOutputValues()("skip")("force")))));
if (hr.max_exit_status != 0)
throw UnmergerError("Unmerge of '" + stringify(f) + "' aborted by hook");
else if (hr.output == "skip")
display("--- [skip ] " + stringify(f));
- else if (hr.output == "noskip")
+ else if (hr.output == "force")
{
display("<<< [force] " + stringify(f));
unlink_misc(f_real);
diff --git a/paludis/repositories/gentoo/vdb_merger.cc b/paludis/repositories/gentoo/vdb_merger.cc
index 161f403..85fc793 100644
--- a/paludis/repositories/gentoo/vdb_merger.cc
+++ b/paludis/repositories/gentoo/vdb_merger.cc
@@ -241,7 +241,7 @@ VDBMerger::on_enter_dir(bool is_check, const FSEntry)
}
void
-VDBMerger::display_skip(const std::string & message) const
+VDBMerger::display_override(const std::string & message) const
{
std::cout << message << std::endl;
}
diff --git a/paludis/repositories/gentoo/vdb_merger.hh b/paludis/repositories/gentoo/vdb_merger.hh
index 4b6f467..5f02f91 100644
--- a/paludis/repositories/gentoo/vdb_merger.hh
+++ b/paludis/repositories/gentoo/vdb_merger.hh
@@ -41,7 +41,7 @@ namespace paludis
private PrivateImplementationPattern<VDBMerger>
{
private:
- void display_skip(const std::string &) const;
+ void display_override(const std::string &) const;
public:
///\name Basic operations