aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2007-02-14 21:54:15 +0000
committerAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2007-02-14 21:54:15 +0000
commitf55991f1d35ed3b6b2dd47ed41691bb63dd4301c (patch)
tree7e2c70ccd9c7375f90d80ada39631e7d2781f35e
parent289c92ecfaceb6230346e9ff439c54ab99685ce3 (diff)
downloadpaludis-f55991f1d35ed3b6b2dd47ed41691bb63dd4301c.tar.gz
paludis-f55991f1d35ed3b6b2dd47ed41691bb63dd4301c.tar.xz
Destination aware hooks
-rwxr-xr-xhooks/eselect_env_update.bash9
-rwxr-xr-xhooks/find_config_updates.bash7
-rwxr-xr-xhooks/gnu_info_index.bash7
-rwxr-xr-xhooks/update_config_protect_list.bash5
-rw-r--r--paludis/tasks/install_task.cc35
5 files changed, 52 insertions, 11 deletions
diff --git a/hooks/eselect_env_update.bash b/hooks/eselect_env_update.bash
index eb31850..b37628a 100755
--- a/hooks/eselect_env_update.bash
+++ b/hooks/eselect_env_update.bash
@@ -1,7 +1,7 @@
#!/bin/bash
# vim: set et sw=4 sts=4 :
-# Copyright (c) 2006 Ciaran McCreesh <ciaranm@ciaranm.org>
+# Copyright (c) 2006, 2007 Ciaran McCreesh <ciaranm@ciaranm.org>
#
# 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
@@ -19,8 +19,15 @@
export PATH="$(${PALUDIS_EBUILD_DIR}/utils/canonicalise ${PALUDIS_EBUILD_DIR}/utils/ ):${PATH}"
source ${PALUDIS_EBUILD_DIR}/echo_functions.bash
+if [[ -n "${PALUDIS_NO_LIVE_DESTINATION}" ]] ; then
+ einfo_unhooked "No need to regenerate environment"
+ exit 0
+fi
+
echo
einfo_unhooked "Regenerating environment..."
eselect env update || exit 1
einfo_unhooked "Done regenerating environment"
+true
+
diff --git a/hooks/find_config_updates.bash b/hooks/find_config_updates.bash
index 983684b..f7af8e0 100755
--- a/hooks/find_config_updates.bash
+++ b/hooks/find_config_updates.bash
@@ -1,7 +1,7 @@
#!/bin/bash
# vim: set et sw=4 sts=4 :
-# Copyright (c) 2006 Ciaran McCreesh <ciaranm@ciaranm.org>
+# Copyright (c) 2006, 2007 Ciaran McCreesh <ciaranm@ciaranm.org>
#
# 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
@@ -21,6 +21,11 @@ shopt -s extglob
export PATH="$(${PALUDIS_EBUILD_DIR}/utils/canonicalise ${PALUDIS_EBUILD_DIR}/utils/ ):${PATH}"
source ${PALUDIS_EBUILD_DIR}/echo_functions.bash
+if [[ -n "${PALUDIS_NO_LIVE_DESTINATION}" ]] ; then
+ einfo_unhooked "No need to search for configuration files requiring action"
+ exit 0
+fi
+
echo
einfo_unhooked "Searching for configuration files requiring action..."
diff --git a/hooks/gnu_info_index.bash b/hooks/gnu_info_index.bash
index f96c690..0fdaab0 100755
--- a/hooks/gnu_info_index.bash
+++ b/hooks/gnu_info_index.bash
@@ -1,7 +1,7 @@
#!/bin/bash
# vim: set et sw=4 sts=4 :
-# Copyright (c) 2006 Ciaran McCreesh <ciaranm@ciaranm.org>
+# Copyright (c) 2006, 2007 Ciaran McCreesh <ciaranm@ciaranm.org>
#
# 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
@@ -19,6 +19,11 @@
export PATH="$(${PALUDIS_EBUILD_DIR}/utils/canonicalise ${PALUDIS_EBUILD_DIR}/utils/ ):${PATH}"
source ${PALUDIS_EBUILD_DIR}/echo_functions.bash
+if [[ -n "${PALUDIS_NO_LIVE_DESTINATION}" ]] ; then
+ einfo_unhooked "No need to update the GNU info directory"
+ exit 0
+fi
+
echo
einfo_unhooked "Checking whether the GNU info directory needs updating..."
diff --git a/hooks/update_config_protect_list.bash b/hooks/update_config_protect_list.bash
index 735ceae..c2c1e3e 100755
--- a/hooks/update_config_protect_list.bash
+++ b/hooks/update_config_protect_list.bash
@@ -19,6 +19,11 @@
source ${PALUDIS_EBUILD_DIR}/echo_functions.bash
+if [[ -n "${PALUDIS_NO_LIVE_DESTINATION}" ]] ; then
+ einfo_unhooked "No need to update CONFIG_PROTECT lists"
+ exit 0
+fi
+
vdb_loc="$(${PALUDIS_COMMAND} --log-level silent --configuration-variable installed location )"
cfg_protect_list="${vdb_loc}/.cache/all_CONFIG_PROTECT"
cfg_protect_mask_list="${vdb_loc}/.cache/all_CONFIG_PROTECT_MASK"
diff --git a/paludis/tasks/install_task.cc b/paludis/tasks/install_task.cc
index bc2e195..c78aa6a 100644
--- a/paludis/tasks/install_task.cc
+++ b/paludis/tasks/install_task.cc
@@ -224,8 +224,17 @@ InstallTask::execute()
}
else
{
- _imp->env->perform_hook(Hook("install_all_pre")("TARGETS", join(
- _imp->raw_targets.begin(), _imp->raw_targets.end(), " ")));
+ bool any_live_destination(false);
+ for (DepList::Iterator dep(_imp->dep_list.begin()), dep_end(_imp->dep_list.end()) ;
+ dep != dep_end && ! any_live_destination ; ++dep)
+ if (dlk_package == dep->kind)
+ if (dep->destination && dep->destination->destination_interface &&
+ dep->destination->destination_interface->want_pre_post_phases())
+ any_live_destination = true;
+
+ _imp->env->perform_hook(Hook("install_all_pre")
+ ("TARGETS", join(_imp->raw_targets.begin(), _imp->raw_targets.end(), " "))
+ ("PALUDIS_NO_LIVE_DESTINATION", any_live_destination ? "" : "yes"));
on_install_all_pre();
}
@@ -242,6 +251,11 @@ InstallTask::execute()
if (dlk_package != dep->kind)
continue;
+ bool live_destination(false);
+ if (dep->destination && dep->destination->destination_interface &&
+ dep->destination->destination_interface->want_pre_post_phases())
+ live_destination = true;
+
++x;
_imp->current_dep_list_entry = dep;
@@ -259,8 +273,10 @@ InstallTask::execute()
}
else
{
- _imp->env->perform_hook(Hook("install_pre")("TARGET", cpvr)
- ("X_OF_Y", stringify(x) + " of " + stringify(y)));
+ _imp->env->perform_hook(Hook("install_pre")
+ ("TARGET", cpvr)
+ ("X_OF_Y", stringify(x) + " of " + stringify(y))
+ ("PALUDIS_NO_LIVE_DESTINATION", live_destination ? "" : "yes"));
on_install_pre(*dep);
}
@@ -286,17 +302,20 @@ InstallTask::execute()
if (_imp->install_options.fetch_only)
{
on_fetch_post(*dep);
- _imp->env->perform_hook(Hook("fetch_post")("TARGET", cpvr)
+ _imp->env->perform_hook(Hook("fetch_post")
+ ("TARGET", cpvr)
("X_OF_Y", stringify(x) + " of " + stringify(y)));
}
else
{
on_install_post(*dep);
- _imp->env->perform_hook(Hook("install_post")("TARGET", cpvr)
- ("X_OF_Y", stringify(x) + " of " + stringify(y)));
+ _imp->env->perform_hook(Hook("install_post")
+ ("TARGET", cpvr)
+ ("X_OF_Y", stringify(x) + " of " + stringify(y))
+ ("PALUDIS_NO_LIVE_DESTINATION", live_destination ? "" : "yes"));
}
- if (_imp->install_options.fetch_only)
+ if (_imp->install_options.fetch_only || ! live_destination)
continue;
/* figure out whether we need to unmerge (clean) anything */