aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2006-05-02 13:13:04 +0000
committerAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2006-05-02 13:13:04 +0000
commit87b9b122ea18ce7cfe72f141e8d22da9bbca8990 (patch)
treef49e604c6f901c28d113df86098b2dbb9d923218
parentb1ec2b007ac4beb6cf60785a951a661ff4845c9f (diff)
downloadpaludis-87b9b122ea18ce7cfe72f141e8d22da9bbca8990.tar.gz
paludis-87b9b122ea18ce7cfe72f141e8d22da9bbca8990.tar.xz
Hooks now get called even if repository names aren't passed on the commandline.
-rw-r--r--src/sync.cc13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/sync.cc b/src/sync.cc
index 750601f..2876f0a 100644
--- a/src/sync.cc
+++ b/src/sync.cc
@@ -67,9 +67,22 @@ int do_sync()
p::Environment * const env(p::DefaultEnvironment::get_instance());
if (CommandLine::get_instance()->empty())
+ {
+ std::string targets;
+ for (p::PackageDatabase::RepositoryIterator r(env->package_database()->begin_repositories()),
+ r_end(env->package_database()->end_repositories()) ; r != r_end ; ++r)
+ targets.append(stringify((*r)->name()) + " ");
+
+ env->perform_hook(p::Hook("sync_all_pre")("TARGETS", targets));
for (p::PackageDatabase::RepositoryIterator r(env->package_database()->begin_repositories()),
r_end(env->package_database()->end_repositories()) ; r != r_end ; ++r)
+ {
+ env->perform_hook(p::Hook("sync_pre")("TARGET", stringify((*r)->name())));
return_code |= do_one_sync(*r);
+ env->perform_hook(p::Hook("sync_post")("TARGET", stringify((*r)->name())));
+ }
+ env->perform_hook(p::Hook("sync_all_post")("TARGETS", targets));
+ }
else
{
std::set<p::RepositoryName> repo_names;