aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2006-02-13 23:07:26 +0000
committerAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2006-02-13 23:07:26 +0000
commitc877d4b064f8c01d5485fd101332d77ca50b488e (patch)
treebd59920941fe36ff72c9c05552e1d3a14d93eef9
parent131b967adc985fb3c961fbd21f9f555172630f3f (diff)
downloadpaludis-c877d4b064f8c01d5485fd101332d77ca50b488e.tar.gz
paludis-c877d4b064f8c01d5485fd101332d77ca50b488e.tar.xz
Cleaner way of checking for things...
-rw-r--r--paludis/qa/has_misc_files_check.cc27
1 files changed, 3 insertions, 24 deletions
diff --git a/paludis/qa/has_misc_files_check.cc b/paludis/qa/has_misc_files_check.cc
index a6e0de0..8ba5e18 100644
--- a/paludis/qa/has_misc_files_check.cc
+++ b/paludis/qa/has_misc_files_check.cc
@@ -20,7 +20,6 @@
#include "has_misc_files_check.hh"
#include <paludis/is_file_with_extension.hh>
#include <paludis/dir_iterator.hh>
-#include <algorithm>
using namespace paludis;
using namespace paludis::qa;
@@ -29,37 +28,18 @@ HasMiscFilesCheck::HasMiscFilesCheck()
{
}
-struct IsNamed :
- std::unary_function<bool, FSEntry>
-{
- const std::string name;
-
- IsNamed(const std::string & n) :
- name(n)
- {
- }
-
- bool operator() (const FSEntry & f) const
- {
- return f.basename() == name;
- }
-};
-
CheckResult
HasMiscFilesCheck::operator() (const FSEntry & d) const
{
CheckResult result(d, identifier());
- if (DirIterator() == std::find_if(DirIterator(d), DirIterator(),
- IsNamed("ChangeLog")))
+ if (! (d / "ChangeLog").exists())
result << Message(qal_major, "No ChangeLog found");
- if (DirIterator() == std::find_if(DirIterator(d), DirIterator(),
- IsNamed("files")))
+ if (! (d / "files").exists())
result << Message(qal_major, "No files/ found");
- if (DirIterator() == std::find_if(DirIterator(d), DirIterator(),
- IsNamed("metadata.xml")))
+ if (! (d / "metadata.xml").exists())
result << Message(qal_major, "No metadata.xml found");
return result;
@@ -72,4 +52,3 @@ HasMiscFilesCheck::identifier()
return id;
}
-