aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2006-12-28 15:42:47 +0000
committerAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2006-12-28 15:42:47 +0000
commitb3ea71e0bdc37ebac4234381ae0ec7ebdafe65f6 (patch)
tree57cad02c09cdd8a11114e08e06a67be1ecb83494
parente9c3bcc3c60614b8c41aa40f3c1c315b6395be17 (diff)
downloadpaludis-b3ea71e0bdc37ebac4234381ae0ec7ebdafe65f6.tar.gz
paludis-b3ea71e0bdc37ebac4234381ae0ec7ebdafe65f6.tar.xz
The uninstall_ hooks are now only called for real uninstalls. When cleaning a package, clean_ is used instead
-rw-r--r--hooks/Makefile.am.m44
-rwxr-xr-xhooks/log.bash16
-rw-r--r--paludis/tasks/install_task.cc10
3 files changed, 25 insertions, 5 deletions
diff --git a/hooks/Makefile.am.m4 b/hooks/Makefile.am.m4
index c723ec2..218c9b2 100644
--- a/hooks/Makefile.am.m4
+++ b/hooks/Makefile.am.m4
@@ -194,6 +194,10 @@ install-data-local :
ln -sf ../common/log.bash $(DESTDIR)/$(libexecdir)/paludis/hooks/fetch_all_post/
ln -sf ../common/log.bash $(DESTDIR)/$(libexecdir)/paludis/hooks/fetch_pre/
ln -sf ../common/log.bash $(DESTDIR)/$(libexecdir)/paludis/hooks/fetch_post/
+ ln -sf ../common/log.bash $(DESTDIR)/$(libexecdir)/paludis/hooks/clean_all_pre/
+ ln -sf ../common/log.bash $(DESTDIR)/$(libexecdir)/paludis/hooks/clean_all_post/
+ ln -sf ../common/log.bash $(DESTDIR)/$(libexecdir)/paludis/hooks/clean_pre/
+ ln -sf ../common/log.bash $(DESTDIR)/$(libexecdir)/paludis/hooks/clean_post/
ln -sf ../common/log.bash $(DESTDIR)/$(libexecdir)/paludis/hooks/uninstall_all_pre/
ln -sf ../common/log.bash $(DESTDIR)/$(libexecdir)/paludis/hooks/uninstall_all_post/
ln -sf ../common/log.bash $(DESTDIR)/$(libexecdir)/paludis/hooks/uninstall_pre/
diff --git a/hooks/log.bash b/hooks/log.bash
index 16a0022..f73ba20 100755
--- a/hooks/log.bash
+++ b/hooks/log.bash
@@ -57,6 +57,22 @@ X_OF_Y="${X_OF_Y+ (${X_OF_Y})}"
echo "finished uninstall of targets ${TARGETS}"
;;
+ clean_pre)
+ echo "starting clean of package ${TARGET}${X_OF_Y}"
+ ;;
+
+ clean_post)
+ echo "finished clean of package ${TARGET}${X_OF_Y}"
+ ;;
+
+ clean_all_pre)
+ echo "starting clean of targets ${TARGETS}"
+ ;;
+
+ clean_all_post)
+ echo "finished clean of targets ${TARGETS}"
+ ;;
+
fetch_pre)
echo "starting fetch of package ${TARGET}${X_OF_Y}"
;;
diff --git a/paludis/tasks/install_task.cc b/paludis/tasks/install_task.cc
index c6edd9a..2b12931 100644
--- a/paludis/tasks/install_task.cc
+++ b/paludis/tasks/install_task.cc
@@ -309,7 +309,7 @@ InstallTask::execute()
on_no_clean_needed(*dep);
else
{
- _imp->env->perform_hook(Hook("uninstall_all_pre")("TARGETS", join(
+ _imp->env->perform_hook(Hook("clean_all_pre")("TARGETS", join(
clean_list.begin(), clean_list.end(), " ")));
on_clean_all_pre(*dep, clean_list);
@@ -317,7 +317,7 @@ InstallTask::execute()
c_end(clean_list.end()) ; c != c_end ; ++c)
{
/* clean one item */
- _imp->env->perform_hook(Hook("uninstall_pre")("TARGET", stringify(*c))
+ _imp->env->perform_hook(Hook("clean_pre")("TARGET", stringify(*c))
("X_OF_Y", stringify(x) + " of " + stringify(y)));
on_clean_pre(*dep, *c);
@@ -333,17 +333,17 @@ InstallTask::execute()
}
catch (const PackageUninstallActionError & e)
{
- _imp->env->perform_hook(Hook("uninstall_fail")("TARGET", stringify(*c))("MESSAGE", e.message()));
+ _imp->env->perform_hook(Hook("clean_fail")("TARGET", stringify(*c))("MESSAGE", e.message()));
throw;
}
on_clean_post(*dep, *c);
- _imp->env->perform_hook(Hook("uninstall_post")("TARGET", stringify(*c))
+ _imp->env->perform_hook(Hook("clean_post")("TARGET", stringify(*c))
("X_OF_Y", stringify(x) + " of " + stringify(y)));
}
/* we're done cleaning */
- _imp->env->perform_hook(Hook("uninstall_all_post")("TARGETS", join(
+ _imp->env->perform_hook(Hook("clean_all_post")("TARGETS", join(
clean_list.begin(), clean_list.end(), " ")));
on_clean_all_post(*dep, clean_list);
}