aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2007-07-03 17:16:13 +0000
committerAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2007-07-03 17:16:13 +0000
commitcbeb2aecd9bf68cbd29840969a7fcf5b190b96bd (patch)
tree3b9f95d9d6a70a63eaa1d3fcfb3ab6f3814f6582
parent72232db0e585ad726ed5a9b7d93a8fae805275d6 (diff)
downloadpaludis-cbeb2aecd9bf68cbd29840969a7fcf5b190b96bd.tar.gz
paludis-cbeb2aecd9bf68cbd29840969a7fcf5b190b96bd.tar.xz
r3760@snowflake: ciaranm | 2007-07-03 18:11:25 +0100
Fix old qa/ path references
-rw-r--r--Makefile.am1
-rw-r--r--doc/doxygen.conf.in2
-rw-r--r--paludis/repositories/e/qa/qa_checks.cc14
-rw-r--r--paludis/repositories/e/qa/qa_checks.hh8
-rw-r--r--paludis/repositories/e/qa/qa_controller.cc11
-rw-r--r--paludis/repositories/e/qa/stray_files.cc17
-rw-r--r--paludis/repositories/e/qa/stray_files.hh4
7 files changed, 54 insertions, 3 deletions
diff --git a/Makefile.am b/Makefile.am
index a4cf3e1..311eeb5 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -21,7 +21,6 @@ automake-deps-dist-hack.tmp : built-sources-subdirs
$(MAKE) -C paludis/util
$(MAKE) -C paludis/args
$(MAKE) -C paludis/ libpaludismanpagethings.la
- $(MAKE) -C paludis/qa message-sr.hh
$(MAKE) -C src/output liboutput.a
$(MAKE) -C src/common_args libcommonargs.a
$(MAKE) -C src/clients/paludis paludis.1 paludis.html
diff --git a/doc/doxygen.conf.in b/doc/doxygen.conf.in
index 952939d..b4a13c0 100644
--- a/doc/doxygen.conf.in
+++ b/doc/doxygen.conf.in
@@ -461,7 +461,7 @@ WARN_LOGFILE =
# directories like "/usr/src/myproject". Separate the files or directories
# with spaces.
-INPUT = ../paludis ../paludis/args ../paludis/dep_list ../paludis/digests ../paludis/environments ../paludis/environments/no_config ../paludis/environments/adapted ../paludis/environments/portage ../paludis/environments/paludis ../paludis/environments/test ../paludis/fetchers ../paludis/merger ../paludis/qa ../paludis/repositories ../paludis/repositories/cran ../paludis/repositories/fake ../paludis/repositories/gems ../paludis/repositories/e ../paludis/repositories/virtuals ../paludis/selinux ../paludis/syncers ../paludis/tasks ../paludis/util ../doc
+INPUT = ../paludis ../paludis/args ../paludis/dep_list ../paludis/digests ../paludis/environments ../paludis/environments/no_config ../paludis/environments/adapted ../paludis/environments/portage ../paludis/environments/paludis ../paludis/environments/test ../paludis/fetchers ../paludis/merger ../paludis/repositories ../paludis/repositories/cran ../paludis/repositories/fake ../paludis/repositories/gems ../paludis/repositories/e ../paludis/repositories/virtuals ../paludis/selinux ../paludis/syncers ../paludis/tasks ../paludis/util ../doc
# If the value of the INPUT tag contains directories, you can use the
# FILE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp
diff --git a/paludis/repositories/e/qa/qa_checks.cc b/paludis/repositories/e/qa/qa_checks.cc
index eec00e5..1961350 100644
--- a/paludis/repositories/e/qa/qa_checks.cc
+++ b/paludis/repositories/e/qa/qa_checks.cc
@@ -34,9 +34,11 @@ namespace paludis
struct Implementation<QAChecks>
{
const tr1::shared_ptr<QAChecksGroup<TreeCheckFunction> > tree_checks_group;
+ const tr1::shared_ptr<QAChecksGroup<CategoryDirCheckFunction> > category_dir_checks_group;
Implementation() :
- tree_checks_group(new QAChecksGroup<TreeCheckFunction>)
+ tree_checks_group(new QAChecksGroup<TreeCheckFunction>),
+ category_dir_checks_group(new QAChecksGroup<CategoryDirCheckFunction>)
{
}
};
@@ -49,6 +51,9 @@ QAChecks::QAChecks() :
_imp->tree_checks_group->add_check("stray_tree_files",
tr1::bind(stray_files_check, _1, _3, _4, is_stray_at_tree_dir, "stray_tree_files"));
+
+ _imp->category_dir_checks_group->add_check("stray_category_dir_files",
+ tr1::bind(stray_files_check, _1, _3, _4, is_stray_at_category_dir, "stray_category_dir_files"));
}
QAChecks::~QAChecks()
@@ -61,3 +66,10 @@ QAChecks::tree_checks_group()
return _imp->tree_checks_group;
}
+const tr1::shared_ptr<QAChecksGroup<TreeCheckFunction> >
+QAChecks::category_dir_checks_group()
+{
+ return _imp->category_dir_checks_group;
+}
+
+
diff --git a/paludis/repositories/e/qa/qa_checks.hh b/paludis/repositories/e/qa/qa_checks.hh
index 9417574..6db6a50 100644
--- a/paludis/repositories/e/qa/qa_checks.hh
+++ b/paludis/repositories/e/qa/qa_checks.hh
@@ -45,6 +45,13 @@ namespace paludis
const FSEntry &
)> TreeCheckFunction;
+ typedef tr1::function<bool (
+ QAReporter &,
+ const Environment * const,
+ const tr1::shared_ptr<const ERepository> &,
+ const FSEntry &
+ )> CategoryDirCheckFunction;
+
class QAChecks :
private PrivateImplementationPattern<QAChecks>,
public InstantiationPolicy<QAChecks, instantiation_method::SingletonTag>
@@ -57,6 +64,7 @@ namespace paludis
public:
const tr1::shared_ptr<QAChecksGroup<TreeCheckFunction> > tree_checks_group() PALUDIS_ATTRIBUTE((warn_unused_result));
+ const tr1::shared_ptr<QAChecksGroup<CategoryDirCheckFunction> > category_dir_checks_group() PALUDIS_ATTRIBUTE((warn_unused_result));
};
}
}
diff --git a/paludis/repositories/e/qa/qa_controller.cc b/paludis/repositories/e/qa/qa_controller.cc
index b0144c8..ff2838d 100644
--- a/paludis/repositories/e/qa/qa_controller.cc
+++ b/paludis/repositories/e/qa/qa_controller.cc
@@ -89,5 +89,16 @@ QAController::run()
tr1::bind(std::equal_to<bool>(), false,
tr1::bind<bool>(tr1::mem_fn(&TreeCheckFunction::operator() ),
_1, tr1::ref(_imp->reporter), _imp->env, _imp->repo, _imp->repo->params().location)));
+
+ tr1::shared_ptr<const CategoryNamePartCollection> categories(_imp->repo->category_names());
+ for (CategoryNamePartCollection::Iterator c(categories->begin()), c_end(categories->end()) ;
+ c != c_end ; ++c)
+ std::find_if(
+ QAChecks::get_instance()->category_dir_checks_group()->begin(),
+ QAChecks::get_instance()->category_dir_checks_group()->end(),
+ tr1::bind(std::equal_to<bool>(), false,
+ tr1::bind<bool>(tr1::mem_fn(&CategoryDirCheckFunction::operator() ),
+ _1, tr1::ref(_imp->reporter), _imp->env, _imp->repo, _imp->repo->layout()->category_directory(*c))));
+
}
diff --git a/paludis/repositories/e/qa/stray_files.cc b/paludis/repositories/e/qa/stray_files.cc
index 0756afd..1e4d2ae 100644
--- a/paludis/repositories/e/qa/stray_files.cc
+++ b/paludis/repositories/e/qa/stray_files.cc
@@ -59,3 +59,20 @@ paludis::erepository::is_stray_at_tree_dir(
return true;
}
+bool
+paludis::erepository::is_stray_at_category_dir(
+ const tr1::shared_ptr<const ERepository> &,
+ const FSEntry & d)
+{
+ if (d.is_directory_or_symlink_to_directory())
+ {
+ return false;
+ }
+ else if (d.is_regular_file_or_symlink_to_regular_file())
+ {
+ return true;
+ }
+ else
+ return true;
+}
+
diff --git a/paludis/repositories/e/qa/stray_files.hh b/paludis/repositories/e/qa/stray_files.hh
index 2443148..180db80 100644
--- a/paludis/repositories/e/qa/stray_files.hh
+++ b/paludis/repositories/e/qa/stray_files.hh
@@ -37,6 +37,10 @@ namespace paludis
bool is_stray_at_tree_dir(
const tr1::shared_ptr<const ERepository> &,
const FSEntry &);
+
+ bool is_stray_at_category_dir(
+ const tr1::shared_ptr<const ERepository> &,
+ const FSEntry &);
}
}