aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAvatar David Morgan <david.morgan@wadham.oxford.ac.uk> 2006-07-11 20:42:38 +0000
committerAvatar David Morgan <david.morgan@wadham.oxford.ac.uk> 2006-07-11 20:42:38 +0000
commit25a0d002cbecef17f97d7edaabce08a60dc7fe71 (patch)
treef95bc789996b06718b66d227bfc8b13d2bea7247
parent397a5ab77a414660173c1aa096f024f91d54dedf (diff)
downloadpaludis-25a0d002cbecef17f97d7edaabce08a60dc7fe71.tar.gz
paludis-25a0d002cbecef17f97d7edaabce08a60dc7fe71.tar.xz
libqualudis fixes, take two
-rw-r--r--paludis/qa/create_metadata_check.cc5
-rw-r--r--paludis/qa/dep_any_check.cc16
-rw-r--r--paludis/qa/dep_flags_check.cc33
-rw-r--r--paludis/qa/dep_packages_check.cc13
-rw-r--r--paludis/qa/deps_exist_check.cc17
-rw-r--r--paludis/qa/deps_visible_check.cc17
-rw-r--r--paludis/qa/description_check.cc11
-rw-r--r--paludis/qa/environment.cc3
-rw-r--r--paludis/qa/environment.hh39
-rw-r--r--paludis/qa/extract_check.cc11
-rw-r--r--paludis/qa/files.m428
-rw-r--r--paludis/qa/homepage_check.cc5
-rw-r--r--paludis/qa/inherits_check.cc5
-rw-r--r--paludis/qa/iuse_check.cc3
-rw-r--r--paludis/qa/keywords_check.cc5
-rw-r--r--paludis/qa/license_check.cc12
-rw-r--r--paludis/qa/parse_deps_check.cc17
-rw-r--r--paludis/qa/pdepend_overlap_check.cc17
-rw-r--r--paludis/qa/restrict_check.cc5
-rw-r--r--paludis/qa/slot_check.cc5
-rw-r--r--paludis/qa/src_uri_check.cc13
21 files changed, 151 insertions, 129 deletions
diff --git a/paludis/qa/create_metadata_check.cc b/paludis/qa/create_metadata_check.cc
index 645d73a..890b3f8 100644
--- a/paludis/qa/create_metadata_check.cc
+++ b/paludis/qa/create_metadata_check.cc
@@ -18,6 +18,7 @@
*/
#include <paludis/qa/create_metadata_check.hh>
+#include <paludis/portage_dep_parser.hh>
using namespace paludis;
using namespace paludis::qa;
@@ -37,9 +38,9 @@ CreateMetadataCheck::operator() (const EbuildCheckData & e) const
PackageDatabaseEntry ee(e.get<ecd_name>(), e.get<ecd_version>(),
e.get<ecd_environment>()->package_database()->favourite_repository());
VersionMetadata::ConstPointer metadata(
- e.get<ecd_environment>()->package_database()->fetch_metadata(ee));
+ e.get<ecd_environment>()->package_database()->fetch_repository(ee.get<pde_repository>())->version_metadata(ee.get<pde_name>(), ee.get<pde_version>()));
- if ("UNKNOWN" == metadata->get(vmk_eapi))
+ if ("UNKNOWN" == metadata->get<vm_eapi>())
result << Message(qal_fatal, "Couldn't generate metadata");
}
catch (const InternalError &)
diff --git a/paludis/qa/dep_any_check.cc b/paludis/qa/dep_any_check.cc
index d11a988..3e8c551 100644
--- a/paludis/qa/dep_any_check.cc
+++ b/paludis/qa/dep_any_check.cc
@@ -19,7 +19,7 @@
#include <paludis/qa/dep_any_check.hh>
-#include <paludis/dep_parser.hh>
+#include <paludis/portage_dep_parser.hh>
#include <paludis/dep_atom.hh>
#include <paludis/util/iterator.hh>
#include <paludis/util/save.hh>
@@ -105,19 +105,19 @@ DepAnyCheck::operator() (const EbuildCheckData & e) const
PackageDatabaseEntry ee(e.get<ecd_name>(), e.get<ecd_version>(),
e.get<ecd_environment>()->package_database()->favourite_repository());
VersionMetadata::ConstPointer metadata(
- e.get<ecd_environment>()->package_database()->fetch_metadata(ee));
+ e.get<ecd_environment>()->package_database()->fetch_repository(ee.get<pde_repository>())->version_metadata(ee.get<pde_name>(), ee.get<pde_version>()));
Checker depend_checker(result, "DEPEND");
- std::string depend(metadata->get(vmk_depend));
- DepParser::parse(depend)->accept(&depend_checker);
+ std::string depend(metadata->get<vm_deps>().get<vmd_build_depend_string>());
+ PortageDepParser::parse(depend)->accept(&depend_checker);
Checker rdepend_checker(result, "RDEPEND");
- std::string rdepend(metadata->get(vmk_rdepend));
- DepParser::parse(rdepend)->accept(&rdepend_checker);
+ std::string rdepend(metadata->get<vm_deps>().get<vmd_run_depend_string>());
+ PortageDepParser::parse(rdepend)->accept(&rdepend_checker);
Checker pdepend_checker(result, "PDEPEND");
- std::string pdepend(metadata->get(vmk_pdepend));
- DepParser::parse(pdepend)->accept(&pdepend_checker);
+ std::string pdepend(metadata->get<vm_deps>().get<vmd_post_depend_string>());
+ PortageDepParser::parse(pdepend)->accept(&pdepend_checker);
}
catch (const InternalError &)
{
diff --git a/paludis/qa/dep_flags_check.cc b/paludis/qa/dep_flags_check.cc
index 0280d9e..c2c421d 100644
--- a/paludis/qa/dep_flags_check.cc
+++ b/paludis/qa/dep_flags_check.cc
@@ -18,8 +18,7 @@
*/
#include <paludis/dep_atom.hh>
-#include <paludis/dep_parser.hh>
-#include <paludis/dep_parser.hh>
+#include <paludis/portage_dep_parser.hh>
#include <paludis/qa/dep_flags_check.hh>
using namespace paludis;
@@ -109,35 +108,39 @@ DepFlagsCheck::operator() (const EbuildCheckData & e) const
PackageDatabaseEntry ee(e.get<ecd_name>(), e.get<ecd_version>(),
e.get<ecd_environment>()->package_database()->favourite_repository());
VersionMetadata::ConstPointer metadata(
- e.get<ecd_environment>()->package_database()->fetch_metadata(ee));
+ e.get<ecd_environment>()->package_database()->fetch_repository(ee.get<pde_repository>())->version_metadata(ee.get<pde_name>(), ee.get<pde_version>()));
std::set<UseFlagName> iuse(metadata->begin_iuse(), metadata->end_iuse());
iuse.insert(UseFlagName("bootstrap"));
iuse.insert(UseFlagName("build"));
Checker depend_checker(result, "DEPEND", e.get<ecd_environment>(), iuse);
- std::string depend(metadata->get(vmk_depend));
- DepParser::parse(depend)->accept(&depend_checker);
+ std::string depend(metadata->get<vm_deps>().get<vmd_build_depend_string>());
+ PortageDepParser::parse(depend)->accept(&depend_checker);
Checker rdepend_checker(result, "RDEPEND", e.get<ecd_environment>(), iuse);
- std::string rdepend(metadata->get(vmk_rdepend));
- DepParser::parse(rdepend)->accept(&rdepend_checker);
+ std::string rdepend(metadata->get<vm_deps>().get<vmd_run_depend_string>());
+ PortageDepParser::parse(rdepend)->accept(&rdepend_checker);
Checker pdepend_checker(result, "PDEPEND", e.get<ecd_environment>(), iuse);
- std::string pdepend(metadata->get(vmk_pdepend));
- DepParser::parse(pdepend)->accept(&pdepend_checker);
+ std::string pdepend(metadata->get<vm_deps>().get<vmd_post_depend_string>());
+ PortageDepParser::parse(pdepend)->accept(&pdepend_checker);
Checker provide_checker(result, "PROVIDE", e.get<ecd_environment>(), iuse);
- std::string provide(metadata->get(vmk_provide));
- DepParser::parse(provide, DepParserPolicy<PackageDepAtom, false>::get_instance())->accept(&provide_checker);
+ std::string provide(metadata->get_ebuild_interface()->provide());
+ PortageDepParser::parse(provide, PortageDepParserPolicy<PackageDepAtom, false>::get_instance())->accept(&provide_checker);
Checker license_checker(result, "LICENSE", e.get<ecd_environment>(), iuse);
- std::string license(metadata->get(vmk_license));
- DepParser::parse(license, DepParserPolicy<PlainTextDepAtom, true>::get_instance())->accept(&license_checker);
+ std::string license(metadata->get<vm_license>());
+ PortageDepParser::parse(license, PortageDepParserPolicy<PlainTextDepAtom, true>::get_instance())->accept(&license_checker);
Checker src_uri_checker(result, "SRC_URI", e.get<ecd_environment>(), iuse);
- std::string src_uri(metadata->get(vmk_src_uri));
- DepParser::parse(src_uri, DepParserPolicy<PlainTextDepAtom, true>::get_instance())->accept(&src_uri_checker);
+ if (metadata->get_ebuild_interface() == 0)
+ result << Message(qal_fatal, "Couldn't generate metadata");
+
+ std::string src_uri(metadata->get_ebuild_interface()->get<evm_src_uri>());
+
+ PortageDepParser::parse(src_uri, PortageDepParserPolicy<PlainTextDepAtom, true>::get_instance())->accept(&src_uri_checker);
}
catch (const InternalError &)
{
diff --git a/paludis/qa/dep_packages_check.cc b/paludis/qa/dep_packages_check.cc
index d41094f..2b08469 100644
--- a/paludis/qa/dep_packages_check.cc
+++ b/paludis/qa/dep_packages_check.cc
@@ -18,7 +18,7 @@
*/
#include <paludis/dep_atom.hh>
-#include <paludis/dep_parser.hh>
+#include <paludis/portage_dep_parser.hh>
#include <paludis/qa/dep_packages_check.hh>
using namespace paludis;
@@ -87,7 +87,8 @@ DepPackagesCheck::operator() (const EbuildCheckData & e) const
PackageDatabaseEntry ee(e.get<ecd_name>(), e.get<ecd_version>(),
e.get<ecd_environment>()->package_database()->favourite_repository());
VersionMetadata::ConstPointer metadata(
- e.get<ecd_environment>()->package_database()->fetch_metadata(ee));
+ e.get<ecd_environment>()->package_database()->fetch_repository(
+ ee.get<pde_repository>())->version_metadata(ee.get<pde_name>(), ee.get<pde_version>()));
static std::set<QualifiedPackageName> suspicious_depend;
if (suspicious_depend.empty())
@@ -96,8 +97,8 @@ DepPackagesCheck::operator() (const EbuildCheckData & e) const
}
Checker depend_checker(result, "DEPEND", suspicious_depend);
- std::string depend(metadata->get(vmk_depend));
- DepParser::parse(depend)->accept(&depend_checker);
+ std::string depend(metadata->get<vm_deps>().get<vmd_build_depend_string>());
+ PortageDepParser::parse(depend)->accept(&depend_checker);
static std::set<QualifiedPackageName> suspicious_rdepend;
if (suspicious_rdepend.empty())
@@ -121,8 +122,8 @@ DepPackagesCheck::operator() (const EbuildCheckData & e) const
}
Checker rdepend_checker(result, "RDEPEND", suspicious_rdepend);
- std::string rdepend(metadata->get(vmk_rdepend));
- DepParser::parse(rdepend)->accept(&rdepend_checker);
+ std::string rdepend(metadata->get<vm_deps>().get<vmd_run_depend_string>());
+ PortageDepParser::parse(rdepend)->accept(&rdepend_checker);
}
catch (const InternalError &)
{
diff --git a/paludis/qa/deps_exist_check.cc b/paludis/qa/deps_exist_check.cc
index 2eb3b6b..823a5d6 100644
--- a/paludis/qa/deps_exist_check.cc
+++ b/paludis/qa/deps_exist_check.cc
@@ -18,7 +18,7 @@
*/
#include <paludis/dep_atom.hh>
-#include <paludis/dep_parser.hh>
+#include <paludis/portage_dep_parser.hh>
#include <paludis/qa/deps_exist_check.hh>
#include <paludis/util/save.hh>
@@ -101,19 +101,20 @@ DepsExistCheck::operator() (const EbuildCheckData & e) const
PackageDatabaseEntry ee(e.get<ecd_name>(), e.get<ecd_version>(),
e.get<ecd_environment>()->package_database()->favourite_repository());
VersionMetadata::ConstPointer metadata(
- e.get<ecd_environment>()->package_database()->fetch_metadata(ee));
+ e.get<ecd_environment>()->package_database()->fetch_repository(
+ ee.get<pde_repository>())->version_metadata(ee.get<pde_name>(), ee.get<pde_version>()));
Checker depend_checker(result, "DEPEND", e.get<ecd_environment>());
- std::string depend(metadata->get(vmk_depend));
- DepParser::parse(depend)->accept(&depend_checker);
+ std::string depend(metadata->get<vm_deps>().get<vmd_build_depend_string>());
+ PortageDepParser::parse(depend)->accept(&depend_checker);
Checker rdepend_checker(result, "RDEPEND", e.get<ecd_environment>());
- std::string rdepend(metadata->get(vmk_rdepend));
- DepParser::parse(rdepend)->accept(&rdepend_checker);
+ std::string rdepend(metadata->get<vm_deps>().get<vmd_run_depend_string>());
+ PortageDepParser::parse(rdepend)->accept(&rdepend_checker);
Checker pdepend_checker(result, "PDEPEND", e.get<ecd_environment>());
- std::string pdepend(metadata->get(vmk_pdepend));
- DepParser::parse(pdepend)->accept(&pdepend_checker);
+ std::string pdepend(metadata->get<vm_deps>().get<vmd_post_depend_string>());
+ PortageDepParser::parse(pdepend)->accept(&pdepend_checker);
}
catch (const InternalError &)
{
diff --git a/paludis/qa/deps_visible_check.cc b/paludis/qa/deps_visible_check.cc
index 483d10d..070e2c9 100644
--- a/paludis/qa/deps_visible_check.cc
+++ b/paludis/qa/deps_visible_check.cc
@@ -19,7 +19,7 @@
#include <paludis/qa/deps_visible_check.hh>
-#include <paludis/dep_parser.hh>
+#include <paludis/portage_dep_parser.hh>
#include <paludis/dep_atom.hh>
using namespace paludis;
@@ -99,23 +99,24 @@ DepsVisibleCheck::operator() (const EbuildCheckData & e) const
PackageDatabaseEntry ee(e.get<ecd_name>(), e.get<ecd_version>(),
e.get<ecd_environment>()->package_database()->favourite_repository());
VersionMetadata::ConstPointer metadata(
- e.get<ecd_environment>()->package_database()->fetch_metadata(ee));
+ e.get<ecd_environment>()->package_database()->fetch_repository(
+ ee.get<pde_repository>())->version_metadata(ee.get<pde_name>(), ee.get<pde_version>()));
if (e.get<ecd_environment>()->mask_reasons(ee).any())
result << Message(qal_skip, "Masked, so skipping checks");
else
{
Checker depend_checker(result, "DEPEND", e.get<ecd_environment>());
- std::string depend(metadata->get(vmk_depend));
- DepParser::parse(depend)->accept(&depend_checker);
+ std::string depend(metadata->get<vm_deps>().get<vmd_build_depend_string>());
+ PortageDepParser::parse(depend)->accept(&depend_checker);
Checker rdepend_checker(result, "RDEPEND", e.get<ecd_environment>());
- std::string rdepend(metadata->get(vmk_rdepend));
- DepParser::parse(rdepend)->accept(&rdepend_checker);
+ std::string rdepend(metadata->get<vm_deps>().get<vmd_run_depend_string>());
+ PortageDepParser::parse(rdepend)->accept(&rdepend_checker);
Checker pdepend_checker(result, "PDEPEND", e.get<ecd_environment>());
- std::string pdepend(metadata->get(vmk_pdepend));
- DepParser::parse(pdepend)->accept(&pdepend_checker);
+ std::string pdepend(metadata->get<vm_deps>().get<vmd_post_depend_string>());
+ PortageDepParser::parse(pdepend)->accept(&pdepend_checker);
}
}
catch (const InternalError &)
diff --git a/paludis/qa/description_check.cc b/paludis/qa/description_check.cc
index c0a4d96..283365c 100644
--- a/paludis/qa/description_check.cc
+++ b/paludis/qa/description_check.cc
@@ -38,16 +38,17 @@ DescriptionCheck::operator() (const EbuildCheckData & e) const
PackageDatabaseEntry ee(e.get<ecd_name>(), e.get<ecd_version>(),
e.get<ecd_environment>()->package_database()->favourite_repository());
VersionMetadata::ConstPointer metadata(
- e.get<ecd_environment>()->package_database()->fetch_metadata(ee));
+ e.get<ecd_environment>()->package_database()->fetch_repository(
+ ee.get<pde_repository>())->version_metadata(ee.get<pde_name>(), ee.get<pde_version>()));
- const std::string::size_type length(metadata->get(vmk_description).length());
+ const std::string::size_type length(metadata->get<vm_description>().length());
if (0 == length)
result << Message(qal_major, "DESCRIPTION unset or empty");
else if (0 == strcasecmp(e.get<ecd_name>().get<qpn_package>().data().c_str(),
- metadata->get(vmk_description).c_str()))
+ metadata->get<vm_description>().c_str()))
result << Message(qal_major, "DESCRIPTION equal to $PN? You can do better than that.");
- else if (std::string::npos != metadata->get(vmk_description).find("Based on the") &&
- std::string::npos != metadata->get(vmk_description).find("eclass"))
+ else if (std::string::npos != metadata->get<vm_description>().find("Based on the") &&
+ std::string::npos != metadata->get<vm_description>().find("eclass"))
result << Message(qal_major, "DESCRIPTION is about as useful as a chocolate teapot");
else if (length < 10)
result << Message(qal_minor, "DESCRIPTION suspiciously short (" + stringify(length) + ")");
diff --git a/paludis/qa/environment.cc b/paludis/qa/environment.cc
index 0adee6d..0adfa11 100644
--- a/paludis/qa/environment.cc
+++ b/paludis/qa/environment.cc
@@ -1,7 +1,8 @@
/* vim: set sw=4 sts=4 et foldmethod=syntax : */
/*
- * Copyright (c) 2006 Ciaran McCreesh <ciaran.mccreesh@blueyonder.co.uk>
+ * Copyright (c) 2006 Ciaran McCreesh <ciaran.mccreesh@blueyonder.co.uk> and
+ * David Morgan <david.morgan@wadham.oxford.ac.uk>
*
* This file is part of the Paludis package manager. Paludis is free software;
* you can redistribute it and/or modify it under the terms of the GNU General
diff --git a/paludis/qa/environment.hh b/paludis/qa/environment.hh
index 1cea21c..dc52691 100644
--- a/paludis/qa/environment.hh
+++ b/paludis/qa/environment.hh
@@ -1,7 +1,8 @@
/* vim: set sw=4 sts=4 et foldmethod=syntax : */
/*
- * Copyright (c) 2006 Ciaran McCreesh <ciaran.mccreesh@blueyonder.co.uk>
+ * Copyright (c) 2006 Ciaran McCreesh <ciaran.mccreesh@blueyonder.co.uk> and
+ * David Morgan <david.morgan@wadham.oxford.ac.uk>
*
* This file is part of the Paludis package manager. Paludis is free software;
* you can redistribute it and/or modify it under the terms of the GNU General
@@ -45,8 +46,8 @@ namespace paludis
class QAEnvironment :
public Environment
{
- private:
- std::multimap<std::string, std::string> _mirrors;
+ private:
+ std::multimap<std::string, std::string> _mirrors;
public:
QAEnvironment(const FSEntry & base);
@@ -57,7 +58,7 @@ namespace paludis
virtual bool accept_keyword(const KeywordName &, const PackageDatabaseEntry * const) const;
- virtual bool accept_license(const std::string &, const PackageDatabaseEntry * const) const;
+ virtual bool accept_license(const std::string &, const PackageDatabaseEntry * const) const;
virtual bool query_user_masks(const PackageDatabaseEntry &) const;
@@ -68,10 +69,10 @@ namespace paludis
return "";
}
- virtual std::string hook_dirs() const
- {
- return "";
- }
+ virtual std::string hook_dirs() const
+ {
+ return "";
+ }
virtual std::string paludis_command() const PALUDIS_ATTRIBUTE((noreturn))
{
@@ -84,19 +85,19 @@ namespace paludis
return UseFlagNameCollection::Pointer(new UseFlagNameCollection);
}
- virtual MirrorIterator begin_mirrors(const std::string & mirror) const
- {
- return _mirrors.end();
- }
+ virtual MirrorIterator begin_mirrors(const std::string & mirror) const
+ {
+ return _mirrors.end();
+ }
- virtual MirrorIterator end_mirrors(const std::string & mirror) const
- {
- return _mirrors.end();
- }
+ virtual MirrorIterator end_mirrors(const std::string & mirror) const
+ {
+ return _mirrors.end();
+ }
- virtual void perform_hook (const Hook & hook) const
- {
- }
+ virtual void perform_hook (const Hook & hook) const
+ {
+ }
};
}
}
diff --git a/paludis/qa/extract_check.cc b/paludis/qa/extract_check.cc
index 68e4a38..4a4f31d 100644
--- a/paludis/qa/extract_check.cc
+++ b/paludis/qa/extract_check.cc
@@ -18,7 +18,7 @@
*/
#include <paludis/dep_atom.hh>
-#include <paludis/dep_parser.hh>
+#include <paludis/portage_dep_parser.hh>
#include <paludis/qa/extract_check.hh>
#include <paludis/util/tokeniser.hh>
@@ -90,12 +90,13 @@ ExtractCheck::operator() (const EbuildCheckData & e) const
PackageDatabaseEntry ee(e.get<ecd_name>(), e.get<ecd_version>(),
e.get<ecd_environment>()->package_database()->favourite_repository());
VersionMetadata::ConstPointer metadata(
- e.get<ecd_environment>()->package_database()->fetch_metadata(ee));
+ e.get<ecd_environment>()->package_database()->fetch_repository(
+ ee.get<pde_repository>())->version_metadata(ee.get<pde_name>(), ee.get<pde_version>()));
Checker checker;
- DepParser::parse(metadata->get(vmk_src_uri),
- DepParserPolicy<PlainTextDepAtom, false>::get_instance())->accept(&checker);
- DepParser::parse(metadata->get(vmk_depend))->accept(&checker);
+ PortageDepParser::parse(metadata->get_ebuild_interface()->get<evm_src_uri>(),
+ PortageDepParserPolicy<PlainTextDepAtom, false>::get_instance())->accept(&checker);
+ PortageDepParser::parse(metadata->get<vm_deps>().get<vmd_build_depend_string>())->accept(&checker);
if (checker.need_zip && ! checker.have_zip)
result << Message(qal_major, "Found .zip in SRC_URI but app-arch/unzip is not in DEPEND");
diff --git a/paludis/qa/files.m4 b/paludis/qa/files.m4
index 6eea362..50237a9 100644
--- a/paludis/qa/files.m4
+++ b/paludis/qa/files.m4
@@ -11,19 +11,19 @@ dnl on this file at present...
add(`changelog_check', `hh', `cc')
add(`check', `hh', `cc')
add(`check_result', `hh', `cc', `test')
-dnl add(`create_metadata_check', `hh', `cc')
-add(`defaults_check', `hh', `cc')
-dnl add(`dep_any_check', `hh', `cc')
+add(`create_metadata_check', `hh', `cc')
+dnl add(`defaults_check', `hh', `cc')
+add(`dep_any_check', `hh', `cc')
dnl add(`dep_flags_check', `hh', `cc')
-dnl add(`dep_packages_check', `hh', `cc')
+add(`dep_packages_check', `hh', `cc')
dnl add(`deps_exist_check', `hh', `cc')
dnl add(`deps_visible_check', `hh', `cc')
-dnl add(`description_check', `hh', `cc')
+add(`description_check', `hh', `cc')
add(`digest_collisions_check', `hh', `cc')
add(`ebuild_check', `hh', `cc')
add(`ebuild_count', `hh', `cc')
add(`environment', `hh', `cc')
-dnl add(`extract_check', `hh', `cc')
+add(`extract_check', `hh', `cc')
add(`file_check', `hh', `cc')
add(`file_name_check', `hh', `cc')
add(`file_permissions_check', `hh', `cc', `test', `testscript')
@@ -31,20 +31,20 @@ add(`files_dir_size_check', `hh', `cc')
add(`glep_31_check', `hh', `cc', `test')
add(`has_ebuilds_check', `hh', `cc', `test', `testscript')
add(`has_misc_files_check', `hh', `cc', `test', `testscript')
-dnl add(`homepage_check', `hh', `cc')
-dnl add(`inherits_check', `hh', `cc')
+add(`homepage_check', `hh', `cc')
+add(`inherits_check', `hh', `cc')
dnl add(`iuse_check', `hh', `cc')
dnl add(`keywords_check', `hh', `cc')
-dnl add(`license_check', `hh', `cc')
+add(`license_check', `hh', `cc')
add(`message', `hh', `cc', `test')
dnl add(`metadata_check', `hh', `cc')
add(`package_dir_check', `hh', `cc')
add(`package_name_check', `hh', `cc', `test', `testscript')
-dnl add(`parse_deps_check', `hh', `cc')
-dnl add(`restrict_check', `hh', `cc')
-dnl add(`src_uri_check', `hh', `cc')
-dnl add(`pdepend_overlap_check', `hh', `cc')
+add(`parse_deps_check', `hh', `cc')
+add(`restrict_check', `hh', `cc')
+add(`src_uri_check', `hh', `cc')
+add(`pdepend_overlap_check', `hh', `cc')
add(`qa', `hh', `cc')
-dnl add(`slot_check', `hh', `cc')
+add(`slot_check', `hh', `cc')
add(`whitespace_check', `hh', `cc')
diff --git a/paludis/qa/homepage_check.cc b/paludis/qa/homepage_check.cc
index c7bc355..4b8a410 100644
--- a/paludis/qa/homepage_check.cc
+++ b/paludis/qa/homepage_check.cc
@@ -37,9 +37,10 @@ HomepageCheck::operator() (const EbuildCheckData & e) const
PackageDatabaseEntry ee(e.get<ecd_name>(), e.get<ecd_version>(),
e.get<ecd_environment>()->package_database()->favourite_repository());
VersionMetadata::ConstPointer metadata(
- e.get<ecd_environment>()->package_database()->fetch_metadata(ee));
+ e.get<ecd_environment>()->package_database()->fetch_repository(
+ ee.get<pde_repository>())->version_metadata(ee.get<pde_name>(), ee.get<pde_version>()));
- std::string homepage(metadata->get(vmk_homepage));
+ std::string homepage(metadata->get<vm_homepage>());
if (homepage.empty())
result << Message(qal_major, "HOMEPAGE empty or unset");
diff --git a/paludis/qa/inherits_check.cc b/paludis/qa/inherits_check.cc
index b4e21fd..d76e282 100644
--- a/paludis/qa/inherits_check.cc
+++ b/paludis/qa/inherits_check.cc
@@ -42,11 +42,12 @@ InheritsCheck::operator() (const EbuildCheckData & e) const
PackageDatabaseEntry ee(e.get<ecd_name>(), e.get<ecd_version>(),
e.get<ecd_environment>()->package_database()->favourite_repository());
VersionMetadata::ConstPointer metadata(
- e.get<ecd_environment>()->package_database()->fetch_metadata(ee));
+ e.get<ecd_environment>()->package_database()->fetch_repository(
+ ee.get<pde_repository>())->version_metadata(ee.get<pde_name>(), ee.get<pde_version>()));
std::set<std::string> inherits;
Tokeniser<delim_kind::AnyOfTag, delim_mode::DelimiterTag> tokeniser(" \t\n");
- tokeniser.tokenise(metadata->get(vmk_inherited), std::inserter(inherits, inherits.begin()));
+ tokeniser.tokenise(metadata->get_ebuild_interface()->get<evm_inherited>(), std::inserter(inherits, inherits.begin()));
static std::set<std::string> inherits_blacklist;
if (inherits_blacklist.empty())
diff --git a/paludis/qa/iuse_check.cc b/paludis/qa/iuse_check.cc
index ad5cc8c..e580621 100644
--- a/paludis/qa/iuse_check.cc
+++ b/paludis/qa/iuse_check.cc
@@ -40,7 +40,8 @@ IuseCheck::operator() (const EbuildCheckData & e) const
PackageDatabaseEntry ee(e.get<ecd_name>(), e.get<ecd_version>(),
e.get<ecd_environment>()->package_database()->favourite_repository());
VersionMetadata::ConstPointer metadata(
- e.get<ecd_environment>()->package_database()->fetch_metadata(ee));
+ e.get<ecd_environment>()->package_database()->fetch_repository(
+ ee.get<pde_repository>())->version_metadata(ee.get<pde_name>(), ee.get<pde_version>()));
try
{
diff --git a/paludis/qa/keywords_check.cc b/paludis/qa/keywords_check.cc
index da96344..b57ce13 100644
--- a/paludis/qa/keywords_check.cc
+++ b/paludis/qa/keywords_check.cc
@@ -37,7 +37,8 @@ KeywordsCheck::operator() (const EbuildCheckData & e) const
PackageDatabaseEntry ee(e.get<ecd_name>(), e.get<ecd_version>(),
e.get<ecd_environment>()->package_database()->favourite_repository());
VersionMetadata::ConstPointer metadata(
- e.get<ecd_environment>()->package_database()->fetch_metadata(ee));
+ e.get<ecd_environment>()->package_database()->fetch_repository(
+ ee.get<pde_repository>())->version_metadata(ee.get<pde_name>(), ee.get<pde_version>()));
try
{
@@ -56,7 +57,7 @@ KeywordsCheck::operator() (const EbuildCheckData & e) const
result << Message(qal_major, "Bad entries in KEYWORDS");
}
- if (! metadata->get(vmk_e_keywords).empty())
+ if (! metadata->get_ebuild_interface()->get<evm_keywords>().empty())
result << Message(qal_major, "KEYWORDS was altered by an eclass");
}
catch (const InternalError &)
diff --git a/paludis/qa/license_check.cc b/paludis/qa/license_check.cc
index e1fbb29..e08b7be 100644
--- a/paludis/qa/license_check.cc
+++ b/paludis/qa/license_check.cc
@@ -18,7 +18,7 @@
*/
#include <paludis/dep_atom.hh>
-#include <paludis/dep_parser.hh>
+#include <paludis/portage_dep_parser.hh>
#include <paludis/qa/license_check.hh>
#include <paludis/util/tokeniser.hh>
@@ -95,15 +95,17 @@ LicenseCheck::operator() (const EbuildCheckData & e) const
PackageDatabaseEntry ee(e.get<ecd_name>(), e.get<ecd_version>(),
e.get<ecd_environment>()->package_database()->favourite_repository());
VersionMetadata::ConstPointer metadata(
- e.get<ecd_environment>()->package_database()->fetch_metadata(ee));
+ e.get<ecd_environment>()->package_database()->fetch_repository(
+ ee.get<pde_repository>())->version_metadata(ee.get<pde_name>(), ee.get<pde_version>()));
- std::string license(metadata->get(vmk_license));
+
+ std::string license(metadata->get<vm_license>());
DepAtom::ConstPointer license_parts(0);
try
{
- license_parts = DepParser::parse(license,
- DepParserPolicy<PlainTextDepAtom, true>::get_instance());
+ license_parts = PortageDepParser::parse(license,
+ PortageDepParserPolicy<PlainTextDepAtom, true>::get_instance());
Checker checker(result, e.get<ecd_environment>());
license_parts->accept(&checker);
diff --git a/paludis/qa/parse_deps_check.cc b/paludis/qa/parse_deps_check.cc
index 0402d71..8e3d805 100644
--- a/paludis/qa/parse_deps_check.cc
+++ b/paludis/qa/parse_deps_check.cc
@@ -17,7 +17,7 @@
* Place, Suite 330, Boston, MA 02111-1307 USA
*/
-#include <paludis/dep_parser.hh>
+#include <paludis/portage_dep_parser.hh>
#include <paludis/qa/parse_deps_check.hh>
using namespace paludis;
@@ -38,12 +38,13 @@ ParseDepsCheck::operator() (const EbuildCheckData & e) const
PackageDatabaseEntry ee(e.get<ecd_name>(), e.get<ecd_version>(),
e.get<ecd_environment>()->package_database()->favourite_repository());
VersionMetadata::ConstPointer metadata(
- e.get<ecd_environment>()->package_database()->fetch_metadata(ee));
+ e.get<ecd_environment>()->package_database()->fetch_repository(
+ ee.get<pde_repository>())->version_metadata(ee.get<pde_name>(), ee.get<pde_version>()));
try
{
- std::string depend(metadata->get(vmk_depend));
- DepParser::parse(depend);
+ std::string depend(metadata->get<vm_deps>().get<vmd_build_depend_string>());
+ PortageDepParser::parse(depend);
}
catch (const Exception & e)
{
@@ -53,8 +54,8 @@ ParseDepsCheck::operator() (const EbuildCheckData & e) const
try
{
- std::string rdepend(metadata->get(vmk_rdepend));
- DepParser::parse(rdepend);
+ std::string rdepend(metadata->get<vm_deps>().get<vmd_run_depend_string>());
+ PortageDepParser::parse(rdepend);
}
catch (const Exception & e)
{
@@ -64,8 +65,8 @@ ParseDepsCheck::operator() (const EbuildCheckData & e) const
try
{
- std::string pdepend(metadata->get(vmk_pdepend));
- DepParser::parse(pdepend);
+ std::string pdepend(metadata->get<vm_deps>().get<vmd_post_depend_string>());
+ PortageDepParser::parse(pdepend);
}
catch (const Exception & e)
{
diff --git a/paludis/qa/pdepend_overlap_check.cc b/paludis/qa/pdepend_overlap_check.cc
index 632e9cf..d048860 100644
--- a/paludis/qa/pdepend_overlap_check.cc
+++ b/paludis/qa/pdepend_overlap_check.cc
@@ -18,7 +18,7 @@
*/
#include <paludis/dep_atom.hh>
-#include <paludis/dep_parser.hh>
+#include <paludis/portage_dep_parser.hh>
#include <paludis/qa/pdepend_overlap_check.hh>
#include <paludis/util/join.hh>
@@ -81,16 +81,17 @@ PdependOverlapCheck::operator() (const EbuildCheckData & e) const
PackageDatabaseEntry ee(e.get<ecd_name>(), e.get<ecd_version>(),
e.get<ecd_environment>()->package_database()->favourite_repository());
VersionMetadata::ConstPointer metadata(
- e.get<ecd_environment>()->package_database()->fetch_metadata(ee));
+ e.get<ecd_environment>()->package_database()->fetch_repository(
+ ee.get<pde_repository>())->version_metadata(ee.get<pde_name>(), ee.get<pde_version>()));
Collector pdepend_collector;
- std::string pdepend(metadata->get(vmk_pdepend));
- DepParser::parse(pdepend)->accept(&pdepend_collector);
+ std::string pdepend(metadata->get<vm_deps>().get<vmd_post_depend_string>());
+ PortageDepParser::parse(pdepend)->accept(&pdepend_collector);
{
Collector depend_collector;
- std::string depend(metadata->get(vmk_depend));
- DepParser::parse(depend)->accept(&depend_collector);
+ std::string depend(metadata->get<vm_deps>().get<vmd_build_depend_string>());
+ PortageDepParser::parse(depend)->accept(&depend_collector);
std::set<QualifiedPackageName> overlap;
std::set_intersection(depend_collector.result.begin(), depend_collector.result.end(),
@@ -104,8 +105,8 @@ PdependOverlapCheck::operator() (const EbuildCheckData & e) const
{
Collector rdepend_collector;
- std::string rdepend(metadata->get(vmk_rdepend));
- DepParser::parse(rdepend)->accept(&rdepend_collector);
+ std::string rdepend(metadata->get<vm_deps>().get<vmd_run_depend_string>());
+ PortageDepParser::parse(rdepend)->accept(&rdepend_collector);
std::set<QualifiedPackageName> overlap;
std::set_intersection(rdepend_collector.result.begin(), rdepend_collector.result.end(),
diff --git a/paludis/qa/restrict_check.cc b/paludis/qa/restrict_check.cc
index 73c30cb..a084eee 100644
--- a/paludis/qa/restrict_check.cc
+++ b/paludis/qa/restrict_check.cc
@@ -41,11 +41,12 @@ RestrictCheck::operator() (const EbuildCheckData & e) const
PackageDatabaseEntry ee(e.get<ecd_name>(), e.get<ecd_version>(),
e.get<ecd_environment>()->package_database()->favourite_repository());
VersionMetadata::ConstPointer metadata(
- e.get<ecd_environment>()->package_database()->fetch_metadata(ee));
+ e.get<ecd_environment>()->package_database()->fetch_repository(
+ ee.get<pde_repository>())->version_metadata(ee.get<pde_name>(), ee.get<pde_version>()));
std::set<std::string> restricts;
Tokeniser<delim_kind::AnyOfTag, delim_mode::DelimiterTag> tokeniser(" \t\n");
- tokeniser.tokenise(metadata->get(vmk_restrict),
+ tokeniser.tokenise(metadata->get_ebuild_interface()->get<evm_restrict>(),
std::inserter(restricts, restricts.begin()));
static std::set<std::string> allowed_restricts;
diff --git a/paludis/qa/slot_check.cc b/paludis/qa/slot_check.cc
index 3a3ac6c..c189fc1 100644
--- a/paludis/qa/slot_check.cc
+++ b/paludis/qa/slot_check.cc
@@ -37,11 +37,12 @@ SlotCheck::operator() (const EbuildCheckData & e) const
PackageDatabaseEntry ee(e.get<ecd_name>(), e.get<ecd_version>(),
e.get<ecd_environment>()->package_database()->favourite_repository());
VersionMetadata::ConstPointer metadata(
- e.get<ecd_environment>()->package_database()->fetch_metadata(ee));
+ e.get<ecd_environment>()->package_database()->fetch_repository(
+ ee.get<pde_repository>())->version_metadata(ee.get<pde_name>(), ee.get<pde_version>()));
try
{
- SlotName slot(metadata->get(vmk_slot));
+ SlotName slot(metadata->get<vm_slot>());
}
catch (const NameError &)
{
diff --git a/paludis/qa/src_uri_check.cc b/paludis/qa/src_uri_check.cc
index 5e19ac0..c45847c 100644
--- a/paludis/qa/src_uri_check.cc
+++ b/paludis/qa/src_uri_check.cc
@@ -18,7 +18,7 @@
*/
#include <paludis/dep_atom.hh>
-#include <paludis/dep_parser.hh>
+#include <paludis/portage_dep_parser.hh>
#include <paludis/qa/src_uri_check.hh>
#include <paludis/util/tokeniser.hh>
@@ -135,19 +135,20 @@ SrcUriCheck::operator() (const EbuildCheckData & e) const
PackageDatabaseEntry ee(e.get<ecd_name>(), e.get<ecd_version>(),
e.get<ecd_environment>()->package_database()->favourite_repository());
VersionMetadata::ConstPointer metadata(
- e.get<ecd_environment>()->package_database()->fetch_metadata(ee));
+ e.get<ecd_environment>()->package_database()->fetch_repository(
+ ee.get<pde_repository>())->version_metadata(ee.get<pde_name>(), ee.get<pde_version>()));
- std::string src_uri(metadata->get(vmk_src_uri));
+ std::string src_uri(metadata->get_ebuild_interface()->get<evm_src_uri>());
DepAtom::ConstPointer src_uri_parts(0);
try
{
- src_uri_parts = DepParser::parse(src_uri,
- DepParserPolicy<PlainTextDepAtom, false>::get_instance());
+ src_uri_parts = PortageDepParser::parse(src_uri,
+ PortageDepParserPolicy<PlainTextDepAtom, false>::get_instance());
std::set<std::string> restricts;
Tokeniser<delim_kind::AnyOfTag, delim_mode::DelimiterTag> tokeniser(" \t\n");
- tokeniser.tokenise(metadata->get(vmk_restrict),
+ tokeniser.tokenise(metadata->get_ebuild_interface()->get<evm_restrict>(),
std::inserter(restricts, restricts.begin()));
bool fetch_restrict(restricts.end() != restricts.find("fetch"));