aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2006-02-17 03:33:31 +0000
committerAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2006-02-17 03:33:31 +0000
commit174e8f6c0cc10f488ea24b4998e1f41c978be315 (patch)
tree87ef1f1d29b3020db94f2e3623c1dc79c3de04c9
parent8dfe92a31857813df77cc4e331ec2afa75464d4a (diff)
downloadpaludis-174e8f6c0cc10f488ea24b4998e1f41c978be315.tar.gz
paludis-174e8f6c0cc10f488ea24b4998e1f41c978be315.tar.xz
Allow eclass/ checking
-rw-r--r--paludis/qa/whitespace_check.cc5
-rw-r--r--src/qualudis/qualudis.cc46
2 files changed, 47 insertions, 4 deletions
diff --git a/paludis/qa/whitespace_check.cc b/paludis/qa/whitespace_check.cc
index ec21ac3..56de608 100644
--- a/paludis/qa/whitespace_check.cc
+++ b/paludis/qa/whitespace_check.cc
@@ -36,8 +36,9 @@ WhitespaceCheck::operator() (const FSEntry & f) const
if (! f.is_regular_file())
result << Message(qal_skip, "Not a regular file");
else if (! IsFileWithExtension(".ebuild")(f.basename()) &&
- ! IsFileWithExtension(".xml")(f.basename()))
- result << Message(qal_skip, "Not an ebuild or xml file");
+ ! IsFileWithExtension(".xml")(f.basename()) &&
+ ! IsFileWithExtension(".eclass")(f.basename()))
+ result << Message(qal_skip, "Not an ebuild, eclass or xml file");
else
{
std::ifstream ff(stringify(f).c_str());
diff --git a/src/qualudis/qualudis.cc b/src/qualudis/qualudis.cc
index 83e24e5..5d14cab 100644
--- a/src/qualudis/qualudis.cc
+++ b/src/qualudis/qualudis.cc
@@ -298,6 +298,40 @@ namespace
}
bool
+ do_check_eclass_dir(const FSEntry & dir, const Environment &)
+ {
+ Context context("When checking eclass directory '" + stringify(dir) + "':");
+
+ cout << "QA checks for eclass directory " << dir << ":" << endl;
+ cout << endl;
+
+ bool ok(true);
+
+ for (DirIterator d(dir) ; d != DirIterator() ; ++d)
+ {
+ if ("CVS" == d->basename())
+ continue;
+ else if ('.' == d->basename().at(0))
+ continue;
+ else if (IsFileWithExtension(".eclass")(d->basename()))
+ {
+ bool fatal(false);
+
+ cout << "QA checks for eclass file " << *d << ":" << endl;
+
+ do_check_kind<qa::FileCheckMaker>(ok, fatal, *d);
+
+ cout << endl;
+
+ if (fatal)
+ break;
+ }
+ }
+
+ return ok;
+ }
+
+ bool
do_check_top_level(const FSEntry & dir)
{
Context context("When checking top level '" + stringify(dir) + "':");
@@ -313,7 +347,9 @@ namespace
continue;
if (! d->is_directory())
continue;
- if (env.package_database()->fetch_repository(
+ if (d->basename() == "eclass")
+ ok &= do_check_eclass_dir(*d, env);
+ else if (env.package_database()->fetch_repository(
env.package_database()->favourite_repository())->
has_category_named(CategoryNamePart(d->basename())))
ok &= do_check_category_dir(*d, env);
@@ -328,7 +364,13 @@ namespace
{
Context context("When checking directory '" + stringify(dir) + "':");
- if (std::count_if(DirIterator(dir), DirIterator(), IsFileWithExtension(
+ if (dir.basename() == "eclass" && dir.is_directory())
+ {
+ qa::QAEnvironment env(dir.dirname());
+ return do_check_eclass_dir(dir, env);
+ }
+
+ else if (std::count_if(DirIterator(dir), DirIterator(), IsFileWithExtension(
dir.basename() + "-", ".ebuild")))
{
qa::QAEnvironment env(dir.dirname().dirname());