aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2007-02-08 13:21:06 +0000
committerAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2007-02-08 13:21:06 +0000
commitb9f8b4480a0ce37899fc06f859b19225657e8c1e (patch)
treeebcf77edd1c090592dc3d138f4f4413b24605968
parent2f9f7af02b6b5632a7ab6bfdeb05e4abbc64e73f (diff)
downloadpaludis-b9f8b4480a0ce37899fc06f859b19225657e8c1e.tar.gz
paludis-b9f8b4480a0ce37899fc06f859b19225657e8c1e.tar.xz
Let qualudis work with a master repository
-rw-r--r--paludis/environment/no_config/no_config_environment.cc36
-rw-r--r--paludis/environment/no_config/no_config_environment.hh3
-rw-r--r--paludis/environment/no_config/no_config_environment.sr1
-rw-r--r--paludis/qa/create_metadata_check.cc5
-rw-r--r--paludis/qa/dep_any_check.cc4
-rw-r--r--paludis/qa/dep_flags_check.cc4
-rw-r--r--paludis/qa/dep_packages_check.cc4
-rw-r--r--paludis/qa/deps_exist_check.cc4
-rw-r--r--paludis/qa/deps_visible_check.cc5
-rw-r--r--paludis/qa/description_check.cc4
-rw-r--r--paludis/qa/ebuild_check.hh1
-rw-r--r--paludis/qa/ebuild_check.sr2
-rw-r--r--paludis/qa/extract_check.cc4
-rw-r--r--paludis/qa/homepage_check.cc4
-rw-r--r--paludis/qa/inherits_check.cc4
-rw-r--r--paludis/qa/iuse_check.cc4
-rw-r--r--paludis/qa/keywords_check.cc4
-rw-r--r--paludis/qa/license_check.cc10
-rw-r--r--paludis/qa/parse_deps_check.cc4
-rw-r--r--paludis/qa/pdepend_overlap_check.cc4
-rw-r--r--paludis/qa/qa_environment.cc16
-rw-r--r--paludis/qa/qa_environment.hh13
-rw-r--r--paludis/qa/restrict_check.cc4
-rw-r--r--paludis/qa/slot_check.cc4
-rw-r--r--paludis/qa/src_uri_check.cc12
-rw-r--r--ruby/check.cc3
-rw-r--r--ruby/environment.cc20
-rw-r--r--ruby/environment_TEST.rb4
-rw-r--r--ruby/qa_environment.cc14
-rw-r--r--ruby/qa_environment_TEST.rb2
-rw-r--r--src/clients/adjutrix/adjutrix.cc3
-rw-r--r--src/clients/qualudis/qualudis.cc18
-rw-r--r--src/clients/qualudis/qualudis_command_line.cc6
-rw-r--r--src/clients/qualudis/qualudis_command_line.hh1
34 files changed, 180 insertions, 51 deletions
diff --git a/paludis/environment/no_config/no_config_environment.cc b/paludis/environment/no_config/no_config_environment.cc
index 6533912..2da2eed 100644
--- a/paludis/environment/no_config/no_config_environment.cc
+++ b/paludis/environment/no_config/no_config_environment.cc
@@ -42,6 +42,7 @@ namespace paludis
bool is_vdb;
std::tr1::shared_ptr<PortageRepository> portage_repo;
+ std::tr1::shared_ptr<PortageRepository> master_repo;
Implementation(Environment * const env, const NoConfigEnvironmentParams & params);
};
@@ -116,6 +117,22 @@ Implementation<NoConfigEnvironment>::Implementation(
if (! is_vdb)
{
+ if (FSEntry("/var/empty") != params.master_repository_dir)
+ {
+ std::tr1::shared_ptr<AssociativeCollection<std::string, std::string> > keys(
+ new AssociativeCollection<std::string, std::string>::Concrete);
+
+ keys->insert("format", "ebuild");
+ keys->insert("location", stringify(params.master_repository_dir));
+ keys->insert("profiles", "/var/empty");
+ keys->insert("write_cache", stringify(params.write_cache));
+ keys->insert("names_cache", "/var/empty");
+
+ env->package_database()->add_repository(((master_repo =
+ std::tr1::static_pointer_cast<PortageRepository>(
+ RepositoryMaker::get_instance()->find_maker("ebuild")(env, keys)))));
+ }
+
std::tr1::shared_ptr<AssociativeCollection<std::string, std::string> > keys(
new AssociativeCollection<std::string, std::string>::Concrete);
@@ -124,6 +141,8 @@ Implementation<NoConfigEnvironment>::Implementation(
keys->insert("profiles", "/var/empty");
keys->insert("write_cache", stringify(params.write_cache));
keys->insert("names_cache", "/var/empty");
+ if (FSEntry("/var/empty") != params.master_repository_dir)
+ keys->insert("master_repository", stringify(master_repo->name()));
env->package_database()->add_repository(((portage_repo =
std::tr1::static_pointer_cast<PortageRepository>(
@@ -157,6 +176,10 @@ NoConfigEnvironment::NoConfigEnvironment(const NoConfigEnvironmentParams & param
if (_imp->portage_repo)
if (_imp->portage_repo->end_profiles() != _imp->portage_repo->begin_profiles())
_imp->portage_repo->set_profile(_imp->portage_repo->begin_profiles());
+
+ if (_imp->master_repo)
+ if (_imp->master_repo->end_profiles() != _imp->master_repo->begin_profiles())
+ _imp->master_repo->set_profile(_imp->master_repo->begin_profiles());
}
NoConfigEnvironment::~NoConfigEnvironment()
@@ -249,3 +272,16 @@ NoConfigEnvironment::portage_repository() const
return _imp->portage_repo;
}
+std::tr1::shared_ptr<PortageRepository>
+NoConfigEnvironment::master_repository()
+{
+ return _imp->master_repo;
+}
+
+std::tr1::shared_ptr<const PortageRepository>
+NoConfigEnvironment::master_repository() const
+{
+ return _imp->master_repo;
+}
+
+
diff --git a/paludis/environment/no_config/no_config_environment.hh b/paludis/environment/no_config/no_config_environment.hh
index 9aaed3e..87a29da 100644
--- a/paludis/environment/no_config/no_config_environment.hh
+++ b/paludis/environment/no_config/no_config_environment.hh
@@ -80,6 +80,9 @@ namespace paludis
std::tr1::shared_ptr<PortageRepository> portage_repository();
std::tr1::shared_ptr<const PortageRepository> portage_repository() const;
+
+ std::tr1::shared_ptr<PortageRepository> master_repository();
+ std::tr1::shared_ptr<const PortageRepository> master_repository() const;
};
}
diff --git a/paludis/environment/no_config/no_config_environment.sr b/paludis/environment/no_config/no_config_environment.sr
index 3acafa0..290d5e3 100644
--- a/paludis/environment/no_config/no_config_environment.sr
+++ b/paludis/environment/no_config/no_config_environment.sr
@@ -7,6 +7,7 @@ make_class_NoConfigEnvironmentParams()
key write_cache "FSEntry"
key accept_unstable bool
key repository_type NoConfigEnvironmentRepositoryType
+ key master_repository_dir "FSEntry"
allow_named_args
}
diff --git a/paludis/qa/create_metadata_check.cc b/paludis/qa/create_metadata_check.cc
index 1429969..c99ce01 100644
--- a/paludis/qa/create_metadata_check.cc
+++ b/paludis/qa/create_metadata_check.cc
@@ -20,7 +20,8 @@
#include <paludis/qa/create_metadata_check.hh>
#include <paludis/portage_dep_parser.hh>
#include <paludis/package_database_entry.hh>
-#include <paludis/environment.hh>
+#include <paludis/qa/qa_environment.hh>
+#include <paludis/repositories/portage/portage_repository.hh>
using namespace paludis;
using namespace paludis::qa;
@@ -38,7 +39,7 @@ CreateMetadataCheck::operator() (const EbuildCheckData & e) const
try
{
PackageDatabaseEntry ee(e.name, e.version,
- e.environment->package_database()->favourite_repository());
+ e.environment->portage_repository()->name());
std::tr1::shared_ptr<const VersionMetadata> metadata(
e.environment->package_database()->fetch_repository(ee.repository)->version_metadata(ee.name, ee.version));
diff --git a/paludis/qa/dep_any_check.cc b/paludis/qa/dep_any_check.cc
index e759c66..03801b5 100644
--- a/paludis/qa/dep_any_check.cc
+++ b/paludis/qa/dep_any_check.cc
@@ -25,6 +25,8 @@
#include <paludis/environment.hh>
#include <paludis/util/iterator.hh>
#include <paludis/util/save.hh>
+#include <paludis/qa/qa_environment.hh>
+#include <paludis/repositories/portage/portage_repository.hh>
using namespace paludis;
using namespace paludis::qa;
@@ -105,7 +107,7 @@ DepAnyCheck::operator() (const EbuildCheckData & e) const
try
{
PackageDatabaseEntry ee(e.name, e.version,
- e.environment->package_database()->favourite_repository());
+ e.environment->portage_repository()->name());
std::tr1::shared_ptr<const VersionMetadata> metadata(
e.environment->package_database()->fetch_repository(ee.repository)->version_metadata(ee.name, ee.version));
diff --git a/paludis/qa/dep_flags_check.cc b/paludis/qa/dep_flags_check.cc
index 0806121..e721a97 100644
--- a/paludis/qa/dep_flags_check.cc
+++ b/paludis/qa/dep_flags_check.cc
@@ -23,6 +23,8 @@
#include <paludis/portage_dep_parser.hh>
#include <paludis/qa/dep_flags_check.hh>
#include <paludis/util/tokeniser.hh>
+#include <paludis/qa/qa_environment.hh>
+#include <paludis/repositories/portage/portage_repository.hh>
#include <set>
using namespace paludis;
@@ -129,7 +131,7 @@ DepFlagsCheck::operator() (const EbuildCheckData & e) const
try
{
PackageDatabaseEntry ee(e.name, e.version,
- e.environment->package_database()->favourite_repository());
+ e.environment->portage_repository()->name());
std::tr1::shared_ptr<const VersionMetadata> metadata(
e.environment->package_database()->fetch_repository(ee.repository)->version_metadata(ee.name, ee.version));
diff --git a/paludis/qa/dep_packages_check.cc b/paludis/qa/dep_packages_check.cc
index 937f25c..4398a06 100644
--- a/paludis/qa/dep_packages_check.cc
+++ b/paludis/qa/dep_packages_check.cc
@@ -25,6 +25,8 @@
#include <paludis/config_file.hh>
#include <paludis/util/log.hh>
#include <paludis/util/system.hh>
+#include <paludis/qa/qa_environment.hh>
+#include <paludis/repositories/portage/portage_repository.hh>
#include <set>
using namespace paludis;
@@ -83,7 +85,7 @@ DepPackagesCheck::operator() (const EbuildCheckData & e) const
try
{
PackageDatabaseEntry ee(e.name, e.version,
- e.environment->package_database()->favourite_repository());
+ e.environment->portage_repository()->name());
std::tr1::shared_ptr<const VersionMetadata> metadata(
e.environment->package_database()->fetch_repository(ee.repository)->version_metadata(ee.name, ee.version));
diff --git a/paludis/qa/deps_exist_check.cc b/paludis/qa/deps_exist_check.cc
index bfac6d2..dbec561 100644
--- a/paludis/qa/deps_exist_check.cc
+++ b/paludis/qa/deps_exist_check.cc
@@ -23,6 +23,8 @@
#include <paludis/portage_dep_parser.hh>
#include <paludis/qa/deps_exist_check.hh>
#include <paludis/util/save.hh>
+#include <paludis/qa/qa_environment.hh>
+#include <paludis/repositories/portage/portage_repository.hh>
using namespace paludis;
using namespace paludis::qa;
@@ -96,7 +98,7 @@ DepsExistCheck::operator() (const EbuildCheckData & e) const
try
{
PackageDatabaseEntry ee(e.name, e.version,
- e.environment->package_database()->favourite_repository());
+ e.environment->portage_repository()->name());
std::tr1::shared_ptr<const VersionMetadata> metadata(
e.environment->package_database()->fetch_repository(ee.repository)->version_metadata(ee.name, ee.version));
diff --git a/paludis/qa/deps_visible_check.cc b/paludis/qa/deps_visible_check.cc
index a77af9b..89dcd8a 100644
--- a/paludis/qa/deps_visible_check.cc
+++ b/paludis/qa/deps_visible_check.cc
@@ -189,9 +189,12 @@ DepsVisibleCheck::operator() (const PerProfileEbuildCheckData & e) const
{
e.environment->portage_repository()->set_profile(
e.environment->portage_repository()->find_profile(e.profile));
+ if (e.environment->master_repository())
+ e.environment->master_repository()->set_profile(
+ e.environment->master_repository()->find_profile(e.profile));
PackageDatabaseEntry ee(e.name, e.version,
- e.environment->package_database()->favourite_repository());
+ e.environment->portage_repository()->name());
std::tr1::shared_ptr<const VersionMetadata> metadata(
e.environment->package_database()->fetch_repository(ee.repository)->version_metadata(ee.name, ee.version));
diff --git a/paludis/qa/description_check.cc b/paludis/qa/description_check.cc
index 38892d8..75ece5c 100644
--- a/paludis/qa/description_check.cc
+++ b/paludis/qa/description_check.cc
@@ -20,6 +20,8 @@
#include <paludis/qa/description_check.hh>
#include <paludis/package_database_entry.hh>
#include <paludis/environment.hh>
+#include <paludis/qa/qa_environment.hh>
+#include <paludis/repositories/portage/portage_repository.hh>
#include <strings.h>
using namespace paludis;
@@ -38,7 +40,7 @@ DescriptionCheck::operator() (const EbuildCheckData & e) const
try
{
PackageDatabaseEntry ee(e.name, e.version,
- e.environment->package_database()->favourite_repository());
+ e.environment->portage_repository()->name());
std::tr1::shared_ptr<const VersionMetadata> metadata(
e.environment->package_database()->fetch_repository(ee.repository)->version_metadata(ee.name, ee.version));
diff --git a/paludis/qa/ebuild_check.hh b/paludis/qa/ebuild_check.hh
index 70b7b2b..f003359 100644
--- a/paludis/qa/ebuild_check.hh
+++ b/paludis/qa/ebuild_check.hh
@@ -32,6 +32,7 @@ namespace paludis
namespace qa
{
+ class QAEnvironment;
#include <paludis/qa/ebuild_check-sr.hh>
diff --git a/paludis/qa/ebuild_check.sr b/paludis/qa/ebuild_check.sr
index c5248dd..911f56c 100644
--- a/paludis/qa/ebuild_check.sr
+++ b/paludis/qa/ebuild_check.sr
@@ -5,6 +5,6 @@ make_class_EbuildCheckData()
{
key name QualifiedPackageName
key version VersionSpec
- key environment "const Environment *"
+ key environment "const QAEnvironment *"
}
diff --git a/paludis/qa/extract_check.cc b/paludis/qa/extract_check.cc
index 4d14858..3d8505c 100644
--- a/paludis/qa/extract_check.cc
+++ b/paludis/qa/extract_check.cc
@@ -23,6 +23,8 @@
#include <paludis/portage_dep_parser.hh>
#include <paludis/qa/extract_check.hh>
#include <paludis/util/tokeniser.hh>
+#include <paludis/qa/qa_environment.hh>
+#include <paludis/repositories/portage/portage_repository.hh>
using namespace paludis;
using namespace paludis::qa;
@@ -82,7 +84,7 @@ ExtractCheck::operator() (const EbuildCheckData & e) const
do
{
PackageDatabaseEntry ee(e.name, e.version,
- e.environment->package_database()->favourite_repository());
+ e.environment->portage_repository()->name());
std::tr1::shared_ptr<const VersionMetadata> metadata(
e.environment->package_database()->fetch_repository(ee.repository)->version_metadata(ee.name, ee.version));
diff --git a/paludis/qa/homepage_check.cc b/paludis/qa/homepage_check.cc
index 6e49c21..84e0ef6 100644
--- a/paludis/qa/homepage_check.cc
+++ b/paludis/qa/homepage_check.cc
@@ -20,6 +20,8 @@
#include <paludis/qa/homepage_check.hh>
#include <paludis/package_database_entry.hh>
#include <paludis/environment.hh>
+#include <paludis/qa/qa_environment.hh>
+#include <paludis/repositories/portage/portage_repository.hh>
using namespace paludis;
using namespace paludis::qa;
@@ -37,7 +39,7 @@ HomepageCheck::operator() (const EbuildCheckData & e) const
try
{
PackageDatabaseEntry ee(e.name, e.version,
- e.environment->package_database()->favourite_repository());
+ e.environment->portage_repository()->name());
std::tr1::shared_ptr<const VersionMetadata> metadata(
e.environment->package_database()->fetch_repository(ee.repository)->version_metadata(ee.name, ee.version));
diff --git a/paludis/qa/inherits_check.cc b/paludis/qa/inherits_check.cc
index 712722d..5be8f64 100644
--- a/paludis/qa/inherits_check.cc
+++ b/paludis/qa/inherits_check.cc
@@ -27,6 +27,8 @@
#include <paludis/config_file.hh>
#include <paludis/util/log.hh>
#include <paludis/util/system.hh>
+#include <paludis/qa/qa_environment.hh>
+#include <paludis/repositories/portage/portage_repository.hh>
#include <set>
using namespace paludis;
@@ -45,7 +47,7 @@ InheritsCheck::operator() (const EbuildCheckData & e) const
try
{
PackageDatabaseEntry ee(e.name, e.version,
- e.environment->package_database()->favourite_repository());
+ e.environment->portage_repository()->name());
std::tr1::shared_ptr<const VersionMetadata> metadata(
e.environment->package_database()->fetch_repository(ee.repository)->version_metadata(ee.name, ee.version));
diff --git a/paludis/qa/iuse_check.cc b/paludis/qa/iuse_check.cc
index 032d31e..ae5ddfa 100644
--- a/paludis/qa/iuse_check.cc
+++ b/paludis/qa/iuse_check.cc
@@ -27,6 +27,8 @@
#include <paludis/util/tokeniser.hh>
#include <paludis/util/log.hh>
#include <paludis/util/system.hh>
+#include <paludis/qa/qa_environment.hh>
+#include <paludis/repositories/portage/portage_repository.hh>
using namespace paludis;
using namespace paludis::qa;
@@ -47,7 +49,7 @@ IuseCheck::operator() (const EbuildCheckData & e) const
try
{
PackageDatabaseEntry ee(e.name, e.version,
- e.environment->package_database()->favourite_repository());
+ e.environment->portage_repository()->name());
std::tr1::shared_ptr<const VersionMetadata> metadata(
e.environment->package_database()->fetch_repository(ee.repository)->
version_metadata(ee.name, ee.version));
diff --git a/paludis/qa/keywords_check.cc b/paludis/qa/keywords_check.cc
index fe210f1..4574c84 100644
--- a/paludis/qa/keywords_check.cc
+++ b/paludis/qa/keywords_check.cc
@@ -21,6 +21,8 @@
#include <paludis/util/tokeniser.hh>
#include <paludis/package_database_entry.hh>
#include <paludis/environment.hh>
+#include <paludis/qa/qa_environment.hh>
+#include <paludis/repositories/portage/portage_repository.hh>
#include <set>
using namespace paludis;
@@ -39,7 +41,7 @@ KeywordsCheck::operator() (const EbuildCheckData & e) const
try
{
PackageDatabaseEntry ee(e.name, e.version,
- e.environment->package_database()->favourite_repository());
+ e.environment->portage_repository()->name());
std::tr1::shared_ptr<const VersionMetadata> metadata(
e.environment->package_database()->fetch_repository(ee.repository)->version_metadata(ee.name, ee.version));
diff --git a/paludis/qa/license_check.cc b/paludis/qa/license_check.cc
index 0a9e595..a77588a 100644
--- a/paludis/qa/license_check.cc
+++ b/paludis/qa/license_check.cc
@@ -23,6 +23,8 @@
#include <paludis/environment.hh>
#include <paludis/qa/license_check.hh>
#include <paludis/util/tokeniser.hh>
+#include <paludis/qa/qa_environment.hh>
+#include <paludis/repositories/portage/portage_repository.hh>
using namespace paludis;
using namespace paludis::qa;
@@ -40,9 +42,9 @@ namespace
using DepAtomVisitorTypes::ConstVisitor::VisitChildren<Checker, AnyDepAtom>::visit;
CheckResult & result;
- const Environment * const env;
+ const QAEnvironment * const env;
- Checker(CheckResult & rr, const Environment * const e) :
+ Checker(CheckResult & rr, const QAEnvironment * const e) :
result(rr),
env(e)
{
@@ -51,7 +53,7 @@ namespace
void visit(const PlainTextDepAtom * const a)
{
if (! env->package_database()->fetch_repository(
- env->package_database()->favourite_repository())->is_license(a->text()))
+ env->portage_repository()->name())->is_license(a->text()))
result << Message(qal_major, "Item '" + a->text() + "' is not a licence");
}
@@ -87,7 +89,7 @@ LicenseCheck::operator() (const EbuildCheckData & e) const
do
{
PackageDatabaseEntry ee(e.name, e.version,
- e.environment->package_database()->favourite_repository());
+ e.environment->portage_repository()->name());
std::tr1::shared_ptr<const VersionMetadata> metadata(
e.environment->package_database()->fetch_repository(ee.repository)->version_metadata(ee.name, ee.version));
diff --git a/paludis/qa/parse_deps_check.cc b/paludis/qa/parse_deps_check.cc
index 0bfc91d..f9bcf05 100644
--- a/paludis/qa/parse_deps_check.cc
+++ b/paludis/qa/parse_deps_check.cc
@@ -21,6 +21,8 @@
#include <paludis/package_database_entry.hh>
#include <paludis/environment.hh>
#include <paludis/qa/parse_deps_check.hh>
+#include <paludis/qa/qa_environment.hh>
+#include <paludis/repositories/portage/portage_repository.hh>
using namespace paludis;
using namespace paludis::qa;
@@ -38,7 +40,7 @@ ParseDepsCheck::operator() (const EbuildCheckData & e) const
try
{
PackageDatabaseEntry ee(e.name, e.version,
- e.environment->package_database()->favourite_repository());
+ e.environment->portage_repository()->name());
std::tr1::shared_ptr<const VersionMetadata> metadata(
e.environment->package_database()->fetch_repository(ee.repository)->version_metadata(ee.name, ee.version));
diff --git a/paludis/qa/pdepend_overlap_check.cc b/paludis/qa/pdepend_overlap_check.cc
index 899fdf4..fc58e00 100644
--- a/paludis/qa/pdepend_overlap_check.cc
+++ b/paludis/qa/pdepend_overlap_check.cc
@@ -23,6 +23,8 @@
#include <paludis/environment.hh>
#include <paludis/qa/pdepend_overlap_check.hh>
#include <paludis/util/join.hh>
+#include <paludis/qa/qa_environment.hh>
+#include <paludis/repositories/portage/portage_repository.hh>
#include <set>
using namespace paludis;
@@ -74,7 +76,7 @@ PdependOverlapCheck::operator() (const EbuildCheckData & e) const
try
{
PackageDatabaseEntry ee(e.name, e.version,
- e.environment->package_database()->favourite_repository());
+ e.environment->portage_repository()->name());
std::tr1::shared_ptr<const VersionMetadata> metadata(
e.environment->package_database()->fetch_repository(ee.repository)->version_metadata(ee.name, ee.version));
diff --git a/paludis/qa/qa_environment.cc b/paludis/qa/qa_environment.cc
index 950e8ac..fc24874 100644
--- a/paludis/qa/qa_environment.cc
+++ b/paludis/qa/qa_environment.cc
@@ -1,7 +1,7 @@
/* vim: set sw=4 sts=4 et foldmethod=syntax : */
/*
- * Copyright (c) 2006 Ciaran McCreesh <ciaranm@ciaranm.org>
+ * Copyright (c) 2006, 2007 Ciaran McCreesh <ciaranm@ciaranm.org>
* Copyright (c) 2006 David Morgan <david.morgan@wadham.oxford.ac.uk>
*
* This file is part of the Paludis package manager. Paludis is free software;
@@ -43,7 +43,19 @@ QAEnvironment::QAEnvironment(const FSEntry & base, const FSEntry & write_cache)
.repository_dir(base)
.write_cache(write_cache)
.accept_unstable(false)
- .repository_type(ncer_portage))
+ .repository_type(ncer_portage)
+ .master_repository_dir(FSEntry("/var/empty")))
+{
+}
+
+QAEnvironment::QAEnvironment(const FSEntry & base, const FSEntry & write_cache,
+ const FSEntry & master_repository_dir) :
+ NoConfigEnvironment(NoConfigEnvironmentParams::create()
+ .repository_dir(base)
+ .write_cache(write_cache)
+ .accept_unstable(false)
+ .repository_type(ncer_portage)
+ .master_repository_dir(master_repository_dir))
{
}
diff --git a/paludis/qa/qa_environment.hh b/paludis/qa/qa_environment.hh
index e9e67c8..1d8cb55 100644
--- a/paludis/qa/qa_environment.hh
+++ b/paludis/qa/qa_environment.hh
@@ -1,7 +1,7 @@
/* vim: set sw=4 sts=4 et foldmethod=syntax : */
/*
- * Copyright (c) 2006 Ciaran McCreesh <ciaranm@ciaranm.org>
+ * Copyright (c) 2006, 2007 Ciaran McCreesh <ciaranm@ciaranm.org>
* Copyright (c) 2006 David Morgan <david.morgan@wadham.oxford.ac.uk>
*
* This file is part of the Paludis package manager. Paludis is free software;
@@ -44,8 +44,17 @@ namespace paludis
public NoConfigEnvironment
{
public:
+ /**
+ * Constructor.
+ *
+ * \deprecated Use the three arg form
+ */
QAEnvironment(const FSEntry & base,
- const FSEntry & write_cache = FSEntry("/var/empty"));
+ const FSEntry & write_cache) PALUDIS_ATTRIBUTE((deprecated));
+
+ QAEnvironment(const FSEntry & base,
+ const FSEntry & write_cache = FSEntry("/var/empty"),
+ const FSEntry & master_repository_dir = FSEntry("/var/empty"));
~QAEnvironment();
diff --git a/paludis/qa/restrict_check.cc b/paludis/qa/restrict_check.cc
index 8a5c682..58eb7aa 100644
--- a/paludis/qa/restrict_check.cc
+++ b/paludis/qa/restrict_check.cc
@@ -23,6 +23,8 @@
#include <paludis/util/tokeniser.hh>
#include <paludis/package_database_entry.hh>
#include <paludis/environment.hh>
+#include <paludis/qa/qa_environment.hh>
+#include <paludis/repositories/portage/portage_repository.hh>
#include <set>
using namespace paludis;
@@ -41,7 +43,7 @@ RestrictCheck::operator() (const EbuildCheckData & e) const
try
{
PackageDatabaseEntry ee(e.name, e.version,
- e.environment->package_database()->favourite_repository());
+ e.environment->portage_repository()->name());
std::tr1::shared_ptr<const VersionMetadata> metadata(
e.environment->package_database()->fetch_repository(ee.repository)->version_metadata(ee.name, ee.version));
diff --git a/paludis/qa/slot_check.cc b/paludis/qa/slot_check.cc
index 9b0b189..9968d3b 100644
--- a/paludis/qa/slot_check.cc
+++ b/paludis/qa/slot_check.cc
@@ -20,6 +20,8 @@
#include <paludis/qa/slot_check.hh>
#include <paludis/package_database_entry.hh>
#include <paludis/environment.hh>
+#include <paludis/qa/qa_environment.hh>
+#include <paludis/repositories/portage/portage_repository.hh>
using namespace paludis;
using namespace paludis::qa;
@@ -37,7 +39,7 @@ SlotCheck::operator() (const EbuildCheckData & e) const
try
{
PackageDatabaseEntry ee(e.name, e.version,
- e.environment->package_database()->favourite_repository());
+ e.environment->portage_repository()->name());
std::tr1::shared_ptr<const VersionMetadata> metadata(
e.environment->package_database()->fetch_repository(ee.repository)->version_metadata(ee.name, ee.version));
diff --git a/paludis/qa/src_uri_check.cc b/paludis/qa/src_uri_check.cc
index 52b3aef..8b9c49e 100644
--- a/paludis/qa/src_uri_check.cc
+++ b/paludis/qa/src_uri_check.cc
@@ -23,6 +23,8 @@
#include <paludis/environment.hh>
#include <paludis/qa/src_uri_check.hh>
#include <paludis/util/tokeniser.hh>
+#include <paludis/qa/qa_environment.hh>
+#include <paludis/repositories/portage/portage_repository.hh>
#include <set>
using namespace paludis;
@@ -40,9 +42,9 @@ namespace
CheckResult & result;
bool fetch_restrict;
- const Environment * const env;
+ const QAEnvironment * const env;
- Checker(CheckResult & rr, bool f, const Environment * const e) :
+ Checker(CheckResult & rr, bool f, const QAEnvironment * const e) :
result(rr),
fetch_restrict(f),
env(e)
@@ -86,10 +88,10 @@ namespace
{
mirror_host.erase(pos);
RepositoryMirrorsInterface * m(env->package_database()->fetch_repository(
- env->package_database()->favourite_repository())->mirrors_interface);
+ env->portage_repository()->name())->mirrors_interface);
if (! m)
result << Message(qal_major, "Mirror '" + a->text() + "' used, but repository '"
- + stringify(env->package_database()->favourite_repository())
+ + stringify(env->portage_repository()->name())
+ "' defines no mirrors interface");
else if (! m->is_mirror(mirror_host))
result << Message(qal_major, "Unknown mirror '" + mirror_host
@@ -137,7 +139,7 @@ SrcUriCheck::operator() (const EbuildCheckData & e) const
do
{
PackageDatabaseEntry ee(e.name, e.version,
- e.environment->package_database()->favourite_repository());
+ e.environment->portage_repository()->name());
std::tr1::shared_ptr<const VersionMetadata> metadata(
e.environment->package_database()->fetch_repository(ee.repository)->version_metadata(ee.name, ee.version));
diff --git a/ruby/check.cc b/ruby/check.cc
index 5e60da7..64a84b2 100644
--- a/ruby/check.cc
+++ b/ruby/check.cc
@@ -71,8 +71,7 @@ namespace
ptr = new EbuildCheckData(
value_to_qualified_package_name(argv[0]),
value_to_version_spec(argv[1]),
- value_to_environment_data(argv[2])->env_ptr
- );
+ value_to_qa_environment(argv[2]));
}
else
{
diff --git a/ruby/environment.cc b/ruby/environment.cc
index 2d571ab..e1f95ea 100644
--- a/ruby/environment.cc
+++ b/ruby/environment.cc
@@ -1,7 +1,7 @@
/* vim: set sw=4 sts=4 et foldmethod=syntax : */
/*
- * Copyright (c) 2006 Ciaran McCreesh <ciaranm@ciaranm.org>
+ * Copyright (c) 2006, 2007 Ciaran McCreesh <ciaranm@ciaranm.org>
*
* 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
@@ -309,13 +309,24 @@ namespace
{
try
{
- std::string write_cache;
+ std::string write_cache, master_repository_dir;
if (1 == argc)
+ {
write_cache = "/var/empty/";
+ master_repository_dir = "/var/empty/";
+ }
else if (2 == argc)
+ {
write_cache = StringValuePtr(argv[1]);
+ master_repository_dir = "/var/empty/";
+ }
+ else if (3 == argc)
+ {
+ write_cache = StringValuePtr(argv[1]);
+ master_repository_dir = StringValuePtr(argv[2]);
+ }
else
- rb_raise(rb_eArgError, "NoConfigEnvironment.new expects one or two arguments, but got %d", argc);
+ rb_raise(rb_eArgError, "NoConfigEnvironment.new expects one to three arguments, but got %d", argc);
std::string path;
if (rb_obj_is_kind_of(argv[0], rb_cDir))
@@ -330,7 +341,8 @@ namespace
.repository_dir(FSEntry(path))
.write_cache(write_cache)
.accept_unstable(false)
- .repository_type(ncer_auto)));
+ .repository_type(ncer_auto)
+ .master_repository_dir(FSEntry(master_repository_dir))));
EnvironmentData * ptr(new EnvironmentData(e, e));
VALUE tdata(Data_Wrap_Struct(self, 0, &Common<EnvironmentData>::free, ptr));
rb_obj_call_init(tdata, argc, argv);
diff --git a/ruby/environment_TEST.rb b/ruby/environment_TEST.rb
index 6ebf18a..ac99f50 100644
--- a/ruby/environment_TEST.rb
+++ b/ruby/environment_TEST.rb
@@ -2,7 +2,7 @@
# vim: set sw=4 sts=4 et tw=80 :
#
-# Copyright (c) 2006 Ciaran McCreesh <ciaranm@ciaranm.org>
+# Copyright (c) 2006, 2007 Ciaran McCreesh <ciaranm@ciaranm.org>
#
# 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
@@ -73,7 +73,7 @@ module Paludis
end
assert_raise ArgumentError do
- e = NoConfigEnvironment.new(1,2,3)
+ e = NoConfigEnvironment.new(1,2,3,4)
end
end
end
diff --git a/ruby/qa_environment.cc b/ruby/qa_environment.cc
index 999a397..669d7bf 100644
--- a/ruby/qa_environment.cc
+++ b/ruby/qa_environment.cc
@@ -48,22 +48,30 @@ namespace
VALUE
qa_environment_new(int argc, VALUE* argv, VALUE self)
{
- std::string write_cache;
+ std::string write_cache, master_repository_dir;
try
{
if (1 == argc)
{
write_cache = "/var/empty";
+ master_repository_dir = "/var/empty";
}
else if (2 == argc)
{
write_cache = StringValuePtr(argv[1]);
+ master_repository_dir = "/var/empty";
+ }
+ else if (3 == argc)
+ {
+ write_cache = StringValuePtr(argv[1]);
+ master_repository_dir = StringValuePtr(argv[2]);
}
else
{
- rb_raise(rb_eArgError, "QAEnvironment expects one or two arguments, but got %d",argc);
+ rb_raise(rb_eArgError, "QAEnvironment expects one to three arguments, but got %d",argc);
}
- QAEnvironment * e = new QAEnvironment(FSEntry(StringValuePtr(argv[0])), FSEntry(write_cache));
+ QAEnvironment * e = new QAEnvironment(FSEntry(StringValuePtr(argv[0])), FSEntry(write_cache),
+ FSEntry(master_repository_dir));
EnvironmentData * ptr(new EnvironmentData(e,e));
VALUE tdata(Data_Wrap_Struct(self, 0, &Common<EnvironmentData>::free, ptr));
rb_obj_call_init(tdata, argc, argv);
diff --git a/ruby/qa_environment_TEST.rb b/ruby/qa_environment_TEST.rb
index 76a8254..6e5c7d1 100644
--- a/ruby/qa_environment_TEST.rb
+++ b/ruby/qa_environment_TEST.rb
@@ -37,7 +37,7 @@ module Paludis
end
assert_raise ArgumentError do
- env = QAEnvironment.new("1","2","3")
+ env = QAEnvironment.new("1","2","3","4")
end
end
diff --git a/src/clients/adjutrix/adjutrix.cc b/src/clients/adjutrix/adjutrix.cc
index b0592d6..c755c29 100644
--- a/src/clients/adjutrix/adjutrix.cc
+++ b/src/clients/adjutrix/adjutrix.cc
@@ -150,7 +150,8 @@ main(int argc, char *argv[])
.accept_unstable(CommandLine::get_instance()->a_unstable.specified())
.repository_type(
(CommandLine::get_instance()->a_reverse_deps.specified()) ? ncer_auto : ncer_portage
- ));
+ )
+ .master_repository_dir(FSEntry("/var/empty")));
if (CommandLine::get_instance()->a_find_stable_candidates.specified())
{
diff --git a/src/clients/qualudis/qualudis.cc b/src/clients/qualudis/qualudis.cc
index 980b897..e7165d5 100644
--- a/src/clients/qualudis/qualudis.cc
+++ b/src/clients/qualudis/qualudis.cc
@@ -489,7 +489,8 @@ namespace
set_entry_heading("QA checks for top level directory " + stringify(dir) + ":");
- qa::QAEnvironment env(dir, QualudisCommandLine::get_instance()->a_write_cache_dir.argument());
+ qa::QAEnvironment env(dir, QualudisCommandLine::get_instance()->a_write_cache_dir.argument(),
+ QualudisCommandLine::get_instance()->a_master_repository_dir.argument());
bool ok(true);
for (DirIterator d(dir) ; d != DirIterator() ; ++d)
@@ -519,20 +520,23 @@ namespace
if (dir.basename() == "eclass" && dir.is_directory())
{
- qa::QAEnvironment env(dir.dirname(), QualudisCommandLine::get_instance()->a_write_cache_dir.argument());
+ qa::QAEnvironment env(dir.dirname(), QualudisCommandLine::get_instance()->a_write_cache_dir.argument(),
+ QualudisCommandLine::get_instance()->a_master_repository_dir.argument());
return do_check_eclass_dir(dir, env);
}
if (dir.basename() == "profiles" && dir.is_directory())
{
- qa::QAEnvironment env(dir.dirname(), QualudisCommandLine::get_instance()->a_write_cache_dir.argument());
+ qa::QAEnvironment env(dir.dirname(), QualudisCommandLine::get_instance()->a_write_cache_dir.argument(),
+ QualudisCommandLine::get_instance()->a_master_repository_dir.argument());
return do_check_profiles_dir(dir, env);
}
if (std::count_if(DirIterator(dir), DirIterator(), IsFileWithExtension(
dir.basename() + "-", ".ebuild")))
{
- qa::QAEnvironment env(dir.dirname().dirname(), QualudisCommandLine::get_instance()->a_write_cache_dir.argument());
+ qa::QAEnvironment env(dir.dirname().dirname(), QualudisCommandLine::get_instance()->a_write_cache_dir.argument(),
+ QualudisCommandLine::get_instance()->a_master_repository_dir.argument());
return do_check_package_dir(dir, env);
}
@@ -541,7 +545,8 @@ namespace
if ((dir.dirname() / "profiles").is_directory())
{
- qa::QAEnvironment env(dir.dirname(), QualudisCommandLine::get_instance()->a_write_cache_dir.argument());
+ qa::QAEnvironment env(dir.dirname(), QualudisCommandLine::get_instance()->a_write_cache_dir.argument(),
+ QualudisCommandLine::get_instance()->a_master_repository_dir.argument());
return do_check_category_dir(dir, env);
}
@@ -650,6 +655,9 @@ int main(int argc, char *argv[])
if (! QualudisCommandLine::get_instance()->a_write_cache_dir.specified())
QualudisCommandLine::get_instance()->a_write_cache_dir.set_argument("/var/empty");
+ if (! QualudisCommandLine::get_instance()->a_master_repository_dir.specified())
+ QualudisCommandLine::get_instance()->a_master_repository_dir.set_argument("/var/empty");
+
if (! QualudisCommandLine::get_instance()->empty())
{
QualudisCommandLine *c1 = QualudisCommandLine::get_instance();
diff --git a/src/clients/qualudis/qualudis_command_line.cc b/src/clients/qualudis/qualudis_command_line.cc
index ff89e8a..9a1a14d 100644
--- a/src/clients/qualudis/qualudis_command_line.cc
+++ b/src/clients/qualudis/qualudis_command_line.cc
@@ -1,7 +1,7 @@
/* vim: set sw=4 sts=4 et foldmethod=syntax : */
/*
- * Copyright (c) 2006 Ciaran McCreesh <ciaranm@ciaranm.org>
+ * Copyright (c) 2006, 2007 Ciaran McCreesh <ciaranm@ciaranm.org>
*
* 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
@@ -53,7 +53,9 @@ QualudisCommandLine::QualudisCommandLine() :
configuration_options(this, "Configuration options",
"Options that control general configuration."),
a_write_cache_dir(&configuration_options, "write-cache-dir", '\0',
- "Use a subdirectory named for the repository name under the specified directory for repository write cache")
+ "Use a subdirectory named for the repository name under the specified directory for repository write cache"),
+ a_master_repository_dir(&configuration_options, "master-repository-dir", '\0',
+ "Use the specified location for the master repository")
{
add_usage_line("[ options ] [ directories ... ]");
add_environment_variable("QUALUDIS_OPTIONS", "Default command-line options.");
diff --git a/src/clients/qualudis/qualudis_command_line.hh b/src/clients/qualudis/qualudis_command_line.hh
index 6689c2f..9a9bfcd 100644
--- a/src/clients/qualudis/qualudis_command_line.hh
+++ b/src/clients/qualudis/qualudis_command_line.hh
@@ -88,6 +88,7 @@ class QualudisCommandLine :
paludis::args::ArgsGroup configuration_options;
paludis::args::StringArg a_write_cache_dir;
+ paludis::args::StringArg a_master_repository_dir;
///\}
};