aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2007-03-10 18:15:17 +0000
committerAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2007-03-10 18:15:17 +0000
commit8ef7dcab980a216973ab3d8eb59103c771dd387c (patch)
tree5425db691d82ade91155a8cb11a85587021345e6
parent586f2efe31338d3734fd7359e346eaf6b2514f0e (diff)
downloadpaludis-8ef7dcab980a216973ab3d8eb59103c771dd387c.tar.gz
paludis-8ef7dcab980a216973ab3d8eb59103c771dd387c.tar.xz
Change repository order handling
-rw-r--r--paludis/dep_list/dep_list_TEST.cc32
-rw-r--r--paludis/dep_list/dep_list_TEST.hh8
-rw-r--r--paludis/dep_list/uninstall_list_TEST.cc4
-rw-r--r--paludis/environments/no_config/no_config_environment.cc10
-rw-r--r--paludis/environments/paludis/paludis_environment.cc2
-rw-r--r--paludis/environments/paludis/paludis_environment_TEST.cc25
-rwxr-xr-xpaludis/environments/paludis/paludis_environment_TEST_setup.sh75
-rw-r--r--paludis/environments/portage/portage_environment.cc8
-rw-r--r--paludis/package_database.cc47
-rw-r--r--paludis/package_database.hh2
-rw-r--r--paludis/package_database_TEST.cc23
-rw-r--r--paludis/repository_name_cache_TEST.cc14
-rw-r--r--src/clients/adjutrix/display_default_system_resolution.cc2
-rw-r--r--src/clients/adjutrix/what_needs_keywording.cc2
14 files changed, 181 insertions, 73 deletions
diff --git a/paludis/dep_list/dep_list_TEST.cc b/paludis/dep_list/dep_list_TEST.cc
index f48d2d8..69f420c 100644
--- a/paludis/dep_list/dep_list_TEST.cc
+++ b/paludis/dep_list/dep_list_TEST.cc
@@ -1255,10 +1255,10 @@ namespace test_cases
{
TestEnvironment env;
std::tr1::shared_ptr<FakeRepository> repo(new FakeRepository(&env, RepositoryName("repo")));
- env.package_database()->add_repository(repo);
+ env.package_database()->add_repository(1, repo);
std::tr1::shared_ptr<FakeInstalledRepository> destination_repo(new FakeInstalledRepository(&env,
RepositoryName("installed_repo")));
- env.package_database()->add_repository(destination_repo);
+ env.package_database()->add_repository(2, destination_repo);
repo->add_version("cat", "one", "1")->deps_interface->build_depend_string = "cat/two cat/three";
repo->add_version("cat", "two", "1")->deps_interface->build_depend_string = "cat/four";
@@ -1292,10 +1292,10 @@ namespace test_cases
{
TestEnvironment env;
std::tr1::shared_ptr<FakeRepository> repo(new FakeRepository(&env, RepositoryName("repo")));
- env.package_database()->add_repository(repo);
+ env.package_database()->add_repository(1, repo);
std::tr1::shared_ptr<FakeInstalledRepository> destination_repo(new FakeInstalledRepository(&env,
RepositoryName("installed_repo")));
- env.package_database()->add_repository(destination_repo);
+ env.package_database()->add_repository(2, destination_repo);
repo->add_version("cat", "one", "1")->deps_interface->build_depend_string = "cat/two cat/three";
repo->add_version("cat", "two", "1")->deps_interface->build_depend_string = "cat/four";
@@ -1330,12 +1330,12 @@ namespace test_cases
TestEnvironment env;
std::tr1::shared_ptr<FakeRepository> repo(new FakeRepository(&env, RepositoryName("repo")));
- env.package_database()->add_repository(repo);
+ env.package_database()->add_repository(1, repo);
repo->add_version("cat", "one", "1");
std::tr1::shared_ptr<FakeInstalledRepository> installed_repo(
new FakeInstalledRepository(&env, RepositoryName("installed_repo")));
- env.package_database()->add_repository(installed_repo);
+ env.package_database()->add_repository(2, installed_repo);
installed_repo->add_version("cat", "one", "2");
DepList d(&env, DepListOptions());
@@ -1356,12 +1356,12 @@ namespace test_cases
TestEnvironment env;
std::tr1::shared_ptr<FakeRepository> repo(new FakeRepository(&env, RepositoryName("repo")));
- env.package_database()->add_repository(repo);
+ env.package_database()->add_repository(1, repo);
repo->add_version("cat", "one", "1")->deps_interface->build_depend_string = "cat/two";
std::tr1::shared_ptr<FakeInstalledRepository> installed_repo(
new FakeInstalledRepository(&env, RepositoryName("installed_repo")));
- env.package_database()->add_repository(installed_repo);
+ env.package_database()->add_repository(2, installed_repo);
installed_repo->add_version("cat", "two", "2");
DepList d(&env, DepListOptions());
@@ -1382,12 +1382,12 @@ namespace test_cases
TestEnvironment env;
std::tr1::shared_ptr<FakeRepository> repo(new FakeRepository(&env, RepositoryName("repo")));
- env.package_database()->add_repository(repo);
+ env.package_database()->add_repository(1, repo);
repo->add_version("cat", "one", "1")->deps_interface->build_depend_string = "cat/two";
std::tr1::shared_ptr<FakeInstalledRepository> installed_repo(
new FakeInstalledRepository(&env, RepositoryName("installed_repo")));
- env.package_database()->add_repository(installed_repo);
+ env.package_database()->add_repository(2, installed_repo);
installed_repo->add_version("cat", "two", "2");
DepList d(&env, DepListOptions());
@@ -1410,12 +1410,12 @@ namespace test_cases
TestEnvironment env;
std::tr1::shared_ptr<FakeRepository> repo(new FakeRepository(&env, RepositoryName("repo")));
- env.package_database()->add_repository(repo);
+ env.package_database()->add_repository(1, repo);
repo->add_version("cat", "one", "1")->deps_interface->build_depend_string = "cat/two";
std::tr1::shared_ptr<FakeInstalledRepository> installed_repo(
new FakeInstalledRepository(&env, RepositoryName("installed_repo")));
- env.package_database()->add_repository(installed_repo);
+ env.package_database()->add_repository(2, installed_repo);
installed_repo->add_version("cat", "two", "2");
installed_repo->add_version("cat", "three", "3");
@@ -1451,13 +1451,13 @@ namespace test_cases
TestEnvironment env;
std::tr1::shared_ptr<FakeRepository> repo(new FakeRepository(&env, RepositoryName("repo")));
- env.package_database()->add_repository(repo);
+ env.package_database()->add_repository(1, repo);
repo->add_version("cat", "one", "1")->deps_interface->build_depend_string = "cat/two";
repo->add_version("cat", "two", "2");
std::tr1::shared_ptr<FakeInstalledRepository> installed_repo(
new FakeInstalledRepository(&env, RepositoryName("installed_repo")));
- env.package_database()->add_repository(installed_repo);
+ env.package_database()->add_repository(2, installed_repo);
installed_repo->add_version("cat", "two", "0");
DepList d1(&env, DepListOptions());
@@ -1484,7 +1484,7 @@ namespace test_cases
TestEnvironment env;
std::tr1::shared_ptr<FakeRepository> repo(new FakeRepository(&env, RepositoryName("repo")));
- env.package_database()->add_repository(repo);
+ env.package_database()->add_repository(1, repo);
repo->add_version("cat", "zero", "1")->deps_interface->build_depend_string =
"( cat/one cat/two cat/three-live cat/four-cvs cat/five-svn cat/six-darcs )";
repo->add_version("cat", "one", "scm");
@@ -1496,7 +1496,7 @@ namespace test_cases
std::tr1::shared_ptr<FakeInstalledRepository> installed_repo(
new FakeInstalledRepository(&env, RepositoryName("installed_repo")));
- env.package_database()->add_repository(installed_repo);
+ env.package_database()->add_repository(2, installed_repo);
installed_repo->add_version("cat", "one", "scm");
installed_repo->add_version("cat", "two", "2");
installed_repo->add_version("cat", "three-live", "0");
diff --git a/paludis/dep_list/dep_list_TEST.hh b/paludis/dep_list/dep_list_TEST.hh
index 5a7b8f9..b3ad740 100644
--- a/paludis/dep_list/dep_list_TEST.hh
+++ b/paludis/dep_list/dep_list_TEST.hh
@@ -104,10 +104,10 @@ namespace test_cases
installed_virtuals_repo(new InstalledVirtualsRepository(&env, FSEntry("/"))),
done_populate(false)
{
- env.package_database()->add_repository(repo);
- env.package_database()->add_repository(installed_repo);
- env.package_database()->add_repository(virtuals_repo);
- env.package_database()->add_repository(installed_virtuals_repo);
+ env.package_database()->add_repository(4, repo);
+ env.package_database()->add_repository(3, installed_repo);
+ env.package_database()->add_repository(2, virtuals_repo);
+ env.package_database()->add_repository(1, installed_virtuals_repo);
}
/**
diff --git a/paludis/dep_list/uninstall_list_TEST.cc b/paludis/dep_list/uninstall_list_TEST.cc
index c2f0d5c..c00011f 100644
--- a/paludis/dep_list/uninstall_list_TEST.cc
+++ b/paludis/dep_list/uninstall_list_TEST.cc
@@ -71,8 +71,8 @@ namespace test_cases
targets(new PackageDatabaseEntryCollection::Concrete),
done_populate(false)
{
- env.package_database()->add_repository(installed_repo);
- env.package_database()->add_repository(virtuals_repo);
+ env.package_database()->add_repository(2, installed_repo);
+ env.package_database()->add_repository(1, virtuals_repo);
}
/**
diff --git a/paludis/environments/no_config/no_config_environment.cc b/paludis/environments/no_config/no_config_environment.cc
index 93d0593..a114990 100644
--- a/paludis/environments/no_config/no_config_environment.cc
+++ b/paludis/environments/no_config/no_config_environment.cc
@@ -131,7 +131,7 @@ Implementation<NoConfigEnvironment>::Implementation(
keys->insert("write_cache", stringify(params.write_cache));
keys->insert("names_cache", "/var/empty");
- env->package_database()->add_repository(((master_repo =
+ env->package_database()->add_repository(1, ((master_repo =
std::tr1::static_pointer_cast<PortageRepository>(
RepositoryMaker::get_instance()->find_maker("ebuild")(env, keys)))));
}
@@ -147,10 +147,10 @@ Implementation<NoConfigEnvironment>::Implementation(
if (FSEntry("/var/empty") != params.master_repository_dir)
keys->insert("master_repository", stringify(master_repo->name()));
- env->package_database()->add_repository(((portage_repo =
+ env->package_database()->add_repository(2, ((portage_repo =
std::tr1::static_pointer_cast<PortageRepository>(
RepositoryMaker::get_instance()->find_maker("ebuild")(env, keys)))));
- env->package_database()->add_repository(RepositoryMaker::get_instance()->find_maker("virtuals")(env,
+ env->package_database()->add_repository(-2, RepositoryMaker::get_instance()->find_maker("virtuals")(env,
std::tr1::shared_ptr<AssociativeCollection<std::string, std::string> >()));
}
else
@@ -165,12 +165,12 @@ Implementation<NoConfigEnvironment>::Implementation(
keys->insert("provides_cache", "/var/empty");
keys->insert("location", stringify(top_level_dir));
- env->package_database()->add_repository(RepositoryMaker::get_instance()->find_maker("vdb")(env, keys));
+ env->package_database()->add_repository(1, RepositoryMaker::get_instance()->find_maker("vdb")(env, keys));
std::tr1::shared_ptr<AssociativeCollection<std::string, std::string> > iv_keys(
new AssociativeCollection<std::string, std::string>::Concrete);
iv_keys->insert("root", "/");
- env->package_database()->add_repository(RepositoryMaker::get_instance()->find_maker("installed_virtuals")(env,
+ env->package_database()->add_repository(-2, RepositoryMaker::get_instance()->find_maker("installed_virtuals")(env,
iv_keys));
}
}
diff --git a/paludis/environments/paludis/paludis_environment.cc b/paludis/environments/paludis/paludis_environment.cc
index 26b0db8..608b495 100644
--- a/paludis/environments/paludis/paludis_environment.cc
+++ b/paludis/environments/paludis/paludis_environment.cc
@@ -88,7 +88,7 @@ PaludisEnvironment::PaludisEnvironment(const std::string & s) :
+ stringify(r->importance) + "', keys " + keys);
}
- package_database()->add_repository(
+ package_database()->add_repository(r->importance,
RepositoryMaker::get_instance()->find_maker(r->format)(this, r->keys));
}
}
diff --git a/paludis/environments/paludis/paludis_environment_TEST.cc b/paludis/environments/paludis/paludis_environment_TEST.cc
index bede2e1..b242dd2 100644
--- a/paludis/environments/paludis/paludis_environment_TEST.cc
+++ b/paludis/environments/paludis/paludis_environment_TEST.cc
@@ -121,5 +121,30 @@ namespace test_cases
TEST_CHECK(env->query_use(UseFlagName("third_exp_two"), &f));
}
} paludis_environment_use_test_minus_star_partial;
+
+ struct TestPaludisEnvironmentRepositories : TestCase
+ {
+ TestPaludisEnvironmentRepositories() : TestCase("repositories") { }
+
+ void run()
+ {
+ setenv("PALUDIS_HOME", stringify(FSEntry::cwd() / "paludis_environment_TEST_dir" / "home4").c_str(), 1);
+ unsetenv("PALUDIS_SKIP_CONFIG");
+
+ std::tr1::shared_ptr<Environment> env(new PaludisEnvironment(""));
+
+ TEST_CHECK(env->package_database()->fetch_repository(RepositoryName("first")));
+ TEST_CHECK(env->package_database()->fetch_repository(RepositoryName("second")));
+ TEST_CHECK(env->package_database()->fetch_repository(RepositoryName("third")));
+ TEST_CHECK(env->package_database()->fetch_repository(RepositoryName("fourth")));
+ TEST_CHECK(env->package_database()->fetch_repository(RepositoryName("fifth")));
+
+ TEST_CHECK(env->package_database()->more_important_than(RepositoryName("first"), RepositoryName("second")));
+ TEST_CHECK(env->package_database()->more_important_than(RepositoryName("second"), RepositoryName("third")));
+ TEST_CHECK(env->package_database()->more_important_than(RepositoryName("fourth"), RepositoryName("third")));
+ TEST_CHECK(env->package_database()->more_important_than(RepositoryName("fourth"), RepositoryName("fifth")));
+ TEST_CHECK(env->package_database()->more_important_than(RepositoryName("second"), RepositoryName("fifth")));
+ }
+ } paludis_environment_repositories;
}
diff --git a/paludis/environments/paludis/paludis_environment_TEST_setup.sh b/paludis/environments/paludis/paludis_environment_TEST_setup.sh
index 9ebe187..9f76c89 100755
--- a/paludis/environments/paludis/paludis_environment_TEST_setup.sh
+++ b/paludis/environments/paludis/paludis_environment_TEST_setup.sh
@@ -20,6 +20,27 @@ MORE_EXP="one"
THIRD_EXP="one"
END
+mkdir -p firstrepo/profiles
+cat <<END > firstrepo/profiles/repo_name
+first
+END
+mkdir -p secondrepo/profiles
+cat <<END > secondrepo/profiles/repo_name
+second
+END
+mkdir -p thirdrepo/profiles
+cat <<END > thirdrepo/profiles/repo_name
+third
+END
+mkdir -p fourthrepo/profiles
+cat <<END > fourthrepo/profiles/repo_name
+fourth
+END
+mkdir -p fifthrepo/profiles
+cat <<END > fifthrepo/profiles/repo_name
+fifth
+END
+
mkdir -p home1/.paludis/repositories
cat <<END > home1/.paludis/use.conf
* foo bar baz -fnord
@@ -80,4 +101,58 @@ profiles = `pwd`/repo/profile
cache = /var/empty
END
+mkdir -p home4/.paludis/repositories
+cat <<END > home4/.paludis/use.conf
+* foo
+END
+cat <<END > home4/.paludis/keywords.conf
+* keyword
+END
+cat <<END > home4/.paludis/licenses.conf
+* *
+END
+cat <<END > home4/.paludis/repositories/first.conf
+format = ebuild
+names_cache = /var/empty
+location = `pwd`/firstrepo
+profiles = `pwd`/repo/profile
+cache = /var/empty
+master_repository = second
+importance = 20
+END
+cat <<END > home4/.paludis/repositories/second.conf
+format = ebuild
+names_cache = /var/empty
+location = `pwd`/secondrepo
+profiles = `pwd`/repo/profile
+cache = /var/empty
+importance = 10
+END
+cat <<END > home4/.paludis/repositories/third.conf
+format = ebuild
+names_cache = /var/empty
+location = `pwd`/thirdrepo
+profiles = `pwd`/repo/profile
+cache = /var/empty
+master_repository = second
+importance = 8
+END
+cat <<END > home4/.paludis/repositories/fourth.conf
+format = ebuild
+names_cache = /var/empty
+location = `pwd`/fourthrepo
+profiles = `pwd`/repo/profile
+cache = /var/empty
+importance = 12
+END
+cat <<END > home4/.paludis/repositories/fifth.conf
+format = ebuild
+names_cache = /var/empty
+location = `pwd`/fifthrepo
+profiles = `pwd`/repo/profile
+cache = /var/empty
+master_repository = second
+importance = 5
+END
+
diff --git a/paludis/environments/portage/portage_environment.cc b/paludis/environments/portage/portage_environment.cc
index 23127ea..9d01a3c 100644
--- a/paludis/environments/portage/portage_environment.cc
+++ b/paludis/environments/portage/portage_environment.cc
@@ -244,7 +244,7 @@ PortageEnvironment::_add_virtuals_repository()
{
std::tr1::shared_ptr<AssociativeCollection<std::string, std::string> > keys(
new AssociativeCollection<std::string, std::string>::Concrete);
- package_database()->add_repository(
+ package_database()->add_repository(-2,
RepositoryMaker::get_instance()->find_maker("virtuals")(this, keys));
}
@@ -254,7 +254,7 @@ PortageEnvironment::_add_installed_virtuals_repository()
std::tr1::shared_ptr<AssociativeCollection<std::string, std::string> > keys(
new AssociativeCollection<std::string, std::string>::Concrete);
keys->insert("root", stringify(root()));
- package_database()->add_repository(
+ package_database()->add_repository(-1,
RepositoryMaker::get_instance()->find_maker("installed_virtuals")(this, keys));
}
@@ -271,7 +271,7 @@ PortageEnvironment::_add_portdir_repository(const FSEntry & portdir)
((_imp->conf_dir / "portage" / "profile").is_directory() ? stringify(_imp->conf_dir / "portage" / "profile") : ""));
keys->insert("format", "ebuild");
keys->insert("names_cache", "/var/empty");
- package_database()->add_repository(
+ package_database()->add_repository(2,
RepositoryMaker::get_instance()->find_maker("ebuild")(this, keys));
}
@@ -287,7 +287,7 @@ PortageEnvironment::_add_vdb_repository()
keys->insert("format", "vdb");
keys->insert("names_cache", "/var/empty");
keys->insert("provides_cache", "/var/empty");
- package_database()->add_repository(
+ package_database()->add_repository(1,
RepositoryMaker::get_instance()->find_maker("vdb")(this, keys));
}
diff --git a/paludis/package_database.cc b/paludis/package_database.cc
index 26ff3f8..75c3d6b 100644
--- a/paludis/package_database.cc
+++ b/paludis/package_database.cc
@@ -143,6 +143,11 @@ namespace paludis
*/
std::list<std::tr1::shared_ptr<Repository> > repositories;
+ /**
+ * Repository importances.
+ */
+ std::multimap<int, std::list<std::tr1::shared_ptr<Repository> >::iterator> repository_importances;
+
/// Our environment.
const Environment * environment;
};
@@ -159,18 +164,26 @@ PackageDatabase::~PackageDatabase()
}
void
-PackageDatabase::add_repository(const std::tr1::shared_ptr<Repository> r)
+PackageDatabase::add_repository(int i, const std::tr1::shared_ptr<Repository> r)
{
Context c("When adding a repository named '" + stringify(r->name()) + "':");
- IndirectIterator<std::list<std::tr1::shared_ptr<Repository> >::const_iterator, const Repository>
- r_c(_imp->repositories.begin()),
- r_end(_imp->repositories.end());
- for ( ; r_c != r_end ; ++r_c)
+ for (IndirectIterator<RepositoryIterator> r_c(begin_repositories()), r_end(end_repositories()) ;
+ r_c != r_end ; ++r_c)
if (r_c->name() == r->name())
throw DuplicateRepositoryError(stringify(r->name()));
- _imp->repositories.push_back(r);
+ std::list<std::tr1::shared_ptr<Repository> >::iterator q(_imp->repositories.end());
+ for (std::multimap<int, std::list<std::tr1::shared_ptr<Repository> >::iterator>::iterator
+ p(_imp->repository_importances.begin()), p_end(_imp->repository_importances.end()) ;
+ p != p_end ; ++p)
+ if (p->first > i)
+ {
+ q = p->second;
+ break;
+ }
+
+ _imp->repository_importances.insert(std::make_pair(i, _imp->repositories.insert(q, r)));
}
QualifiedPackageName
@@ -181,10 +194,8 @@ PackageDatabase::fetch_unique_qualified_package_name(
std::tr1::shared_ptr<QualifiedPackageNameCollection> result(new QualifiedPackageNameCollection::Concrete);
- IndirectIterator<std::list<std::tr1::shared_ptr<Repository> >::const_iterator, const Repository>
- r(_imp->repositories.begin()),
- r_end(_imp->repositories.end());
- for ( ; r != r_end ; ++r)
+ for (IndirectIterator<RepositoryIterator> r(begin_repositories()), r_end(end_repositories()) ;
+ r != r_end ; ++r)
{
Context local_context("When looking in repository '" + stringify(r->name()) + "':");
@@ -239,7 +250,7 @@ PackageDatabase::query(const Query & q, const QueryOrder query_order) const
if (! repos)
{
repos.reset(new RepositoryNameCollection::Concrete);
- for (RepositoryIterator r(_imp->repositories.begin()), r_end(_imp->repositories.end()) ;
+ for (RepositoryIterator r(begin_repositories()), r_end(end_repositories()) ;
r != r_end ; ++r)
repos->push_back((*r)->name());
}
@@ -330,10 +341,8 @@ PackageDatabase::query(const Query & q, const QueryOrder query_order) const
std::tr1::shared_ptr<const Repository>
PackageDatabase::fetch_repository(const RepositoryName & n) const
{
- std::list<std::tr1::shared_ptr<Repository> >::const_iterator
- r(_imp->repositories.begin()),
- r_end(_imp->repositories.end());
- for ( ; r != r_end ; ++r)
+ for (RepositoryIterator r(begin_repositories()), r_end(end_repositories()) ;
+ r != r_end ; ++r)
if ((*r)->name() == n)
return *r;
@@ -343,10 +352,8 @@ PackageDatabase::fetch_repository(const RepositoryName & n) const
std::tr1::shared_ptr<Repository>
PackageDatabase::fetch_repository(const RepositoryName & n)
{
- std::list<std::tr1::shared_ptr<Repository> >::const_iterator
- r(_imp->repositories.begin()),
- r_end(_imp->repositories.end());
- for ( ; r != r_end ; ++r)
+ for (RepositoryIterator r(begin_repositories()), r_end(end_repositories()) ;
+ r != r_end ; ++r)
if ((*r)->name() == n)
return *r;
@@ -356,7 +363,7 @@ PackageDatabase::fetch_repository(const RepositoryName & n)
RepositoryName
PackageDatabase::favourite_repository() const
{
- for (RepositoryIterator r(_imp->repositories.begin()), r_end(_imp->repositories.end()) ;
+ for (RepositoryIterator r(begin_repositories()), r_end(end_repositories()) ;
r != r_end ; ++r)
if ((*r)->can_be_favourite_repository())
return (*r)->name();
diff --git a/paludis/package_database.hh b/paludis/package_database.hh
index 820a1ed..28828b8 100644
--- a/paludis/package_database.hh
+++ b/paludis/package_database.hh
@@ -255,7 +255,7 @@ namespace paludis
* same name as the new Repository already exists in our
* collection.
*/
- void add_repository(std::tr1::shared_ptr<Repository>);
+ void add_repository(int importance, const std::tr1::shared_ptr<Repository>);
/**
* Fetch a named repository.
diff --git a/paludis/package_database_TEST.cc b/paludis/package_database_TEST.cc
index ea446bc..1b35fe0 100644
--- a/paludis/package_database_TEST.cc
+++ b/paludis/package_database_TEST.cc
@@ -52,15 +52,15 @@ namespace test_cases
TEST_CHECK_THROWS(p.fetch_repository(RepositoryName("repo1")), NoSuchRepositoryError);
TEST_CHECK_THROWS(p.fetch_repository(RepositoryName("repo2")), NoSuchRepositoryError);
- p.add_repository(r1);
+ p.add_repository(10, r1);
TEST_CHECK(p.fetch_repository(RepositoryName("repo1")));
TEST_CHECK_EQUAL(p.fetch_repository(RepositoryName("repo1"))->name(),
RepositoryName("repo1"));
TEST_CHECK_THROWS(p.fetch_repository(RepositoryName("repo2")), NoSuchRepositoryError);
- TEST_CHECK_THROWS(p.add_repository(r1), DuplicateRepositoryError);
+ TEST_CHECK_THROWS(p.add_repository(10, r1), DuplicateRepositoryError);
- p.add_repository(r2);
+ p.add_repository(11, r2);
TEST_CHECK(p.fetch_repository(RepositoryName("repo1")));
TEST_CHECK_EQUAL(p.fetch_repository(RepositoryName("repo1"))->name(),
RepositoryName("repo1"));
@@ -68,8 +68,8 @@ namespace test_cases
TEST_CHECK_EQUAL(p.fetch_repository(RepositoryName("repo2"))->name(),
RepositoryName("repo2"));
- TEST_CHECK_THROWS(p.add_repository(r1), DuplicateRepositoryError);
- TEST_CHECK_THROWS(p.add_repository(r2), DuplicateRepositoryError);
+ TEST_CHECK_THROWS(p.add_repository(10, r1), DuplicateRepositoryError);
+ TEST_CHECK_THROWS(p.add_repository(5, r2), DuplicateRepositoryError);
TEST_CHECK(p.fetch_repository(RepositoryName("repo1")));
TEST_CHECK_EQUAL(p.fetch_repository(RepositoryName("repo1"))->name(),
@@ -104,13 +104,13 @@ namespace test_cases
r1->add_version("r1c1", "r1c1p2", "2");
r1->add_version("rac1", "rac1pa", "1");
r1->add_version("rac1", "rac1pa", "2");
- p.add_repository(r1);
+ p.add_repository(11, r1);
TEST_CHECK(true);
std::tr1::shared_ptr<FakeRepository> r2(new FakeRepository(&e, RepositoryName("repo2")));
r2->add_version("rac1", "rac1pa", "1");
r2->add_version("rac1", "rac1pa", "3");
- p.add_repository(r2);
+ p.add_repository(10, r2);
TEST_CHECK(true);
PackageDepSpec d1("r1c1/r1c1p1");
@@ -169,13 +169,13 @@ namespace test_cases
r1->add_version("cat", "pkg", "2")->slot = SlotName("c");
r1->add_version("cat", "pkg", "3")->slot = SlotName("c");
r1->add_version("cat", "pkg", "4")->slot = SlotName("a");
- p.add_repository(r1);
+ p.add_repository(10, r1);
TEST_CHECK(true);
std::tr1::shared_ptr<FakeRepository> r2(new FakeRepository(&e, RepositoryName("repo2")));
r2->add_version("cat", "pkg", "1")->slot = SlotName("a");
r2->add_version("cat", "pkg", "3")->slot = SlotName("b");
- p.add_repository(r2);
+ p.add_repository(10, r2);
TEST_CHECK(true);
PackageDepSpec d("cat/pkg");
@@ -208,13 +208,13 @@ namespace test_cases
r1->add_package(CategoryNamePart("cat-one") + PackageNamePart("pkg-two"));
r1->add_package(CategoryNamePart("cat-two") + PackageNamePart("pkg-two"));
r1->add_package(CategoryNamePart("cat-two") + PackageNamePart("pkg-three"));
- p.add_repository(r1);
+ p.add_repository(10, r1);
TEST_CHECK(true);
std::tr1::shared_ptr<FakeRepository> r2(new FakeRepository(&e, RepositoryName("repo2")));
r1->add_package(CategoryNamePart("cat-three") + PackageNamePart("pkg-three"));
r1->add_package(CategoryNamePart("cat-three") + PackageNamePart("pkg-four"));
- p.add_repository(r2);
+ p.add_repository(10, r2);
TEST_CHECK(true);
TEST_CHECK_STRINGIFY_EQUAL(p.fetch_unique_qualified_package_name(PackageNamePart("pkg-one")),
@@ -232,3 +232,4 @@ namespace test_cases
}
} package_database_disambiguate_test;
}
+
diff --git a/paludis/repository_name_cache_TEST.cc b/paludis/repository_name_cache_TEST.cc
index 5d82774..4faa0c9 100644
--- a/paludis/repository_name_cache_TEST.cc
+++ b/paludis/repository_name_cache_TEST.cc
@@ -38,7 +38,7 @@ namespace test_cases
{
TestEnvironment env;
std::tr1::shared_ptr<FakeRepository> repo(new FakeRepository(&env, RepositoryName("repo")));
- env.package_database()->add_repository(repo);
+ env.package_database()->add_repository(10, repo);
RepositoryNameCache cache(FSEntry("/var/empty"), repo.get());
TEST_CHECK(! cache.usable());
@@ -53,7 +53,7 @@ namespace test_cases
{
TestEnvironment env;
std::tr1::shared_ptr<FakeRepository> repo(new FakeRepository(&env, RepositoryName("repo")));
- env.package_database()->add_repository(repo);
+ env.package_database()->add_repository(10, repo);
RepositoryNameCache cache(FSEntry("repository_name_cache_TEST_dir/not_generated"), repo.get());
TEST_CHECK(cache.usable());
@@ -70,7 +70,7 @@ namespace test_cases
{
TestEnvironment env;
std::tr1::shared_ptr<FakeRepository> repo(new FakeRepository(&env, RepositoryName("repo")));
- env.package_database()->add_repository(repo);
+ env.package_database()->add_repository(10, repo);
RepositoryNameCache cache(FSEntry("repository_name_cache_TEST_dir/not_existing"), repo.get());
TEST_CHECK(cache.usable());
@@ -87,7 +87,7 @@ namespace test_cases
{
TestEnvironment env;
std::tr1::shared_ptr<FakeRepository> repo(new FakeRepository(&env, RepositoryName("repo")));
- env.package_database()->add_repository(repo);
+ env.package_database()->add_repository(10, repo);
RepositoryNameCache cache(FSEntry("repository_name_cache_TEST_dir/old_format"), repo.get());
TEST_CHECK(cache.usable());
@@ -104,7 +104,7 @@ namespace test_cases
{
TestEnvironment env;
std::tr1::shared_ptr<FakeRepository> repo(new FakeRepository(&env, RepositoryName("repo")));
- env.package_database()->add_repository(repo);
+ env.package_database()->add_repository(10, repo);
RepositoryNameCache cache(FSEntry("repository_name_cache_TEST_dir/bad_repo"), repo.get());
TEST_CHECK(cache.usable());
@@ -121,7 +121,7 @@ namespace test_cases
{
TestEnvironment env;
std::tr1::shared_ptr<FakeRepository> repo(new FakeRepository(&env, RepositoryName("repo")));
- env.package_database()->add_repository(repo);
+ env.package_database()->add_repository(10, repo);
RepositoryNameCache cache(FSEntry("repository_name_cache_TEST_dir/good_repo"), repo.get());
TEST_CHECK(cache.usable());
@@ -146,7 +146,7 @@ namespace test_cases
{
TestEnvironment env;
std::tr1::shared_ptr<FakeRepository> repo(new FakeRepository(&env, RepositoryName("repo")));
- env.package_database()->add_repository(repo);
+ env.package_database()->add_repository(10, repo);
RepositoryNameCache cache(FSEntry("repository_name_cache_TEST_dir/generated"), repo.get());
repo->add_package(QualifiedPackageName("bar/foo"));
diff --git a/src/clients/adjutrix/display_default_system_resolution.cc b/src/clients/adjutrix/display_default_system_resolution.cc
index e35a669..afbeb4f 100644
--- a/src/clients/adjutrix/display_default_system_resolution.cc
+++ b/src/clients/adjutrix/display_default_system_resolution.cc
@@ -117,7 +117,7 @@ int do_display_default_system_resolution(NoConfigEnvironment & env)
{
std::tr1::shared_ptr<Repository> fake_destination(new FakeInstalledRepository(&env,
RepositoryName("fake_destination")));
- env.package_database()->add_repository(fake_destination);
+ env.package_database()->add_repository(1, fake_destination);
}
if (CommandLine::get_instance()->a_profile.begin_args() ==
diff --git a/src/clients/adjutrix/what_needs_keywording.cc b/src/clients/adjutrix/what_needs_keywording.cc
index 98356ca..2e0a45f 100644
--- a/src/clients/adjutrix/what_needs_keywording.cc
+++ b/src/clients/adjutrix/what_needs_keywording.cc
@@ -49,7 +49,7 @@ int do_what_needs_keywording(NoConfigEnvironment & env)
{
std::tr1::shared_ptr<Repository> fake_destination(new FakeInstalledRepository(&env,
RepositoryName("fake_destination")));
- env.package_database()->add_repository(fake_destination);
+ env.package_database()->add_repository(1, fake_destination);
}
KeywordName target_keyword(*CommandLine::get_instance()->begin_parameters());