aboutsummaryrefslogtreecommitdiff
path: root/paludis/repositories/repository
diff options
context:
space:
mode:
Diffstat (limited to 'paludis/repositories/repository')
-rw-r--r--paludis/repositories/repository/repository_id.cc18
-rw-r--r--paludis/repositories/repository/repository_id.hh4
-rw-r--r--paludis/repositories/repository/repository_repository.cc6
-rw-r--r--paludis/repositories/repository/repository_repository_store.cc3
4 files changed, 17 insertions, 14 deletions
diff --git a/paludis/repositories/repository/repository_id.cc b/paludis/repositories/repository/repository_id.cc
index 769e472f6..512a1489c 100644
--- a/paludis/repositories/repository/repository_id.cc
+++ b/paludis/repositories/repository/repository_id.cc
@@ -64,7 +64,7 @@ namespace paludis
const Environment * const env;
const QualifiedPackageName name;
const VersionSpec version;
- const RepositoryRepository * const repo;
+ const RepositoryName repository_name;
const std::shared_ptr<LiteralMetadataStringSetKey> behaviours_key;
@@ -72,7 +72,7 @@ namespace paludis
env(e.environment()),
name(e.name()),
version("0", { }),
- repo(e.repository()),
+ repository_name(e.repository()),
behaviours_key(RepositoryIDBehaviours::get_instance()->behaviours_key)
{
}
@@ -107,16 +107,16 @@ RepositoryID::canonical_form(const PackageIDCanonicalForm f) const
{
case idcf_full:
return stringify(_imp->name) + "-" + stringify(_imp->version) +
- "::" + stringify(_imp->repo->name());
+ "::" + stringify(_imp->repository_name);
case idcf_no_version:
- return stringify(_imp->name) + "::" + stringify(_imp->repo->name());
+ return stringify(_imp->name) + "::" + stringify(_imp->repository_name);
case idcf_version:
return stringify(_imp->version);
case idcf_no_name:
- return stringify(_imp->version) + "::" + stringify(_imp->repo->name());
+ return stringify(_imp->version) + "::" + stringify(_imp->repository_name);
case last_idcf:
break;
@@ -129,7 +129,7 @@ PackageDepSpec
RepositoryID::uniquely_identifying_spec() const
{
return parse_user_package_dep_spec("=" + stringify(name()) + "-" + stringify(version()) +
- + "::" + stringify(repository()->name()),
+ + "::" + stringify(repository_name()),
_imp->env, { });
}
@@ -145,10 +145,10 @@ RepositoryID::version() const
return _imp->version;
}
-const std::shared_ptr<const Repository>
-RepositoryID::repository() const
+const RepositoryName
+RepositoryID::repository_name() const
{
- return _imp->repo->shared_from_this();
+ return _imp->repository_name;
}
bool
diff --git a/paludis/repositories/repository/repository_id.hh b/paludis/repositories/repository/repository_id.hh
index 44e17f91d..1c3ab82f5 100644
--- a/paludis/repositories/repository/repository_id.hh
+++ b/paludis/repositories/repository/repository_id.hh
@@ -40,7 +40,7 @@ namespace paludis
{
NamedValue<n::environment, const Environment *> environment;
NamedValue<n::name, QualifiedPackageName> name;
- NamedValue<n::repository, const RepositoryRepository *> repository;
+ NamedValue<n::repository, RepositoryName> repository;
};
class PALUDIS_VISIBLE RepositoryID :
@@ -61,7 +61,7 @@ namespace paludis
const std::string canonical_form(const PackageIDCanonicalForm) const;
const QualifiedPackageName name() const;
const VersionSpec version() const;
- const std::shared_ptr<const Repository> repository() const;
+ const RepositoryName repository_name() const;
virtual PackageDepSpec uniquely_identifying_spec() const;
const std::shared_ptr<const MetadataValueKey<SlotName> > slot_key() const;
diff --git a/paludis/repositories/repository/repository_repository.cc b/paludis/repositories/repository/repository_repository.cc
index feb2e9f32..bfcceb8ad 100644
--- a/paludis/repositories/repository/repository_repository.cc
+++ b/paludis/repositories/repository/repository_repository.cc
@@ -38,6 +38,7 @@
#include <paludis/package_id.hh>
#include <paludis/output_manager.hh>
#include <paludis/environment.hh>
+#include <paludis/package_database.hh>
#include <list>
using namespace paludis;
@@ -345,9 +346,10 @@ RepositoryRepository::sync_host_key() const
}
bool
-RepositoryRepository::is_suitable_destination_for(const std::shared_ptr<const PackageID> & e) const
+RepositoryRepository::is_suitable_destination_for(const std::shared_ptr<const PackageID> & id) const
{
- std::string f(e->repository()->format_key() ? e->repository()->format_key()->value() : "");
+ auto repo(_imp->params.environment()->package_database()->fetch_repository(id->repository_name()));
+ std::string f(repo->format_key() ? repo->format_key()->value() : "");
return f == "unavailable";
}
diff --git a/paludis/repositories/repository/repository_repository_store.cc b/paludis/repositories/repository/repository_repository_store.cc
index 431413463..cfa62f988 100644
--- a/paludis/repositories/repository/repository_repository_store.cc
+++ b/paludis/repositories/repository/repository_repository_store.cc
@@ -18,6 +18,7 @@
*/
#include <paludis/repositories/repository/repository_repository_store.hh>
+#include <paludis/repositories/repository/repository_repository.hh>
#include <paludis/repositories/repository/repository_id.hh>
#include <paludis/util/pimp-impl.hh>
#include <paludis/util/stringify.hh>
@@ -94,7 +95,7 @@ RepositoryRepositoryStore::_populate_one(const RepositoryName & repo_name)
const std::shared_ptr<RepositoryID> id(std::make_shared<RepositoryID>(make_named_values<RepositoryIDParams>(
n::environment() = _imp->env,
n::name() = CategoryNamePart("repository") + PackageNamePart(stringify(repo_name)),
- n::repository() = _imp->repo
+ n::repository() = _imp->repo->name()
)));
_imp->categories->insert(id->name().category());