aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAvatar Mike Kelly <pioto@pioto.org> 2007-05-29 04:26:50 +0000
committerAvatar Mike Kelly <pioto@pioto.org> 2007-05-29 04:26:50 +0000
commit6d9bd926b7a8be542cd4828304ff03bc9820c074 (patch)
treeed0378c4a6a548d32060730d7f97cd303017159f
parente989c6c1ddb84d44fcc11beea48cfa0a6d7a2976 (diff)
downloadpaludis-6d9bd926b7a8be542cd4828304ff03bc9820c074.tar.gz
paludis-6d9bd926b7a8be542cd4828304ff03bc9820c074.tar.xz
Add two new members to Layout: package_directory and category_directory.
-rw-r--r--paludis/repositories/gentoo/ebin_entries.cc4
-rw-r--r--paludis/repositories/gentoo/ebuild.hh20
-rw-r--r--paludis/repositories/gentoo/ebuild_entries.cc27
-rw-r--r--paludis/repositories/gentoo/layout.hh6
-rw-r--r--paludis/repositories/gentoo/portage_repository.cc6
-rw-r--r--paludis/repositories/gentoo/portage_repository.hh6
-rw-r--r--paludis/repositories/gentoo/traditional_layout.cc11
-rw-r--r--paludis/repositories/gentoo/traditional_layout.hh6
8 files changed, 46 insertions, 40 deletions
diff --git a/paludis/repositories/gentoo/ebin_entries.cc b/paludis/repositories/gentoo/ebin_entries.cc
index 36f43a0..c83f19d 100644
--- a/paludis/repositories/gentoo/ebin_entries.cc
+++ b/paludis/repositories/gentoo/ebin_entries.cc
@@ -73,8 +73,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->portage_repository->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.hh b/paludis/repositories/gentoo/ebuild.hh
index 4db24dc..21401bc 100644
--- a/paludis/repositories/gentoo/ebuild.hh
+++ b/paludis/repositories/gentoo/ebuild.hh
@@ -35,26 +35,6 @@
namespace paludis
{
- /**
- * Keys for EbuildCommandParams.
- *
- * \see EbuildCommandParams
- *
- * \ingroup grpebuildinterface
- */
- enum EbuildCommandParamsKeys
- {
- ecpk_environment,
- ecpk_db_entry,
- ecpk_ebuild_dir,
- ecpk_files_dir,
- ecpk_eclassdirs,
- ecpk_portdir,
- ecpk_distdir,
- ecpk_buildroot,
- last_ecpk
- };
-
class Environment;
class Command;
diff --git a/paludis/repositories/gentoo/ebuild_entries.cc b/paludis/repositories/gentoo/ebuild_entries.cc
index 1f7d7b1..d7a736d 100644
--- a/paludis/repositories/gentoo/ebuild_entries.cc
+++ b/paludis/repositories/gentoo/ebuild_entries.cc
@@ -95,8 +95,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->portage_repository->layout()->package_directory(q) / (stringify(q.package) + "-" + stringify(v) + ".ebuild"));
FSEntry cache_file(_imp->params.cache);
cache_file /= stringify(q.category);
@@ -138,10 +137,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->portage_repository->layout()->package_directory(q))
+ .files_dir(_imp->portage_repository->layout()->package_directory(q) / "files")
.eclassdirs(_imp->params.eclassdirs)
.portdir(_imp->params.master_repository ? _imp->params.master_repository->params().location :
_imp->params.location)
@@ -466,10 +463,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->portage_repository->layout()->package_directory(q))
+ .files_dir(_imp->portage_repository->layout()->package_directory(q) / "files")
.eclassdirs(_imp->params.eclassdirs)
.portdir(_imp->params.master_repository ? _imp->params.master_repository->params().location :
_imp->params.location)
@@ -642,10 +637,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->portage_repository->layout()->package_directory(q))
+ .files_dir(_imp->portage_repository->layout()->package_directory(q) / "files")
.eclassdirs(_imp->params.eclassdirs)
.portdir(_imp->params.master_repository ? _imp->params.master_repository->params().location :
_imp->params.location)
@@ -718,10 +711,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->portage_repository->layout()->package_directory(q))
+ .files_dir(_imp->portage_repository->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/portage_repository.cc b/paludis/repositories/gentoo/portage_repository.cc
index df1965a..3d9c93e 100644
--- a/paludis/repositories/gentoo/portage_repository.cc
+++ b/paludis/repositories/gentoo/portage_repository.cc
@@ -649,6 +649,12 @@ PortageRepository::update_news() const
_imp->news_ptr->update_news();
}
+const tr1::shared_ptr<const Layout>
+PortageRepository::layout() const
+{
+ return _imp->layout;
+}
+
std::string
PortageRepository::get_environment_variable(
const PackageDatabaseEntry & for_package,
diff --git a/paludis/repositories/gentoo/portage_repository.hh b/paludis/repositories/gentoo/portage_repository.hh
index 6c38c8e..8fa2d86 100644
--- a/paludis/repositories/gentoo/portage_repository.hh
+++ b/paludis/repositories/gentoo/portage_repository.hh
@@ -26,6 +26,7 @@
#include <paludis/util/private_implementation_pattern.hh>
#include <paludis/repositories/gentoo/portage_repository_params.hh>
#include <paludis/repositories/gentoo/portage_repository_profile.hh>
+#include <paludis/repositories/gentoo/layout.hh>
#include <string>
/** \file
@@ -191,6 +192,11 @@ namespace paludis
*/
void update_news() const;
+ /**
+ * Gives our current Layout
+ */
+ const tr1::shared_ptr<const Layout> layout() const;
+
};
}
diff --git a/paludis/repositories/gentoo/traditional_layout.cc b/paludis/repositories/gentoo/traditional_layout.cc
index 2d94118..c1c6f37 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->tree_root / stringify(qpn.category) / stringify(qpn.package);
+}
+
+FSEntry
+TraditionalLayout::category_directory(const CategoryNamePart & cat) const
+{
+ return _imp->tree_root / stringify(cat);
+}
diff --git a/paludis/repositories/gentoo/traditional_layout.hh b/paludis/repositories/gentoo/traditional_layout.hh
index 43cae02..f2ac042 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));
+
+ virtual FSEntry category_directory(const CategoryNamePart &) const
+ PALUDIS_ATTRIBUTE((warn_unused_result));
};
}