aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2006-12-24 17:38:20 +0000
committerAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2006-12-24 17:38:20 +0000
commit36a7db85f6a180974641c92d920801c64e45e1b6 (patch)
treec65d1db548484fa5dc81766fc4b7ae4506d7b42e
parentc438d03ce1fd9e40ad13787c3dbb346e7b8eed42 (diff)
downloadpaludis-36a7db85f6a180974641c92d920801c64e45e1b6.tar.gz
paludis-36a7db85f6a180974641c92d920801c64e45e1b6.tar.xz
Move hard qa lists out into text files
-rw-r--r--paludis/qa/Makefile.am.m414
-rw-r--r--paludis/qa/dep_packages_check.cc50
-rw-r--r--paludis/qa/files.m44
-rw-r--r--paludis/qa/inherits_blacklist.txt8
-rw-r--r--paludis/qa/inherits_check.cc23
-rw-r--r--paludis/qa/iuse_check.cc27
-rw-r--r--paludis/qa/suspicious_depend.txt6
-rw-r--r--paludis/qa/suspicious_rdepend.txt19
-rw-r--r--src/qualudis/qualudis_command_line.cc1
9 files changed, 123 insertions, 29 deletions
diff --git a/paludis/qa/Makefile.am.m4 b/paludis/qa/Makefile.am.m4
index 72d4ea8..86b3012 100644
--- a/paludis/qa/Makefile.am.m4
+++ b/paludis/qa/Makefile.am.m4
@@ -10,6 +10,7 @@ define(`srlist', `')dnl
define(`srcleanlist', `')dnl
define(`srheaderlist', `')dnl
define(`testscriptlist', `')dnl
+define(`txtlist', `')dnl
define(`addtest', `define(`testlist', testlist `$1_TEST')dnl
$1_TEST_SOURCES = $1_TEST.cc
$1_TEST_LDADD = \
@@ -29,6 +30,7 @@ $1_TEST_CXXFLAGS = -I$(top_srcdir)
define(`addtestscript', `define(`testscriptlist', testscriptlist `$1_TEST_setup.sh $1_TEST_cleanup.sh')')dnl
define(`addhh', `define(`filelist', filelist `$1.hh')define(`headerlist', headerlist `$1.hh')')dnl
define(`addcc', `define(`filelist', filelist `$1.cc')')dnl
+define(`addtxt', `define(`txtlist', txtlist `$1.txt')')dnl
define(`addimpl', `define(`filelist', filelist `$1-impl.hh')')dnl
define(`addsr', `define(`srlist', srlist `$1.sr')dnl
define(`srcleanlist', srcleanlist `$1-sr.hh $1-sr.cc')dnl
@@ -44,11 +46,12 @@ define(`addthis', `dnl
ifelse(`$2', `hh', `addhh(`$1')', `')dnl
ifelse(`$2', `cc', `addcc(`$1')', `')dnl
ifelse(`$2', `sr', `addsr(`$1')', `')dnl
+ifelse(`$2', `txt', `addtxt(`$1')', `')dnl
ifelse(`$2', `impl', `addimpl(`$1')', `')dnl
ifelse(`$2', `test', `addtest(`$1')', `')dnl
ifelse(`$2', `testscript', `addtestscript(`$1')', `')')dnl
define(`add', `addthis(`$1',`$2')addthis(`$1',`$3')addthis(`$1',`$4')dnl
-addthis(`$1',`$5')addthis(`$1',`$6')')dnl
+addthis(`$1',`$5')addthis(`$1',`$6')addthis(`$1',`$7')')dnl
include(`paludis/qa/files.m4')
@@ -109,9 +112,14 @@ AM_CXXFLAGS = -I$(top_srcdir) @PALUDIS_CXXFLAGS@ @PALUDIS_CXXFLAGS_VISIBILITY@
DEFS= \
-DSYSCONFDIR=\"$(sysconfdir)\" \
-DLIBEXECDIR=\"$(libexecdir)\" \
- -DBIGTEMPDIR=\"/var/tmp\"
-EXTRA_DIST = Makefile.am.m4 files.m4 qa.hh.m4 testscriptlist srlist srcleanlist
+ -DBIGTEMPDIR=\"/var/tmp\" \
+ -DDATADIR=\"$(datadir)\"
+
+EXTRA_DIST = Makefile.am.m4 files.m4 qa.hh.m4 testscriptlist srlist srcleanlist txtlist
built-sources : $(BUILT_SOURCES)
for s in $(SUBDIRS) ; do $(MAKE) -C $$s built-sources || exit 1 ; done
+qa_datadir = $(datadir)/paludis/qa/
+qa_data_DATA = txtlist
+
diff --git a/paludis/qa/dep_packages_check.cc b/paludis/qa/dep_packages_check.cc
index c629470..12d4a50 100644
--- a/paludis/qa/dep_packages_check.cc
+++ b/paludis/qa/dep_packages_check.cc
@@ -22,6 +22,9 @@
#include <paludis/environment.hh>
#include <paludis/portage_dep_parser.hh>
#include <paludis/qa/dep_packages_check.hh>
+#include <paludis/config_file.hh>
+#include <paludis/util/log.hh>
+#include <paludis/util/system.hh>
#include <set>
using namespace paludis;
@@ -95,7 +98,21 @@ DepPackagesCheck::operator() (const EbuildCheckData & e) const
static std::set<QualifiedPackageName> suspicious_depend;
if (suspicious_depend.empty())
{
- suspicious_depend.insert(QualifiedPackageName("virtual/libc"));
+ suspicious_depend.insert(QualifiedPackageName("often/not-been-on-boats"));
+
+ try
+ {
+ LineConfigFile file(FSEntry(getenv_with_default(
+ "PALUDIS_QA_DATA_DIR", DATADIR "/paludis/qa/")) / "suspicious_depend.txt");
+ std::copy(file.begin(), file.end(), create_inserter<QualifiedPackageName>(std::inserter(
+ suspicious_depend, suspicious_depend.end())));
+ }
+ catch (const Exception & eee)
+ {
+ Log::get_instance()->message(ll_warning, lc_context,
+ "Cannot load suspicious DEPEND list from suspicious_depend.txt due to exception '"
+ + eee.message() + "' (" + eee.what() + ")");
+ }
}
Checker depend_checker(result, "DEPEND", suspicious_depend);
@@ -105,22 +122,21 @@ DepPackagesCheck::operator() (const EbuildCheckData & e) const
static std::set<QualifiedPackageName> suspicious_rdepend;
if (suspicious_rdepend.empty())
{
- suspicious_rdepend.insert(QualifiedPackageName("app-arch/rpm2targz"));
- suspicious_rdepend.insert(QualifiedPackageName("app-arch/unzip"));
- suspicious_rdepend.insert(QualifiedPackageName("dev-util/pkgconfig"));
- suspicious_rdepend.insert(QualifiedPackageName("sys-devel/autoconf"));
- suspicious_rdepend.insert(QualifiedPackageName("sys-devel/automake"));
- suspicious_rdepend.insert(QualifiedPackageName("sys-devel/flex"));
- suspicious_rdepend.insert(QualifiedPackageName("sys-devel/bison"));
- suspicious_rdepend.insert(QualifiedPackageName("dev-util/yacc"));
- suspicious_rdepend.insert(QualifiedPackageName("sys-devel/gettext"));
- suspicious_rdepend.insert(QualifiedPackageName("sys-devel/libtool"));
- suspicious_rdepend.insert(QualifiedPackageName("sys-devel/patch"));
- suspicious_rdepend.insert(QualifiedPackageName("app-doc/doxygen"));
- suspicious_rdepend.insert(QualifiedPackageName("x11-misc/imake"));
- suspicious_rdepend.insert(QualifiedPackageName("media-gfx/ebdftopcf"));
- suspicious_rdepend.insert(QualifiedPackageName("x11-apps/bdftopcf"));
- suspicious_rdepend.insert(QualifiedPackageName("app-arch/cabextract"));
+ suspicious_rdepend.insert(QualifiedPackageName("often/not-been-on-boats"));
+
+ try
+ {
+ LineConfigFile file(FSEntry(getenv_with_default(
+ "PALUDIS_QA_DATA_DIR", DATADIR "/paludis/qa/")) / "suspicious_rdepend.txt");
+ std::copy(file.begin(), file.end(), create_inserter<QualifiedPackageName>(std::inserter(
+ suspicious_rdepend, suspicious_rdepend.end())));
+ }
+ catch (const Exception & eee)
+ {
+ Log::get_instance()->message(ll_warning, lc_context,
+ "Cannot load suspicious RDEPEND list from suspicious_rdepend.txt due to exception '"
+ + eee.message() + "' (" + eee.what() + ")");
+ }
}
Checker rdepend_checker(result, "RDEPEND", suspicious_rdepend);
diff --git a/paludis/qa/files.m4 b/paludis/qa/files.m4
index 27f17b9..02eb57f 100644
--- a/paludis/qa/files.m4
+++ b/paludis/qa/files.m4
@@ -33,7 +33,9 @@ add(`gpg_check', `hh', `cc', `test', `testscript')
add(`has_ebuilds_check', `hh', `cc', `test', `testscript')
add(`has_misc_files_check', `hh', `cc', `test', `testscript')
add(`homepage_check', `hh', `cc')
+add(`inherits_blacklist', `txt')
add(`inherits_check', `hh', `cc')
+add(`iuse_blacklist', `txt')
add(`iuse_check', `hh', `cc')
add(`keywords_check', `hh', `cc')
add(`license_check', `hh', `cc')
@@ -51,5 +53,7 @@ add(`pdepend_overlap_check', `hh', `cc')
add(`qa', `hh', `cc')
add(`slot_check', `hh', `cc')
add(`subshell_die_check', `hh', `cc', `test', `testscript')
+add(`suspicious_depend', `txt')
+add(`suspicious_rdepend', `txt')
add(`variable_assigns_check', `hh', `cc')
add(`whitespace_check', `hh', `cc')
diff --git a/paludis/qa/inherits_blacklist.txt b/paludis/qa/inherits_blacklist.txt
new file mode 100644
index 0000000..29d17ef
--- /dev/null
+++ b/paludis/qa/inherits_blacklist.txt
@@ -0,0 +1,8 @@
+# This file is used by libpaludisqa to determine which eclasses
+# should be treated as deprecated.
+
+gcc
+gtk-engines
+gtk-engines2
+kernel-mod
+kmod
diff --git a/paludis/qa/inherits_check.cc b/paludis/qa/inherits_check.cc
index cd5f855..727dae0 100644
--- a/paludis/qa/inherits_check.cc
+++ b/paludis/qa/inherits_check.cc
@@ -24,6 +24,9 @@
#include <paludis/qa/inherits_check.hh>
#include <paludis/util/join.hh>
#include <paludis/util/tokeniser.hh>
+#include <paludis/config_file.hh>
+#include <paludis/util/log.hh>
+#include <paludis/util/system.hh>
#include <set>
using namespace paludis;
@@ -53,11 +56,21 @@ InheritsCheck::operator() (const EbuildCheckData & e) const
static std::set<std::string> inherits_blacklist;
if (inherits_blacklist.empty())
{
- inherits_blacklist.insert("gcc");
- inherits_blacklist.insert("kmod");
- inherits_blacklist.insert("kernel-mod");
- inherits_blacklist.insert("gtk-engines");
- inherits_blacklist.insert("gtk-engines2");
+ inherits_blacklist.insert("often-not-been-on-boats");
+
+ try
+ {
+ LineConfigFile file(FSEntry(getenv_with_default(
+ "PALUDIS_QA_DATA_DIR", DATADIR "/paludis/qa/")) / "inherits_blacklist.txt");
+ std::copy(file.begin(), file.end(), std::inserter(
+ inherits_blacklist, inherits_blacklist.end()));
+ }
+ catch (const Exception & eee)
+ {
+ Log::get_instance()->message(ll_warning, lc_context,
+ "Cannot load inherits blacklist from inherits_blacklist.txt due to exception '"
+ + eee.message() + "' (" + eee.what() + ")");
+ }
}
std::set<std::string> bad_inherits;
diff --git a/paludis/qa/iuse_check.cc b/paludis/qa/iuse_check.cc
index 905e6ea..7df0724 100644
--- a/paludis/qa/iuse_check.cc
+++ b/paludis/qa/iuse_check.cc
@@ -22,8 +22,11 @@
#include <algorithm>
#include <paludis/package_database_entry.hh>
#include <paludis/environment.hh>
+#include <paludis/config_file.hh>
#include <paludis/util/join.hh>
#include <paludis/util/tokeniser.hh>
+#include <paludis/util/log.hh>
+#include <paludis/util/system.hh>
using namespace paludis;
using namespace paludis::qa;
@@ -35,6 +38,9 @@ IuseCheck::IuseCheck()
CheckResult
IuseCheck::operator() (const EbuildCheckData & e) const
{
+ Context context("When performing iuse check on '" + stringify(e.name) +
+ "-" + stringify(e.version) + "'");
+
CheckResult result(stringify(e.name) + "-" + stringify(e.version),
identifier());
@@ -43,7 +49,8 @@ IuseCheck::operator() (const EbuildCheckData & e) const
PackageDatabaseEntry ee(e.name, e.version,
e.environment->package_database()->favourite_repository());
VersionMetadata::ConstPointer metadata(
- e.environment->package_database()->fetch_repository(ee.repository)->version_metadata(ee.name, ee.version));
+ e.environment->package_database()->fetch_repository(ee.repository)->
+ version_metadata(ee.name, ee.version));
try
{
@@ -55,9 +62,21 @@ IuseCheck::operator() (const EbuildCheckData & e) const
static std::set<UseFlagName> iuse_blacklist;
if (iuse_blacklist.empty())
{
- iuse_blacklist.insert(UseFlagName("gtk2"));
- iuse_blacklist.insert(UseFlagName("xml2"));
- iuse_blacklist.insert(UseFlagName("oggvorbis"));
+ iuse_blacklist.insert(UseFlagName("OFTEN_NOT_BEEN_ON_BOATS"));
+
+ try
+ {
+ LineConfigFile iuse_blacklist_file(FSEntry(getenv_with_default(
+ "PALUDIS_QA_DATA_DIR", DATADIR "/paludis/qa/")) / "iuse_blacklist.txt");
+ std::copy(iuse_blacklist_file.begin(), iuse_blacklist_file.end(),
+ create_inserter<UseFlagName>(std::inserter(iuse_blacklist, iuse_blacklist.end())));
+ }
+ catch (const Exception & eee)
+ {
+ Log::get_instance()->message(ll_warning, lc_context,
+ "Cannot load IUSE blacklist from iuse_check.txt due to exception '"
+ + eee.message() + "' (" + eee.what() + ")");
+ }
}
std::set<UseFlagName> bad_iuse;
diff --git a/paludis/qa/suspicious_depend.txt b/paludis/qa/suspicious_depend.txt
new file mode 100644
index 0000000..bd7c0f6
--- /dev/null
+++ b/paludis/qa/suspicious_depend.txt
@@ -0,0 +1,6 @@
+# This file is used by libpaludisqa to determine which packages
+# should be treated as suspicious in DEPEND.
+
+sys-apps/portage
+virtual/libc
+
diff --git a/paludis/qa/suspicious_rdepend.txt b/paludis/qa/suspicious_rdepend.txt
new file mode 100644
index 0000000..6038cbd
--- /dev/null
+++ b/paludis/qa/suspicious_rdepend.txt
@@ -0,0 +1,19 @@
+# This file is used by libpaludisqa to determine which packages
+# should be treated as suspicious in RDEPEND.
+
+app-arch/cabextract
+app-arch/rpm2targz
+app-arch/unzip
+app-doc/doxygen
+dev-util/pkgconfig
+dev-util/yacc
+media-gfx/ebdftopcf
+sys-devel/autoconf
+sys-devel/automake
+sys-devel/bison
+sys-devel/flex
+sys-devel/gettext
+sys-devel/libtool
+sys-devel/patch
+x11-apps/bdftopcf
+x11-misc/imake
diff --git a/src/qualudis/qualudis_command_line.cc b/src/qualudis/qualudis_command_line.cc
index 3e7694a..99f50e1 100644
--- a/src/qualudis/qualudis_command_line.cc
+++ b/src/qualudis/qualudis_command_line.cc
@@ -59,6 +59,7 @@ QualudisCommandLine::QualudisCommandLine() :
{
add_usage_line("[ options ] [ directories ... ]");
add_environment_variable("QUALUDIS_OPTIONS", "Default command-line options.");
+ add_environment_variable("PALUDIS_QA_DATA_DIR", "Where to look for QA data files.");
}
QualudisCommandLine::~QualudisCommandLine()