aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2006-02-16 18:04:26 +0000
committerAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2006-02-16 18:04:26 +0000
commitb8e1933c89148a0880a4125ab417e2473e7d62ae (patch)
tree01fe46bff7fc8cba02a3335380fa430b93dfe5fd
parentb5a8c3a890b9ad24d8c0aa5f8efb49c60f0c79a8 (diff)
downloadpaludis-b8e1933c89148a0880a4125ab417e2473e7d62ae.tar.gz
paludis-b8e1933c89148a0880a4125ab417e2473e7d62ae.tar.xz
Allow qualudis to be run in the top level
-rw-r--r--src/qualudis/qualudis.cc30
1 files changed, 22 insertions, 8 deletions
diff --git a/src/qualudis/qualudis.cc b/src/qualudis/qualudis.cc
index 427b9d4..fefb7e8 100644
--- a/src/qualudis/qualudis.cc
+++ b/src/qualudis/qualudis.cc
@@ -258,14 +258,6 @@ namespace
}
bool
- do_check_top_level(const FSEntry & dir)
- {
- cout << "QA checks for top level directory " << dir << ":" << endl;
-
- throw DoHelp("qualudis cannot currently be run at the repository level");
- }
-
- bool
do_check_category_dir(const FSEntry & dir, const Environment & env)
{
cout << "QA checks for category directory " << dir << ":" << endl;
@@ -300,6 +292,28 @@ namespace
}
bool
+ do_check_top_level(const FSEntry & dir)
+ {
+ cout << "QA checks for top level directory " << dir << ":" << endl << endl;
+
+ qa::QAEnvironment env(dir);
+ bool ok(true);
+
+ for (DirIterator d(dir) ; d != DirIterator() ; ++d)
+ {
+ if (d->basename() == "CVS" || '.' == d->basename().at(0))
+ continue;
+ if (env.package_database()->fetch_repository(
+ env.package_database()->favourite_repository())->
+ has_category_named(CategoryNamePart(d->basename())))
+ ok &= do_check_category_dir(*d, env);
+ }
+
+ return ok;
+ }
+
+
+ bool
do_check(const FSEntry & dir)
{
if (std::count_if(DirIterator(dir), DirIterator(), IsFileWithExtension(