aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAvatar Fernando J. Pereda <ferdy@ferdyx.org> 2008-05-19 16:42:11 +0000
committerAvatar Fernando J. Pereda <ferdy@ferdyx.org> 2008-05-19 16:42:11 +0000
commit995aa300f3d2d404b12239eefc626eda4d98cf7d (patch)
tree59edc646558c8aba895829f1d2b5dc614981b06d
parentaf76512521d812ff4312a84bcdf82d3e8ff63e0c (diff)
downloadpaludis-995aa300f3d2d404b12239eefc626eda4d98cf7d.tar.gz
paludis-995aa300f3d2d404b12239eefc626eda4d98cf7d.tar.xz
Add REAL_DESTINATION to merger hooks. From samvimes. Fixes ticket:550
-rw-r--r--paludis/merger.cc12
1 files changed, 7 insertions, 5 deletions
diff --git a/paludis/merger.cc b/paludis/merger.cc
index f36ff02..7f00c00 100644
--- a/paludis/merger.cc
+++ b/paludis/merger.cc
@@ -661,16 +661,17 @@ Merger::install_file(const FSEntry & src, const FSEntry & dst_dir, const std::st
+ stringify(dst_name) + "':");
MergeStatusFlags result;
+ FSEntry dst(dst_dir / (stringify(dst_name) + "|paludis-midmerge"));
+ FSEntry dst_real(dst_dir / dst_name);
+
if (0 != _imp->params[k::environment()]->perform_hook(extend_hook(
Hook("merger_install_file_pre")
("INSTALL_SOURCE", stringify(src))
- ("INSTALL_DESTINATION", stringify(dst_dir / src.basename())))).max_exit_status)
+ ("INSTALL_DESTINATION", stringify(dst_dir / src.basename()))
+ ("REAL_DESTINATION", stringify(dst_real)))).max_exit_status)
Log::get_instance()->message("merger.file.pre_hooks.failure", ll_warning, lc_context) <<
"Merge of '" << src << "' to '" << dst_dir << "' pre hooks returned non-zero";
- FSEntry dst(dst_dir / (stringify(dst_name) + "|paludis-midmerge"));
- FSEntry dst_real(dst_dir / dst_name);
-
std::tr1::shared_ptr<const SecurityContext> secctx(MatchPathCon::get_instance()->match(stringify(dst_real), src.permissions()));
FSCreateCon createcon(secctx);
if (0 != paludis::setfilecon(src, secctx))
@@ -768,7 +769,8 @@ Merger::install_file(const FSEntry & src, const FSEntry & dst_dir, const std::st
if (0 != _imp->params[k::environment()]->perform_hook(extend_hook(
Hook("merger_install_file_post")
("INSTALL_SOURCE", stringify(src))
- ("INSTALL_DESTINATION", stringify(dst_dir / src.basename())))).max_exit_status)
+ ("INSTALL_DESTINATION", stringify(dst_dir / src.basename()))
+ ("REAL_DESTINATION", stringify(dst_real)))).max_exit_status)
Log::get_instance()->message("merger.file.post_hooks.failed", ll_warning, lc_context) <<
"Merge of '" << src << "' to '" << dst_dir << "' post hooks returned non-zero";