aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2007-01-13 15:10:55 +0000
committerAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2007-01-13 15:10:55 +0000
commit93212aae445aa064c699990acb49b71ca64aeaaa (patch)
treebd52c32ac7995b09437cd2e71c403ab6d403c36c
parent0f5cf7d52720338f0903ff4e865cc9b75b1952b9 (diff)
downloadpaludis-93212aae445aa064c699990acb49b71ca64aeaaa.tar.gz
paludis-93212aae445aa064c699990acb49b71ca64aeaaa.tar.xz
Make invalidate non-const so that it is easier to implement. Stop passing around package databases when we also have an environment.
-rw-r--r--paludis/environment/default/default_environment.cc3
-rw-r--r--paludis/environment/no_config/no_config_environment.cc12
-rw-r--r--paludis/repositories/cran/cran_installed_repository.cc23
-rw-r--r--paludis/repositories/cran/cran_installed_repository.hh5
-rw-r--r--paludis/repositories/cran/cran_installed_repository.sr1
-rw-r--r--paludis/repositories/cran/cran_repository.cc28
-rw-r--r--paludis/repositories/cran/cran_repository.hh5
-rw-r--r--paludis/repositories/cran/cran_repository.sr1
-rw-r--r--paludis/repositories/cran/cran_repository_TEST.cc4
-rw-r--r--paludis/repositories/fake/fake_repository_base.cc4
-rw-r--r--paludis/repositories/fake/fake_repository_base.hh4
-rw-r--r--paludis/repositories/gems/gems_repository.cc5
-rw-r--r--paludis/repositories/gems/gems_repository.hh2
-rw-r--r--paludis/repositories/gems/gems_repository.sr1
-rw-r--r--paludis/repositories/gems/gems_repository_TEST.cc4
-rw-r--r--paludis/repositories/gems/make_gems_repository.cc6
-rw-r--r--paludis/repositories/gems/make_gems_repository.hh5
-rw-r--r--paludis/repositories/nothing/nothing_repository.cc7
-rw-r--r--paludis/repositories/nothing/nothing_repository.hh7
-rw-r--r--paludis/repositories/portage/make_ebuild_repository.cc11
-rw-r--r--paludis/repositories/portage/make_ebuild_repository.hh9
-rw-r--r--paludis/repositories/portage/portage_repository.cc26
-rw-r--r--paludis/repositories/portage/portage_repository.hh4
-rw-r--r--paludis/repositories/portage/portage_repository_TEST.cc36
-rw-r--r--paludis/repositories/portage/portage_repository_params.sr3
-rw-r--r--paludis/repositories/repository_maker.hh4
-rw-r--r--paludis/repositories/vdb/vdb_repository.cc15
-rw-r--r--paludis/repositories/vdb/vdb_repository.hh7
-rw-r--r--paludis/repositories/vdb/vdb_repository.sr1
-rw-r--r--paludis/repositories/vdb/vdb_repository_TEST.cc18
-rw-r--r--paludis/repositories/virtuals/installed_virtuals_repository.cc10
-rw-r--r--paludis/repositories/virtuals/installed_virtuals_repository.hh7
-rw-r--r--paludis/repositories/virtuals/virtuals_repository.cc12
-rw-r--r--paludis/repositories/virtuals/virtuals_repository.hh7
-rw-r--r--paludis/repository.hh4
-rw-r--r--paludis/tasks/install_task.cc2
36 files changed, 112 insertions, 191 deletions
diff --git a/paludis/environment/default/default_environment.cc b/paludis/environment/default/default_environment.cc
index fb15c07..ea14eea 100644
--- a/paludis/environment/default/default_environment.cc
+++ b/paludis/environment/default/default_environment.cc
@@ -45,8 +45,7 @@ DefaultEnvironment::DefaultEnvironment() :
for (DefaultConfig::RepositoryIterator r(DefaultConfig::get_instance()->begin_repositories()),
r_end(DefaultConfig::get_instance()->end_repositories()) ; r != r_end ; ++r)
package_database()->add_repository(
- RepositoryMaker::get_instance()->find_maker(r->format)(
- this, package_database().raw_pointer(), r->keys));
+ RepositoryMaker::get_instance()->find_maker(r->format)(this, r->keys));
}
DefaultEnvironment::~DefaultEnvironment()
diff --git a/paludis/environment/no_config/no_config_environment.cc b/paludis/environment/no_config/no_config_environment.cc
index 237ed12..4aef99c 100644
--- a/paludis/environment/no_config/no_config_environment.cc
+++ b/paludis/environment/no_config/no_config_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
@@ -128,10 +128,9 @@ Implementation<NoConfigEnvironment>::Implementation(
keys->insert("names_cache", "/var/empty");
env->package_database()->add_repository(((portage_repo =
- RepositoryMaker::get_instance()->find_maker("portage")(env,
- env->package_database().raw_pointer(), keys))));
+ RepositoryMaker::get_instance()->find_maker("portage")(env, keys))));
env->package_database()->add_repository(RepositoryMaker::get_instance()->find_maker("virtuals")(env,
- env->package_database().raw_pointer(), AssociativeCollection<std::string, std::string>::Pointer(0)));
+ AssociativeCollection<std::string, std::string>::Pointer(0)));
}
else
{
@@ -145,10 +144,9 @@ 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,
- env->package_database().raw_pointer(), keys));
+ env->package_database()->add_repository(RepositoryMaker::get_instance()->find_maker("vdb")(env, keys));
env->package_database()->add_repository(RepositoryMaker::get_instance()->find_maker("installed_virtuals")(env,
- env->package_database().raw_pointer(), AssociativeCollection<std::string, std::string>::Pointer(0)));
+ AssociativeCollection<std::string, std::string>::Pointer(0)));
}
}
diff --git a/paludis/repositories/cran/cran_installed_repository.cc b/paludis/repositories/cran/cran_installed_repository.cc
index cb022f3..032eb07 100644
--- a/paludis/repositories/cran/cran_installed_repository.cc
+++ b/paludis/repositories/cran/cran_installed_repository.cc
@@ -53,8 +53,7 @@ namespace paludis
struct Implementation<CRANInstalledRepository> :
InternalCounted<Implementation<CRANInstalledRepository> >
{
- /// Our owning db..
- const PackageDatabase * const db;
+ CRANInstalledRepositoryParams params;
/// Our owning env.
const Environment * const env;
@@ -87,14 +86,11 @@ namespace paludis
/// Destructor.
~Implementation();
-
- /// Invalidate.
- void invalidate() const;
};
}
Implementation<CRANInstalledRepository>::Implementation(const CRANInstalledRepositoryParams & p) :
- db(p.package_database),
+ params(p),
env(p.environment),
location(p.location),
root(p.root),
@@ -171,13 +167,6 @@ Implementation<CRANInstalledRepository>::load_entries() const
}
}
-void
-Implementation<CRANInstalledRepository>::invalidate() const
-{
- entries_valid = false;
- entries.clear();
-}
-
CRANInstalledRepository::CRANInstalledRepository(const CRANInstalledRepositoryParams & p) :
Repository(RepositoryName("cran_installed"),
RepositoryCapabilities::create()
@@ -487,8 +476,7 @@ CRANInstalledRepository::do_installed_time(const QualifiedPackageName & q,
CountedPtr<Repository>
CRANInstalledRepository::make_cran_installed_repository(
- const Environment * const env,
- const PackageDatabase * const db,
+ Environment * const env,
AssociativeCollection<std::string, std::string>::ConstPointer m)
{
Context context("When making CRAN installed repository from repo_file '" +
@@ -508,7 +496,6 @@ CRANInstalledRepository::make_cran_installed_repository(
return CountedPtr<Repository>(new CRANInstalledRepository(CRANInstalledRepositoryParams::create()
.environment(env)
- .package_database(db)
.location(location)
.root(root)
.world(world)));
@@ -608,9 +595,9 @@ CRANInstalledRepository::sets_list() const
}
void
-CRANInstalledRepository::invalidate() const
+CRANInstalledRepository::invalidate()
{
- _imp->invalidate();
+ _imp.assign(new Implementation<CRANInstalledRepository>(_imp->params));
}
void
diff --git a/paludis/repositories/cran/cran_installed_repository.hh b/paludis/repositories/cran/cran_installed_repository.hh
index 04bf660..a091dfa 100644
--- a/paludis/repositories/cran/cran_installed_repository.hh
+++ b/paludis/repositories/cran/cran_installed_repository.hh
@@ -99,8 +99,7 @@ namespace paludis
* Virtual constructor.
*/
static CountedPtr<Repository> make_cran_installed_repository(
- const Environment * const env,
- const PackageDatabase * const db,
+ Environment * const env,
AssociativeCollection<std::string, std::string>::ConstPointer m);
/**
@@ -108,7 +107,7 @@ namespace paludis
*/
~CRANInstalledRepository();
- virtual void invalidate() const;
+ virtual void invalidate();
virtual void add_to_world(const QualifiedPackageName &) const;
diff --git a/paludis/repositories/cran/cran_installed_repository.sr b/paludis/repositories/cran/cran_installed_repository.sr
index 3278703..1444c16 100644
--- a/paludis/repositories/cran/cran_installed_repository.sr
+++ b/paludis/repositories/cran/cran_installed_repository.sr
@@ -4,7 +4,6 @@
make_class_CRANInstalledRepositoryParams()
{
key environment "const Environment *"
- key package_database "const PackageDatabase *"
key location FSEntry
key root FSEntry
key world FSEntry
diff --git a/paludis/repositories/cran/cran_repository.cc b/paludis/repositories/cran/cran_repository.cc
index ec82ddc..24b53c8 100644
--- a/paludis/repositories/cran/cran_repository.cc
+++ b/paludis/repositories/cran/cran_repository.cc
@@ -89,8 +89,7 @@ namespace paludis
struct Implementation<CRANRepository> :
InternalCounted<Implementation<CRANRepository> >
{
- /// Our owning db.
- const PackageDatabase * const db;
+ CRANRepositoryParams params;
/// Our owning env.
const Environment * const env;
@@ -141,16 +140,13 @@ namespace paludis
/// Destructor.
~Implementation();
- /// Invalidate our cache.
- void invalidate() const;
-
/// (Empty) provides map.
const std::map<QualifiedPackageName, QualifiedPackageName> provide_map;
};
}
Implementation<CRANRepository>::Implementation(const CRANRepositoryParams & p) :
- db(p.package_database),
+ params(p),
env(p.environment),
location(p.location),
distdir(p.distdir),
@@ -168,17 +164,6 @@ Implementation<CRANRepository>::~Implementation()
{
}
-void
-Implementation<CRANRepository>::invalidate() const
-{
- package_names.clear();
- has_packages = false;
- version_specs.clear();
- metadata.clear();
- has_mirrors = false;
- mirrors.clear();
-}
-
CRANRepository::CRANRepository(const CRANRepositoryParams & p) :
Repository(CRANRepository::fetch_repo_name(stringify(p.location)),
@@ -439,8 +424,7 @@ CRANRepository::do_version_metadata(
CountedPtr<Repository>
CRANRepository::make_cran_repository(
- const Environment * const env,
- const PackageDatabase * const db,
+ Environment * const env,
AssociativeCollection<std::string, std::string>::ConstPointer m)
{
Context context("When making CRAN repository from repo_file '" +
@@ -476,7 +460,6 @@ CRANRepository::make_cran_repository(
return CountedPtr<Repository>(new CRANRepository(CRANRepositoryParams::create()
.environment(env)
- .package_database(db)
.location(location)
.distdir(distdir)
.sync(sync)
@@ -626,7 +609,8 @@ CRANRepository::do_sync() const
}
void
-CRANRepository::invalidate() const
+CRANRepository::invalidate()
{
- _imp->invalidate();
+ _imp.assign(new Implementation<CRANRepository>(_imp->params));
}
+
diff --git a/paludis/repositories/cran/cran_repository.hh b/paludis/repositories/cran/cran_repository.hh
index 6c66344..a9547dc 100644
--- a/paludis/repositories/cran/cran_repository.hh
+++ b/paludis/repositories/cran/cran_repository.hh
@@ -101,8 +101,7 @@ namespace paludis
* Virtual constructor.
*/
static CountedPtr<Repository> make_cran_repository(
- const Environment * const env,
- const PackageDatabase * const db,
+ Environment * const env,
AssociativeCollection<std::string, std::string>::ConstPointer m);
/**
@@ -110,7 +109,7 @@ namespace paludis
*/
virtual ~CRANRepository();
- virtual void invalidate() const;
+ virtual void invalidate();
};
/**
diff --git a/paludis/repositories/cran/cran_repository.sr b/paludis/repositories/cran/cran_repository.sr
index 2674142..b0466cc 100644
--- a/paludis/repositories/cran/cran_repository.sr
+++ b/paludis/repositories/cran/cran_repository.sr
@@ -4,7 +4,6 @@
make_class_CRANRepositoryParams()
{
key environment "const Environment *"
- key package_database "const PackageDatabase *"
key location FSEntry
key distdir FSEntry
key mirror std::string
diff --git a/paludis/repositories/cran/cran_repository_TEST.cc b/paludis/repositories/cran/cran_repository_TEST.cc
index 850b0c4..f4561ba 100644
--- a/paludis/repositories/cran/cran_repository_TEST.cc
+++ b/paludis/repositories/cran/cran_repository_TEST.cc
@@ -58,7 +58,7 @@ namespace test_cases
keys->insert("location", "cran_repository_TEST_dir/repo1");
keys->insert("buildroot", "cran_repository_TEST_dir/tmp");
CRANRepository::Pointer repo(CRANRepository::make_cran_repository(
- &env, env.package_database().raw_pointer(), keys));
+ &env, keys));
TEST_CHECK(repo->has_category_named(CategoryNamePart("cran")));
TEST_CHECK(repo->has_package_named(QualifiedPackageName("cran/testpackage1")));
TEST_CHECK(repo->has_package_named(QualifiedPackageName("cran/testpackage2")));
@@ -84,7 +84,7 @@ namespace test_cases
keys->insert("location", "cran_repository_TEST_dir/repo2");
keys->insert("buildroot", "cran_repository_TEST_dir/tmp");
CRANRepository::Pointer repo(CRANRepository::make_cran_repository(
- &env, env.package_database().raw_pointer(), keys));
+ &env, keys));
TEST_CHECK(repo->has_package_named(QualifiedPackageName("cran/testbundle")));
TEST_CHECK(repo->has_package_named(QualifiedPackageName("cran/bundlepkg1")));
TEST_CHECK(repo->has_package_named(QualifiedPackageName("cran/bundlepkg2")));
diff --git a/paludis/repositories/fake/fake_repository_base.cc b/paludis/repositories/fake/fake_repository_base.cc
index 03253fe..eb7462b 100644
--- a/paludis/repositories/fake/fake_repository_base.cc
+++ b/paludis/repositories/fake/fake_repository_base.cc
@@ -1,7 +1,7 @@
/* vim: set sw=4 sts=4 et foldmethod=syntax : */
/*
- * Copyright (c) 2005, 2006 Ciaran McCreesh <ciaranm@ciaranm.org>
+ * Copyright (c) 2005, 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
@@ -228,7 +228,7 @@ FakeRepositoryBase::do_is_licence(const std::string &) const
}
void
-FakeRepositoryBase::invalidate() const
+FakeRepositoryBase::invalidate()
{
}
diff --git a/paludis/repositories/fake/fake_repository_base.hh b/paludis/repositories/fake/fake_repository_base.hh
index 44e6731..8ae1d1f 100644
--- a/paludis/repositories/fake/fake_repository_base.hh
+++ b/paludis/repositories/fake/fake_repository_base.hh
@@ -1,7 +1,7 @@
/* vim: set sw=4 sts=4 et foldmethod=syntax : */
/*
- * Copyright (c) 2005, 2006 Ciaran McCreesh <ciaranm@ciaranm.org>
+ * Copyright (c) 2005, 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
@@ -150,7 +150,7 @@ namespace paludis
*/
typedef CountedPtr<const FakeRepositoryBase, count_policy::InternalCountTag> ConstPointer;
- virtual void invalidate() const;
+ virtual void invalidate();
};
}
diff --git a/paludis/repositories/gems/gems_repository.cc b/paludis/repositories/gems/gems_repository.cc
index 26f77ca..355a084 100644
--- a/paludis/repositories/gems/gems_repository.cc
+++ b/paludis/repositories/gems/gems_repository.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
@@ -271,8 +271,9 @@ GemsRepository::~GemsRepository()
}
void
-GemsRepository::invalidate() const
+GemsRepository::invalidate()
{
+ _imp.assign(new Implementation<GemsRepository>(_imp->params));
}
void
diff --git a/paludis/repositories/gems/gems_repository.hh b/paludis/repositories/gems/gems_repository.hh
index f32464b..5d54490 100644
--- a/paludis/repositories/gems/gems_repository.hh
+++ b/paludis/repositories/gems/gems_repository.hh
@@ -57,7 +57,7 @@ namespace paludis
GemsRepository(const GemsRepositoryParams &);
~GemsRepository();
- virtual void invalidate() const;
+ virtual void invalidate();
virtual void regenerate_cache() const;
typedef CountedPtr<GemsRepository, count_policy::InternalCountTag> Pointer;
diff --git a/paludis/repositories/gems/gems_repository.sr b/paludis/repositories/gems/gems_repository.sr
index c5d90a6..cee9d73 100644
--- a/paludis/repositories/gems/gems_repository.sr
+++ b/paludis/repositories/gems/gems_repository.sr
@@ -4,7 +4,6 @@
make_class_GemsRepositoryParams()
{
key environment "const Environment *"
- key package_database "const PackageDatabase *"
key location FSEntry
key distdir FSEntry
key yaml_uri std::string
diff --git a/paludis/repositories/gems/gems_repository_TEST.cc b/paludis/repositories/gems/gems_repository_TEST.cc
index d8d7fc1..ab6ecc3 100644
--- a/paludis/repositories/gems/gems_repository_TEST.cc
+++ b/paludis/repositories/gems/gems_repository_TEST.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
@@ -42,7 +42,7 @@ namespace test_cases
keys->insert("format", "gems");
keys->insert("location", "gems_repository_TEST_dir/repo1");
GemsRepository::Pointer repo(make_gems_repository(
- &env, env.package_database().raw_pointer(), keys));
+ &env, keys));
TEST_CHECK_STRINGIFY_EQUAL(repo->name(), "gems");
}
} test_portage_repository_repo_name;
diff --git a/paludis/repositories/gems/make_gems_repository.cc b/paludis/repositories/gems/make_gems_repository.cc
index da51eab..db11823 100644
--- a/paludis/repositories/gems/make_gems_repository.cc
+++ b/paludis/repositories/gems/make_gems_repository.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
@@ -23,8 +23,7 @@
using namespace paludis;
Repository::Pointer
-paludis::make_gems_repository(const Environment * const env,
- const PackageDatabase * const db,
+paludis::make_gems_repository(Environment * const env,
AssociativeCollection<std::string, std::string>::ConstPointer m)
{
std::string repo_file(m->end() == m->find("repo_file") ? std::string("?") :
@@ -54,7 +53,6 @@ paludis::make_gems_repository(const Environment * const env,
return Repository::Pointer(new GemsRepository(GemsRepositoryParams::create()
.environment(env)
- .package_database(db)
.location(location)
.distdir(distdir)
.yaml_uri(yaml_uri)
diff --git a/paludis/repositories/gems/make_gems_repository.hh b/paludis/repositories/gems/make_gems_repository.hh
index fb86584..0de384c 100644
--- a/paludis/repositories/gems/make_gems_repository.hh
+++ b/paludis/repositories/gems/make_gems_repository.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>
*
* 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
@@ -25,8 +25,7 @@
namespace paludis
{
Repository::Pointer
- make_gems_repository(const Environment * const,
- const PackageDatabase * const,
+ make_gems_repository(Environment * const,
AssociativeCollection<std::string, std::string>::ConstPointer) PALUDIS_VISIBLE;
}
diff --git a/paludis/repositories/nothing/nothing_repository.cc b/paludis/repositories/nothing/nothing_repository.cc
index aa82a92..008b5b6 100644
--- a/paludis/repositories/nothing/nothing_repository.cc
+++ b/paludis/repositories/nothing/nothing_repository.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
@@ -174,8 +174,7 @@ NothingRepository::do_version_metadata(
CountedPtr<Repository>
NothingRepository::make_nothing_repository(
- const Environment * const,
- const PackageDatabase * const,
+ Environment * const,
AssociativeCollection<std::string, std::string>::ConstPointer m)
{
std::string repo_file(m->end() == m->find("repo_file") ? std::string("?") :
@@ -240,7 +239,7 @@ NothingRepository::do_sync() const
}
void
-NothingRepository::invalidate() const
+NothingRepository::invalidate()
{
}
diff --git a/paludis/repositories/nothing/nothing_repository.hh b/paludis/repositories/nothing/nothing_repository.hh
index 16cc679..022215f 100644
--- a/paludis/repositories/nothing/nothing_repository.hh
+++ b/paludis/repositories/nothing/nothing_repository.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>
*
* 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
@@ -80,8 +80,7 @@ namespace paludis
* Virtual constructor.
*/
static CountedPtr<Repository> make_nothing_repository(
- const Environment * const env,
- const PackageDatabase * const db,
+ Environment * const env,
AssociativeCollection<std::string, std::string>::ConstPointer);
/**
@@ -89,7 +88,7 @@ namespace paludis
*/
~NothingRepository();
- virtual void invalidate() const;
+ virtual void invalidate();
typedef CountedPtr<NothingRepository, count_policy::InternalCountTag> Pointer;
typedef CountedPtr<const NothingRepository, count_policy::InternalCountTag> ConstPointer;
diff --git a/paludis/repositories/portage/make_ebuild_repository.cc b/paludis/repositories/portage/make_ebuild_repository.cc
index c9d8718..fdb69d0 100644
--- a/paludis/repositories/portage/make_ebuild_repository.cc
+++ b/paludis/repositories/portage/make_ebuild_repository.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
@@ -27,8 +27,7 @@ using namespace paludis;
CountedPtr<PortageRepository>
paludis::make_ebuild_repository(
- const Environment * const env,
- const PackageDatabase * const db,
+ Environment * const env,
AssociativeCollection<std::string, std::string>::ConstPointer m)
{
std::string repo_file(m->end() == m->find("repo_file") ? std::string("?") :
@@ -130,7 +129,6 @@ paludis::make_ebuild_repository(
return CountedPtr<PortageRepository>(new PortageRepository(PortageRepositoryParams::create()
.entry_format("ebuild")
.environment(env)
- .package_database(db)
.location(location)
.profiles(profiles)
.cache(cache)
@@ -150,10 +148,9 @@ paludis::make_ebuild_repository(
CountedPtr<Repository>
paludis::make_ebuild_repository_wrapped(
- const Environment * const env,
- const PackageDatabase * const db,
+ Environment * const env,
AssociativeCollection<std::string, std::string>::ConstPointer m)
{
- return make_ebuild_repository(env, db, m);
+ return make_ebuild_repository(env, m);
}
diff --git a/paludis/repositories/portage/make_ebuild_repository.hh b/paludis/repositories/portage/make_ebuild_repository.hh
index ca7cb52..b54e4cc 100644
--- a/paludis/repositories/portage/make_ebuild_repository.hh
+++ b/paludis/repositories/portage/make_ebuild_repository.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>
*
* 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
@@ -31,14 +31,13 @@ namespace paludis
* \ingroup grpportagerepository
*/
CountedPtr<PortageRepository>
- make_ebuild_repository(const Environment * const,
- const PackageDatabase * const,
+ make_ebuild_repository(
+ Environment * const,
AssociativeCollection<std::string, std::string>::ConstPointer) PALUDIS_VISIBLE;
CountedPtr<Repository>
make_ebuild_repository_wrapped(
- const Environment * const env,
- const PackageDatabase * const db,
+ Environment * const env,
AssociativeCollection<std::string, std::string>::ConstPointer m);
}
diff --git a/paludis/repositories/portage/portage_repository.cc b/paludis/repositories/portage/portage_repository.cc
index fdbfbc6..6761aee 100644
--- a/paludis/repositories/portage/portage_repository.cc
+++ b/paludis/repositories/portage/portage_repository.cc
@@ -1,7 +1,7 @@
/* vim: set sw=4 sts=4 et foldmethod=syntax : */
/*
- * Copyright (c) 2005, 2006 Ciaran McCreesh <ciaranm@ciaranm.org>
+ * Copyright (c) 2005, 2006, 2007 Ciaran McCreesh <ciaranm@ciaranm.org>
* Copyright (c) 2006 Danny van Dyk <kugelfang@gentoo.org>
*
* This file is part of the Paludis package manager. Paludis is free software;
@@ -152,9 +152,6 @@ namespace paludis
/// Destructor.
~Implementation();
- /// Invalidate our cache.
- void invalidate() const;
-
/// (Empty) provides map.
const std::map<QualifiedPackageName, QualifiedPackageName> provide_map;
@@ -256,23 +253,6 @@ namespace paludis
has_profiles_desc = true;
}
-
- void
- Implementation<PortageRepository>::invalidate() const
- {
- profile_ptr.zero();
- has_category_names = false;
- category_names.clear();
- package_names.clear();
- version_specs.clear();
- metadata.clear();
- repo_mask.clear();
- has_repo_mask = false;
- has_virtuals = false;
- arch_flags.assign(0);
- has_mirrors = false;
- mirrors.clear();
- }
}
PortageRepository::PortageRepository(const PortageRepositoryParams & p) :
@@ -805,9 +785,9 @@ PortageRepository::do_sync() const
}
void
-PortageRepository::invalidate() const
+PortageRepository::invalidate()
{
- _imp->invalidate();
+ _imp.assign(new Implementation<PortageRepository>(this, _imp->params));
}
void
diff --git a/paludis/repositories/portage/portage_repository.hh b/paludis/repositories/portage/portage_repository.hh
index c17262d..582dd9b 100644
--- a/paludis/repositories/portage/portage_repository.hh
+++ b/paludis/repositories/portage/portage_repository.hh
@@ -1,7 +1,7 @@
/* vim: set sw=4 sts=4 et foldmethod=syntax : */
/*
- * Copyright (c) 2005, 2006 Ciaran McCreesh <ciaranm@ciaranm.org>
+ * Copyright (c) 2005, 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
@@ -146,7 +146,7 @@ namespace paludis
*/
~PortageRepository();
- virtual void invalidate() const;
+ virtual void invalidate();
virtual void regenerate_cache() const;
virtual void update_news() const;
diff --git a/paludis/repositories/portage/portage_repository_TEST.cc b/paludis/repositories/portage/portage_repository_TEST.cc
index f032a16..39efefe 100644
--- a/paludis/repositories/portage/portage_repository_TEST.cc
+++ b/paludis/repositories/portage/portage_repository_TEST.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,7 @@ namespace test_cases
keys->insert("location", "portage_repository_TEST_dir/repo1");
keys->insert("profile", "portage_repository_TEST_dir/repo1/profiles/profile");
PortageRepository::Pointer repo(make_ebuild_repository(
- &env, env.package_database().raw_pointer(), keys));
+ &env, keys));
TEST_CHECK_STRINGIFY_EQUAL(repo->name(), "test-repo-1");
}
} test_portage_repository_repo_name;
@@ -76,7 +76,7 @@ namespace test_cases
keys->insert("location", "portage_repository_TEST_dir/repo2");
keys->insert("profile", "portage_repository_TEST_dir/repo2/profiles/profile");
PortageRepository::Pointer repo(make_ebuild_repository(
- &env, env.package_database().raw_pointer(), keys));
+ &env, keys));
TEST_CHECK_STRINGIFY_EQUAL(repo->name(), "x-repo2");
}
} test_portage_repository_no_repo_name;
@@ -99,7 +99,7 @@ namespace test_cases
keys->insert("location", "portage_repository_TEST_dir/repo3");
keys->insert("profile", "portage_repository_TEST_dir/repo3/profiles/profile");
PortageRepository::Pointer repo(make_ebuild_repository(
- &env, env.package_database().raw_pointer(), keys));
+ &env, keys));
TEST_CHECK_STRINGIFY_EQUAL(repo->name(), "x-repo3");
}
} test_portage_repository_empty_repo_name;
@@ -122,7 +122,7 @@ namespace test_cases
keys->insert("location", "portage_repository_TEST_dir/repo1");
keys->insert("profile", "portage_repository_TEST_dir/repo1/profiles/profile");
PortageRepository::Pointer repo(make_ebuild_repository(
- &env, env.package_database().raw_pointer(), keys));
+ &env, keys));
for (int pass = 1 ; pass <= 2 ; ++pass)
{
@@ -154,7 +154,7 @@ namespace test_cases
keys->insert("location", "portage_repository_TEST_dir/repo1");
keys->insert("profile", "portage_repository_TEST_dir/repo1/profiles/profile");
PortageRepository::Pointer repo(make_ebuild_repository(
- &env, env.package_database().raw_pointer(), keys));
+ &env, keys));
for (int pass = 1 ; pass <= 2 ; ++pass)
{
@@ -188,7 +188,7 @@ namespace test_cases
keys->insert("location", "portage_repository_TEST_dir/repo4");
keys->insert("profile", "portage_repository_TEST_dir/repo4/profiles/profile");
PortageRepository::Pointer repo(make_ebuild_repository(
- &env, env.package_database().raw_pointer(), keys));
+ &env, keys));
for (int pass = 1 ; pass <= 2 ; ++pass)
{
@@ -228,7 +228,7 @@ namespace test_cases
keys->insert("location", "portage_repository_TEST_dir/repo4");
keys->insert("profile", "portage_repository_TEST_dir/repo4/profiles/profile");
PortageRepository::Pointer repo(make_ebuild_repository(
- &env, env.package_database().raw_pointer(), keys));
+ &env, keys));
repo->package_names(CategoryNamePart("cat-one"));
repo->package_names(CategoryNamePart("cat-two"));
@@ -272,7 +272,7 @@ namespace test_cases
keys->insert("location", "portage_repository_TEST_dir/repo4");
keys->insert("profile", "portage_repository_TEST_dir/repo4/profiles/profile");
PortageRepository::Pointer repo(make_ebuild_repository(
- &env, env.package_database().raw_pointer(), keys));
+ &env, keys));
QualifiedPackageNameCollection::ConstPointer names(0);
@@ -325,7 +325,7 @@ namespace test_cases
keys->insert("location", "portage_repository_TEST_dir/repo5");
keys->insert("profile", "portage_repository_TEST_dir/repo5/profiles/profile");
PortageRepository::Pointer repo(make_ebuild_repository(
- &env, env.package_database().raw_pointer(), keys));
+ &env, keys));
QualifiedPackageNameCollection::ConstPointer names(0);
@@ -359,7 +359,7 @@ namespace test_cases
keys->insert("location", "portage_repository_TEST_dir/repo4");
keys->insert("profile", "portage_repository_TEST_dir/repo4/profiles/profile");
PortageRepository::Pointer repo(make_ebuild_repository(
- &env, env.package_database().raw_pointer(), keys));
+ &env, keys));
for (int pass = 1 ; pass <= 2 ; ++pass)
{
@@ -403,7 +403,7 @@ namespace test_cases
keys->insert("location", "portage_repository_TEST_dir/repo4");
keys->insert("profile", "portage_repository_TEST_dir/repo4/profiles/profile");
PortageRepository::Pointer repo(make_ebuild_repository(
- &env, env.package_database().raw_pointer(), keys));
+ &env, keys));
for (int pass = 1 ; pass <= 2 ; ++pass)
{
@@ -446,7 +446,7 @@ namespace test_cases
keys->insert("location", "portage_repository_TEST_dir/repo8");
keys->insert("profile", "portage_repository_TEST_dir/repo8/profiles/profile");
PortageRepository::Pointer repo(make_ebuild_repository(
- &env, env.package_database().raw_pointer(), keys));
+ &env, keys));
for (int pass = 1 ; pass <= 2 ; ++pass)
{
@@ -489,7 +489,7 @@ namespace test_cases
keys->insert("location", "portage_repository_TEST_dir/repo6");
keys->insert("profile", "portage_repository_TEST_dir/repo6/profiles/profile");
PortageRepository::Pointer repo(make_ebuild_repository(
- &env, env.package_database().raw_pointer(), keys));
+ &env, keys));
for (int pass = 1 ; pass <= 2 ; ++pass)
{
@@ -530,7 +530,7 @@ namespace test_cases
keys->insert("location", "portage_repository_TEST_dir/repo7");
keys->insert("profile", "portage_repository_TEST_dir/repo7/profiles/profile");
PortageRepository::Pointer repo(make_ebuild_repository(
- &env, env.package_database().raw_pointer(), keys));
+ &env, keys));
for (int pass = 1 ; pass <= 2 ; ++pass)
{
@@ -567,7 +567,7 @@ namespace test_cases
keys->insert("location", "portage_repository_TEST_dir/repo7");
keys->insert("profile", "portage_repository_TEST_dir/repo7/profiles/profile");
PortageRepository::Pointer repo(make_ebuild_repository(
- &env, env.package_database().raw_pointer(), keys));
+ &env, keys));
for (int pass = 1 ; pass <= 2 ; ++pass)
{
@@ -598,7 +598,7 @@ namespace test_cases
keys->insert("location", "portage_repository_TEST_dir/repo9");
keys->insert("profile", "portage_repository_TEST_dir/repo9/profiles/profile");
PortageRepository::Pointer repo(make_ebuild_repository(
- &env, env.package_database().raw_pointer(), keys));
+ &env, keys));
for (int pass = 1 ; pass <= 2 ; ++pass)
{
@@ -646,7 +646,7 @@ namespace test_cases
keys->insert("location", "portage_repository_TEST_dir/repo10");
keys->insert("profiles", "portage_repository_TEST_dir/repo10/profiles/profile/subprofile");
PortageRepository::Pointer repo(make_ebuild_repository(
- &env, env.package_database().raw_pointer(), keys));
+ &env, keys));
for (int pass = 1 ; pass <= 2 ; ++pass)
{
diff --git a/paludis/repositories/portage/portage_repository_params.sr b/paludis/repositories/portage/portage_repository_params.sr
index 993c4ea..cb926b5 100644
--- a/paludis/repositories/portage/portage_repository_params.sr
+++ b/paludis/repositories/portage/portage_repository_params.sr
@@ -4,8 +4,7 @@
make_class_PortageRepositoryParams()
{
key entry_format std::string
- key environment "const Environment *"
- key package_database "const PackageDatabase *"
+ key environment "Environment *"
key location FSEntry
key profiles FSEntryCollection::ConstPointer
key cache FSEntry
diff --git a/paludis/repositories/repository_maker.hh b/paludis/repositories/repository_maker.hh
index 9134495..0853c10 100644
--- a/paludis/repositories/repository_maker.hh
+++ b/paludis/repositories/repository_maker.hh
@@ -71,8 +71,8 @@ namespace paludis
*/
class PALUDIS_VISIBLE RepositoryMaker :
public VirtualConstructor<std::string,
- Repository::Pointer (*) (const Environment * const, const PackageDatabase * const,
- AssociativeCollection<std::string, std::string>::ConstPointer),
+ Repository::Pointer (*) (Environment * const,
+ AssociativeCollection<std::string, std::string>::ConstPointer),
virtual_constructor_not_found::ThrowException<NoSuchRepositoryTypeError> >,
public InstantiationPolicy<RepositoryMaker, instantiation_method::SingletonAsNeededTag>,
private PrivateImplementationPattern<RepositoryMaker>
diff --git a/paludis/repositories/vdb/vdb_repository.cc b/paludis/repositories/vdb/vdb_repository.cc
index 3aeb8db..50dac78 100644
--- a/paludis/repositories/vdb/vdb_repository.cc
+++ b/paludis/repositories/vdb/vdb_repository.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
@@ -298,8 +298,7 @@ namespace paludis
struct Implementation<VDBRepository> :
InternalCounted<Implementation<VDBRepository> >
{
- /// Our owning db.
- const PackageDatabase * const db;
+ VDBRepositoryParams params;
/// Our owning env.
const Environment * const env;
@@ -354,7 +353,7 @@ namespace paludis
Implementation<VDBRepository>::Implementation(const VDBRepository * const r,
const VDBRepositoryParams & p) :
- db(p.package_database),
+ params(p),
env(p.environment),
location(p.location),
root(p.root),
@@ -829,8 +828,7 @@ VDBRepository::do_query_use_force(const UseFlagName & u, const PackageDatabaseEn
CountedPtr<Repository>
VDBRepository::make_vdb_repository(
- const Environment * const env,
- const PackageDatabase * const db,
+ Environment * const env,
AssociativeCollection<std::string, std::string>::ConstPointer m)
{
std::string repo_file(m->end() == m->find("repo_file") ? std::string("?") : m->find("repo_file")->second);
@@ -872,7 +870,6 @@ VDBRepository::make_vdb_repository(
return CountedPtr<Repository>(new VDBRepository(VDBRepositoryParams::create()
.environment(env)
- .package_database(db)
.location(location)
.root(root)
.world(world)
@@ -1012,9 +1009,9 @@ VDBRepository::sets_list() const
}
void
-VDBRepository::invalidate() const
+VDBRepository::invalidate()
{
- _imp->invalidate();
+ _imp.assign(new Implementation<VDBRepository>(this, _imp->params));
}
void
diff --git a/paludis/repositories/vdb/vdb_repository.hh b/paludis/repositories/vdb/vdb_repository.hh
index f2bdf0c..baef483 100644
--- a/paludis/repositories/vdb/vdb_repository.hh
+++ b/paludis/repositories/vdb/vdb_repository.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>
*
* 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
@@ -123,8 +123,7 @@ namespace paludis
* Virtual constructor.
*/
static CountedPtr<Repository> make_vdb_repository(
- const Environment * const env,
- const PackageDatabase * const db,
+ Environment * const env,
AssociativeCollection<std::string, std::string>::ConstPointer m);
/**
@@ -132,7 +131,7 @@ namespace paludis
*/
~VDBRepository();
- virtual void invalidate() const;
+ virtual void invalidate();
virtual void regenerate_cache() const;
diff --git a/paludis/repositories/vdb/vdb_repository.sr b/paludis/repositories/vdb/vdb_repository.sr
index ad407fc..48df155 100644
--- a/paludis/repositories/vdb/vdb_repository.sr
+++ b/paludis/repositories/vdb/vdb_repository.sr
@@ -4,7 +4,6 @@
make_class_VDBRepositoryParams()
{
key environment "const Environment *"
- key package_database "const PackageDatabase *"
key location FSEntry
key root FSEntry
key world FSEntry
diff --git a/paludis/repositories/vdb/vdb_repository_TEST.cc b/paludis/repositories/vdb/vdb_repository_TEST.cc
index 571a2be..b4f41a5 100644
--- a/paludis/repositories/vdb/vdb_repository_TEST.cc
+++ b/paludis/repositories/vdb/vdb_repository_TEST.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,7 @@ namespace test_cases
keys->insert("provides_cache", "/var/empty");
keys->insert("location", "vdb_repository_TEST_dir/repo1");
VDBRepository::Pointer repo(VDBRepository::make_vdb_repository(
- &env, env.package_database().raw_pointer(), keys));
+ &env, keys));
TEST_CHECK_STRINGIFY_EQUAL(repo->name(), "installed");
}
} test_vdb_repository_repo_name;
@@ -76,7 +76,7 @@ namespace test_cases
keys->insert("provides_cache", "/var/empty");
keys->insert("location", "vdb_repository_TEST_dir/repo1");
VDBRepository::Pointer repo(VDBRepository::make_vdb_repository(
- &env, env.package_database().raw_pointer(), keys));
+ &env, keys));
TEST_CHECK(repo->has_category_named(CategoryNamePart("cat-one")));
TEST_CHECK(repo->has_category_named(CategoryNamePart("cat-two")));
@@ -102,7 +102,7 @@ namespace test_cases
keys->insert("provides_cache", "/var/empty");
keys->insert("location", "vdb_repository_TEST_dir/repo1");
VDBRepository::Pointer repo(VDBRepository::make_vdb_repository(
- &env, env.package_database().raw_pointer(), keys));
+ &env, keys));
PackageDatabaseEntry e1(CategoryNamePart("cat-one") + PackageNamePart("pkg-one"),
VersionSpec("1"), RepositoryName("installed"));
@@ -135,7 +135,7 @@ namespace test_cases
keys->insert("location", "vdb_repository_TEST_dir/repo1");
keys->insert("world", "vdb_repository_TEST_dir/world-new-file");
VDBRepository::Pointer repo(VDBRepository::make_vdb_repository(
- &env, env.package_database().raw_pointer(), keys));
+ &env, keys));
repo->add_to_world(QualifiedPackageName("cat-one/foofoo"));
std::ifstream world("vdb_repository_TEST_dir/world-new-file");
std::string world_content((std::istreambuf_iterator<char>(world)), std::istreambuf_iterator<char>());
@@ -161,7 +161,7 @@ namespace test_cases
keys->insert("location", "vdb_repository_TEST_dir/repo1");
keys->insert("world", "vdb_repository_TEST_dir/world-empty");
VDBRepository::Pointer repo(VDBRepository::make_vdb_repository(
- &env, env.package_database().raw_pointer(), keys));
+ &env, keys));
repo->add_to_world(QualifiedPackageName("cat-one/foofoo"));
std::ifstream world("vdb_repository_TEST_dir/world-empty");
std::string world_content((std::istreambuf_iterator<char>(world)), std::istreambuf_iterator<char>());
@@ -187,7 +187,7 @@ namespace test_cases
keys->insert("location", "vdb_repository_TEST_dir/repo1");
keys->insert("world", "vdb_repository_TEST_dir/world-no-match");
VDBRepository::Pointer repo(VDBRepository::make_vdb_repository(
- &env, env.package_database().raw_pointer(), keys));
+ &env, keys));
repo->add_to_world(QualifiedPackageName("cat-one/foofoo"));
std::ifstream world("vdb_repository_TEST_dir/world-no-match");
std::string world_content((std::istreambuf_iterator<char>(world)), std::istreambuf_iterator<char>());
@@ -213,7 +213,7 @@ namespace test_cases
keys->insert("location", "vdb_repository_TEST_dir/repo1");
keys->insert("world", "vdb_repository_TEST_dir/world-match");
VDBRepository::Pointer repo(VDBRepository::make_vdb_repository(
- &env, env.package_database().raw_pointer(), keys));
+ &env, keys));
repo->add_to_world(QualifiedPackageName("cat-one/foofoo"));
std::ifstream world("vdb_repository_TEST_dir/world-match");
std::string world_content((std::istreambuf_iterator<char>(world)), std::istreambuf_iterator<char>());
@@ -239,7 +239,7 @@ namespace test_cases
keys->insert("location", "vdb_repository_TEST_dir/repo1");
keys->insert("world", "vdb_repository_TEST_dir/world-no-match-no-eol");
VDBRepository::Pointer repo(VDBRepository::make_vdb_repository(
- &env, env.package_database().raw_pointer(), keys));
+ &env, keys));
repo->add_to_world(QualifiedPackageName("cat-one/foofoo"));
std::ifstream world("vdb_repository_TEST_dir/world-no-match-no-eol");
std::string world_content((std::istreambuf_iterator<char>(world)), std::istreambuf_iterator<char>());
diff --git a/paludis/repositories/virtuals/installed_virtuals_repository.cc b/paludis/repositories/virtuals/installed_virtuals_repository.cc
index f9c6448..3e33975 100644
--- a/paludis/repositories/virtuals/installed_virtuals_repository.cc
+++ b/paludis/repositories/virtuals/installed_virtuals_repository.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
@@ -121,8 +121,7 @@ InstalledVirtualsRepository::need_entries() const
CountedPtr<Repository>
InstalledVirtualsRepository::make_installed_virtuals_repository(
- const Environment * const env,
- const PackageDatabase * const,
+ Environment * const env,
AssociativeCollection<std::string, std::string>::ConstPointer)
{
return CountedPtr<Repository>(new InstalledVirtualsRepository(env));
@@ -295,10 +294,9 @@ InstalledVirtualsRepository::do_is_licence(const std::string &) const
}
void
-InstalledVirtualsRepository::invalidate() const
+InstalledVirtualsRepository::invalidate()
{
- _imp->has_entries = false;
- _imp->entries.clear();
+ _imp.assign(new Implementation<InstalledVirtualsRepository>(_imp->env));
}
void
diff --git a/paludis/repositories/virtuals/installed_virtuals_repository.hh b/paludis/repositories/virtuals/installed_virtuals_repository.hh
index f1ff29f..d6b26d0 100644
--- a/paludis/repositories/virtuals/installed_virtuals_repository.hh
+++ b/paludis/repositories/virtuals/installed_virtuals_repository.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>
*
* 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
@@ -88,11 +88,10 @@ namespace paludis
* Create an InstalledVirtualsRepository instance.
*/
static CountedPtr<Repository> make_installed_virtuals_repository(
- const Environment * const env,
- const PackageDatabase * const db,
+ Environment * const env,
AssociativeCollection<std::string, std::string>::ConstPointer);
- virtual void invalidate() const;
+ virtual void invalidate();
virtual bool can_be_favourite_repository() const
{
diff --git a/paludis/repositories/virtuals/virtuals_repository.cc b/paludis/repositories/virtuals/virtuals_repository.cc
index ed9d8d4..88e3e0e 100644
--- a/paludis/repositories/virtuals/virtuals_repository.cc
+++ b/paludis/repositories/virtuals/virtuals_repository.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
@@ -197,8 +197,7 @@ VirtualsRepository::need_entries() const
CountedPtr<Repository>
VirtualsRepository::make_virtuals_repository(
- const Environment * const env,
- const PackageDatabase * const,
+ Environment * const env,
AssociativeCollection<std::string, std::string>::ConstPointer)
{
return CountedPtr<Repository>(new VirtualsRepository(env));
@@ -359,12 +358,9 @@ VirtualsRepository::do_is_licence(const std::string &) const
}
void
-VirtualsRepository::invalidate() const
+VirtualsRepository::invalidate()
{
- _imp->has_entries = false;
- _imp->entries.clear();
- _imp->has_names = false;
- _imp->names.clear();
+ _imp.assign(new Implementation<VirtualsRepository>(_imp->env));
}
void
diff --git a/paludis/repositories/virtuals/virtuals_repository.hh b/paludis/repositories/virtuals/virtuals_repository.hh
index 84f4223..24ded21 100644
--- a/paludis/repositories/virtuals/virtuals_repository.hh
+++ b/paludis/repositories/virtuals/virtuals_repository.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>
*
* 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
@@ -84,11 +84,10 @@ namespace paludis
* Create a VirtualsRepository instance.
*/
static CountedPtr<Repository> make_virtuals_repository(
- const Environment * const env,
- const PackageDatabase * const db,
+ Environment * const env,
AssociativeCollection<std::string, std::string>::ConstPointer);
- virtual void invalidate() const;
+ virtual void invalidate();
virtual bool can_be_favourite_repository() const
{
diff --git a/paludis/repository.hh b/paludis/repository.hh
index 094ff30..d69665a 100644
--- a/paludis/repository.hh
+++ b/paludis/repository.hh
@@ -1,7 +1,7 @@
/* vim: set sw=4 sts=4 et foldmethod=syntax : */
/*
- * Copyright (c) 2005, 2006 Ciaran McCreesh <ciaranm@ciaranm.org>
+ * Copyright (c) 2005, 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
@@ -386,7 +386,7 @@ namespace paludis
/**
* Invalidate any in memory cache.
*/
- virtual void invalidate() const = 0;
+ virtual void invalidate() = 0;
/**
* Regenerate any on disk cache.
diff --git a/paludis/tasks/install_task.cc b/paludis/tasks/install_task.cc
index 3809c5c..f5f4034 100644
--- a/paludis/tasks/install_task.cc
+++ b/paludis/tasks/install_task.cc
@@ -299,7 +299,7 @@ InstallTask::execute()
for (PackageDatabase::RepositoryIterator r(_imp->env->package_database()->begin_repositories()),
r_end(_imp->env->package_database()->end_repositories()) ; r != r_end ; ++r)
if ((*r)->installed_interface)
- (*r)->invalidate();
+ ((*r).raw_pointer())->invalidate();
// look for packages with the same name in the same slot
PackageDatabaseEntryCollection::Pointer collision_list(_imp->env->package_database()->query(