aboutsummaryrefslogtreecommitdiff
path: root/paludis/repositories/e/e_repository.cc
diff options
context:
space:
mode:
authorAvatar David Leverton <levertond@googlemail.com> 2012-05-13 18:37:46 +0100
committerAvatar David Leverton <levertond@googlemail.com> 2012-05-13 18:40:50 +0100
commit471ede08c4eb2ac6dec49ce23c84aba28785ee87 (patch)
tree6ecb26a87e817906002681d7bf3957c5c1ef17b5 /paludis/repositories/e/e_repository.cc
parent666e567c8a75123e4738b828dff4c35e1df86a99 (diff)
downloadpaludis-471ede08c4eb2ac6dec49ce23c84aba28785ee87.tar.gz
paludis-471ede08c4eb2ac6dec49ce23c84aba28785ee87.tar.xz
Use EAPI from suffix for version parsing
Also removes the need for EbuildID::EbuildID to fetch eapi_when_unknown, since that's already done by the caller.
Diffstat (limited to 'paludis/repositories/e/e_repository.cc')
-rw-r--r--paludis/repositories/e/e_repository.cc11
1 files changed, 7 insertions, 4 deletions
diff --git a/paludis/repositories/e/e_repository.cc b/paludis/repositories/e/e_repository.cc
index 7fd726f79..1e4dbac04 100644
--- a/paludis/repositories/e/e_repository.cc
+++ b/paludis/repositories/e/e_repository.cc
@@ -1695,9 +1695,12 @@ ERepository::make_id(const QualifiedPackageName & q, const FSPath & f) const
{
Context context("When creating ID for '" + stringify(q) + "' from '" + stringify(f) + "':");
- std::shared_ptr<EbuildID> result(std::make_shared<EbuildID>(q, extract_package_file_version(q, f),
+ std::string suffix_eapi(FileSuffixes::get_instance()->guess_eapi_from_filename(q, f));
+ std::string eapi(suffix_eapi.empty() ? _imp->params.eapi_when_unknown() : suffix_eapi);
+
+ std::shared_ptr<EbuildID> result(std::make_shared<EbuildID>(q, extract_package_file_version(q, f, eapi),
_imp->params.environment(),
- name(), f, FileSuffixes::get_instance()->guess_eapi_from_filename(q, f),
+ name(), f, eapi,
_imp->master_mtime, _imp->eclass_mtimes));
return result;
}
@@ -1929,7 +1932,7 @@ ERepository::merge(const MergeParams & m)
}
VersionSpec
-ERepository::extract_package_file_version(const QualifiedPackageName & n, const FSPath & e) const
+ERepository::extract_package_file_version(const QualifiedPackageName & n, const FSPath & e, const std::string & eapi) const
{
Context context("When extracting version from '" + stringify(e) + "':");
std::string::size_type p(e.basename().rfind('.'));
@@ -1937,7 +1940,7 @@ ERepository::extract_package_file_version(const QualifiedPackageName & n, const
throw InternalError(PALUDIS_HERE, "got npos");
return VersionSpec(strip_leading_string(e.basename().substr(0, p), stringify(n.package()) + "-"),
EAPIData::get_instance()->eapi_from_string(
- _imp->params.eapi_when_unknown())->supported()->version_spec_options());
+ eapi)->supported()->version_spec_options());
}
const std::string