aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAvatar Mike Kelly <pioto@pioto.org> 2007-05-24 17:45:05 +0000
committerAvatar Mike Kelly <pioto@pioto.org> 2007-05-24 17:45:05 +0000
commit3452de33755ad91a977aab8fb86dd7eed0a02ae1 (patch)
tree0edaed50e71c89791af3ce55e269bb782f3e87f6
parent3741d5bc04b6bc2bd89be72735d3bb371da51aa6 (diff)
downloadpaludis-3452de33755ad91a977aab8fb86dd7eed0a02ae1.tar.gz
paludis-3452de33755ad91a977aab8fb86dd7eed0a02ae1.tar.xz
Add package_directory and category_directory to the PortageRepository Layout stuff.
-rw-r--r--paludis/repositories/gentoo/ebin_entries.cc4
-rw-r--r--paludis/repositories/gentoo/ebuild_entries.cc27
-rw-r--r--paludis/repositories/gentoo/layout.hh6
-rw-r--r--paludis/repositories/gentoo/traditional_layout.cc11
-rw-r--r--paludis/repositories/gentoo/traditional_layout.hh6
5 files changed, 34 insertions, 20 deletions
diff --git a/paludis/repositories/gentoo/ebin_entries.cc b/paludis/repositories/gentoo/ebin_entries.cc
index 90274ce..1ea8a01 100644
--- a/paludis/repositories/gentoo/ebin_entries.cc
+++ b/paludis/repositories/gentoo/ebin_entries.cc
@@ -72,8 +72,8 @@ EbinEntries::generate_version_metadata(const QualifiedPackageName & q,
tr1::shared_ptr<EbinVersionMetadata> result(new EbinVersionMetadata(SlotName("unset")));
- KeyValueConfigFile f(_imp->params.location / stringify(q.category) /
- stringify(q.package) / (stringify(q.package) + "-" + stringify(v) + ".ebin"),
+ KeyValueConfigFile f(_imp->layout->package_directory(q) /
+ (stringify(q.package) + "-" + stringify(v) + ".ebin"),
KeyValueConfigFileOptions() + kvcfo_disallow_continuations + kvcfo_disallow_comments +
kvcfo_disallow_space_around_equals + kvcfo_disallow_source);
diff --git a/paludis/repositories/gentoo/ebuild_entries.cc b/paludis/repositories/gentoo/ebuild_entries.cc
index aae35b7..d3e6408 100644
--- a/paludis/repositories/gentoo/ebuild_entries.cc
+++ b/paludis/repositories/gentoo/ebuild_entries.cc
@@ -94,8 +94,7 @@ EbuildEntries::generate_version_metadata(const QualifiedPackageName & q,
tr1::shared_ptr<EbuildVersionMetadata> result(new EbuildVersionMetadata);
- FSEntry ebuild_file(_imp->params.location / stringify(q.category) /
- stringify(q.package) / (stringify(q.package) + "-" + stringify(v) + ".ebuild"));
+ FSEntry ebuild_file(_imp->layout->package_directory(q) / (stringify(q.package) + "-" + stringify(v) + ".ebuild"));
FSEntry cache_file(_imp->params.cache);
cache_file /= stringify(q.category);
@@ -137,10 +136,8 @@ EbuildEntries::generate_version_metadata(const QualifiedPackageName & q,
EbuildMetadataCommand cmd(EbuildCommandParams::create()
.environment(_imp->environment)
.db_entry(&e)
- .ebuild_dir(_imp->params.location / stringify(q.category) /
- stringify(q.package))
- .files_dir(_imp->params.location / stringify(q.category) /
- stringify(q.package) / "files")
+ .ebuild_dir(_imp->layout->package_directory(q))
+ .files_dir(_imp->layout->package_directory(q) / "files")
.eclassdirs(_imp->params.eclassdirs)
.portdir(_imp->params.master_repository ? _imp->params.master_repository->params().location :
_imp->params.location)
@@ -481,10 +478,8 @@ EbuildEntries::install(const QualifiedPackageName & q, const VersionSpec & v,
EbuildCommandParams command_params(EbuildCommandParams::create()
.environment(_imp->params.environment)
.db_entry(&e)
- .ebuild_dir(_imp->params.location / stringify(q.category) /
- stringify(q.package))
- .files_dir(_imp->params.location / stringify(q.category) /
- stringify(q.package) / "files")
+ .ebuild_dir(_imp->layout->package_directory(q))
+ .files_dir(_imp->layout->package_directory(q) / "files")
.eclassdirs(_imp->params.eclassdirs)
.portdir(_imp->params.master_repository ? _imp->params.master_repository->params().location :
_imp->params.location)
@@ -656,10 +651,8 @@ EbuildEntries::get_environment_variable(const QualifiedPackageName & q,
EbuildVariableCommand cmd(EbuildCommandParams::create()
.environment(_imp->params.environment)
.db_entry(&for_package)
- .ebuild_dir(_imp->params.location / stringify(q.category) /
- stringify(q.package))
- .files_dir(_imp->params.location / stringify(q.category) /
- stringify(q.package) / "files")
+ .ebuild_dir(_imp->layout->package_directory(q))
+ .files_dir(_imp->layout->package_directory(q) / "files")
.eclassdirs(_imp->params.eclassdirs)
.portdir(_imp->params.master_repository ? _imp->params.master_repository->params().location :
_imp->params.location)
@@ -731,10 +724,8 @@ EbuildEntries::pretend(const QualifiedPackageName & q, const VersionSpec & v,
EbuildCommandParams command_params(EbuildCommandParams::create()
.environment(_imp->params.environment)
.db_entry(&e)
- .ebuild_dir(_imp->params.location / stringify(q.category) /
- stringify(q.package))
- .files_dir(_imp->params.location / stringify(q.category) /
- stringify(q.package) / "files")
+ .ebuild_dir(_imp->layout->package_directory(q))
+ .files_dir(_imp->layout->package_directory(q) / "files")
.eclassdirs(_imp->params.eclassdirs)
.portdir(_imp->params.master_repository ? _imp->params.master_repository->params().location :
_imp->params.location)
diff --git a/paludis/repositories/gentoo/layout.hh b/paludis/repositories/gentoo/layout.hh
index ddf8a62..75ec63d 100644
--- a/paludis/repositories/gentoo/layout.hh
+++ b/paludis/repositories/gentoo/layout.hh
@@ -99,6 +99,12 @@ namespace paludis
virtual FSEntry info_variables_file(const FSEntry &) const
PALUDIS_ATTRIBUTE((warn_unused_result)) = 0;
+ virtual FSEntry package_directory(const QualifiedPackageName &) const
+ PALUDIS_ATTRIBUTE((warn_unused_result)) = 0;
+
+ virtual FSEntry category_directory(const CategoryNamePart &) const
+ PALUDIS_ATTRIBUTE((warn_unused_result)) = 0;
+
///\}
};
diff --git a/paludis/repositories/gentoo/traditional_layout.cc b/paludis/repositories/gentoo/traditional_layout.cc
index 2d94118..9498b99 100644
--- a/paludis/repositories/gentoo/traditional_layout.cc
+++ b/paludis/repositories/gentoo/traditional_layout.cc
@@ -358,3 +358,14 @@ TraditionalLayout::info_variables_file(const FSEntry & dir) const
return dir / "info_vars";
}
+FSEntry
+TraditionalLayout::package_directory(const QualifiedPackageName & qpn) const
+{
+ return _imp->params.location / stringify(qpn.category) / stringify(qpn.package);
+}
+
+FSEntry
+TraditionalLayout::category_directory(const CategoryNamePart & cat) const
+{
+ return _imp->params.location / stringify(qpn.category);
+}
diff --git a/paludis/repositories/gentoo/traditional_layout.hh b/paludis/repositories/gentoo/traditional_layout.hh
index 43cae02..4e80948 100644
--- a/paludis/repositories/gentoo/traditional_layout.hh
+++ b/paludis/repositories/gentoo/traditional_layout.hh
@@ -77,6 +77,12 @@ namespace paludis
virtual FSEntry info_variables_file(const FSEntry &) const
PALUDIS_ATTRIBUTE((warn_unused_result));
+
+ virtual FSEntry package_directory(const QualifiedPackageName &) const
+ PALUDIS_ATTRIBUTE((warn_unused_result)) = 0;
+
+ virtual FSEntry category_directory(const CategoryNamePart &) const
+ PALUDIS_ATTRIBUTE((warn_unused_result)) = 0;
};
}