aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2006-07-29 22:18:51 +0000
committerAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2006-07-29 22:18:51 +0000
commit99a97e0d49f7ecd4c060659940be99454f29383f (patch)
tree429506061d64973f9fbbd1de6142778cb6a4b18c
parenta9fcbf9c6bf227a8714a708c9bad6663263bd32b (diff)
downloadpaludis-99a97e0d49f7ecd4c060659940be99454f29383f.tar.gz
paludis-99a97e0d49f7ecd4c060659940be99454f29383f.tar.xz
Move environment variable code out from PortageRepository to PortageRepositoryEntries
-rw-r--r--paludis/repositories/portage/portage_repository.cc22
-rw-r--r--paludis/repositories/portage/portage_repository_ebuild_entries.cc28
-rw-r--r--paludis/repositories/portage/portage_repository_ebuild_entries.hh4
-rw-r--r--paludis/repositories/portage/portage_repository_entries.hh4
4 files changed, 38 insertions, 20 deletions
diff --git a/paludis/repositories/portage/portage_repository.cc b/paludis/repositories/portage/portage_repository.cc
index 362e6a3..d9433cb 100644
--- a/paludis/repositories/portage/portage_repository.cc
+++ b/paludis/repositories/portage/portage_repository.cc
@@ -970,26 +970,8 @@ PortageRepository::get_environment_variable(
_imp->need_profiles();
- QualifiedPackageName q(for_package.get<pde_name>());
- EbuildVariableCommand cmd(EbuildCommandParams::create((
- param<ecpk_environment>(_imp->params.get<prpk_environment>()),
- param<ecpk_db_entry>(&for_package),
- param<ecpk_ebuild_dir>(_imp->params.get<prpk_location>() / stringify(q.get<qpn_category>()) /
- stringify(q.get<qpn_package>())),
- param<ecpk_files_dir>(_imp->params.get<prpk_location>() / stringify(q.get<qpn_category>()) /
- stringify(q.get<qpn_package>()) / "files"),
- param<ecpk_eclassdirs>(_imp->params.get<prpk_eclassdirs>()),
- param<ecpk_portdir>(_imp->params.get<prpk_location>()),
- param<ecpk_distdir>(_imp->params.get<prpk_distdir>()),
- param<ecpk_buildroot>(_imp->params.get<prpk_buildroot>())
- )),
- var);
-
- if (! cmd())
- throw EnvironmentVariableActionError("Couldn't get environment variable '" +
- stringify(var) + "' for package '" + stringify(for_package) + "'");
-
- return cmd.result();
+ return _imp->entries_ptr->get_environment_variable(for_package.get<pde_name>(),
+ for_package.get<pde_version>(), var, _imp->profile_ptr);
}
RepositoryInfo::ConstPointer
diff --git a/paludis/repositories/portage/portage_repository_ebuild_entries.cc b/paludis/repositories/portage/portage_repository_ebuild_entries.cc
index d46acd4..59bad30 100644
--- a/paludis/repositories/portage/portage_repository_ebuild_entries.cc
+++ b/paludis/repositories/portage/portage_repository_ebuild_entries.cc
@@ -526,3 +526,31 @@ PortageRepositoryEbuildEntries::install(const QualifiedPackageName & q, const Ve
install_cmd();
}
+std::string
+PortageRepositoryEbuildEntries::get_environment_variable(const QualifiedPackageName & q,
+ const VersionSpec & v, const std::string & var,
+ PortageRepositoryProfile::ConstPointer) const
+{
+ PackageDatabaseEntry for_package(q, v, _imp->portage_repository->name());
+
+ EbuildVariableCommand cmd(EbuildCommandParams::create((
+ param<ecpk_environment>(_imp->params.get<prpk_environment>()),
+ param<ecpk_db_entry>(&for_package),
+ param<ecpk_ebuild_dir>(_imp->params.get<prpk_location>() / stringify(q.get<qpn_category>()) /
+ stringify(q.get<qpn_package>())),
+ param<ecpk_files_dir>(_imp->params.get<prpk_location>() / stringify(q.get<qpn_category>()) /
+ stringify(q.get<qpn_package>()) / "files"),
+ param<ecpk_eclassdirs>(_imp->params.get<prpk_eclassdirs>()),
+ param<ecpk_portdir>(_imp->params.get<prpk_location>()),
+ param<ecpk_distdir>(_imp->params.get<prpk_distdir>()),
+ param<ecpk_buildroot>(_imp->params.get<prpk_buildroot>())
+ )),
+ var);
+
+ if (! cmd())
+ throw EnvironmentVariableActionError("Couldn't get environment variable '" +
+ stringify(var) + "' for package '" + stringify(for_package) + "'");
+
+ return cmd.result();
+}
+
diff --git a/paludis/repositories/portage/portage_repository_ebuild_entries.hh b/paludis/repositories/portage/portage_repository_ebuild_entries.hh
index 1ed898d..937f5ff 100644
--- a/paludis/repositories/portage/portage_repository_ebuild_entries.hh
+++ b/paludis/repositories/portage/portage_repository_ebuild_entries.hh
@@ -49,6 +49,10 @@ namespace paludis
virtual VersionMetadata::Pointer generate_version_metadata(const QualifiedPackageName &,
const VersionSpec &) const;
+ virtual std::string get_environment_variable(const QualifiedPackageName &,
+ const VersionSpec &, const std::string & var,
+ PortageRepositoryProfile::ConstPointer) const;
+
virtual void install(const QualifiedPackageName &, const VersionSpec &,
const InstallOptions &, PortageRepositoryProfile::ConstPointer) const;
};
diff --git a/paludis/repositories/portage/portage_repository_entries.hh b/paludis/repositories/portage/portage_repository_entries.hh
index a8e122a..1544879 100644
--- a/paludis/repositories/portage/portage_repository_entries.hh
+++ b/paludis/repositories/portage/portage_repository_entries.hh
@@ -57,6 +57,10 @@ namespace paludis
virtual VersionMetadata::Pointer generate_version_metadata(const QualifiedPackageName &,
const VersionSpec &) const = 0;
+ virtual std::string get_environment_variable(const QualifiedPackageName &,
+ const VersionSpec &, const std::string & var,
+ PortageRepositoryProfile::ConstPointer) const = 0;
+
virtual void install(const QualifiedPackageName &, const VersionSpec &,
const InstallOptions &, PortageRepositoryProfile::ConstPointer) const = 0;
};