aboutsummaryrefslogtreecommitdiff
path: root/paludis/repositories/e
diff options
context:
space:
mode:
Diffstat (limited to 'paludis/repositories/e')
-rw-r--r--paludis/repositories/e/check_fetched_files_visitor.cc25
-rw-r--r--paludis/repositories/e/check_fetched_files_visitor.hh9
-rw-r--r--paludis/repositories/e/dep_spec_pretty_printer.cc1
-rw-r--r--paludis/repositories/e/depend_rdepend_TEST.cc12
-rw-r--r--paludis/repositories/e/e_installed_repository.cc37
-rw-r--r--paludis/repositories/e/e_installed_repository.hh4
-rw-r--r--paludis/repositories/e/e_installed_repository_id.cc112
-rw-r--r--paludis/repositories/e/e_installed_repository_id.hh5
-rw-r--r--paludis/repositories/e/e_key.cc29
-rw-r--r--paludis/repositories/e/e_key.hh7
-rw-r--r--paludis/repositories/e/e_repository.cc313
-rw-r--r--paludis/repositories/e/e_repository.hh17
-rw-r--r--paludis/repositories/e/e_repository_TEST.cc151
-rw-r--r--paludis/repositories/e/e_repository_TEST_0.cc8
-rw-r--r--paludis/repositories/e/e_repository_TEST_1.cc8
-rw-r--r--paludis/repositories/e/e_repository_TEST_2.cc8
-rw-r--r--paludis/repositories/e/e_repository_TEST_3.cc8
-rw-r--r--paludis/repositories/e/e_repository_TEST_4.cc8
-rw-r--r--paludis/repositories/e/e_repository_TEST_dependencies_rewriter.cc6
-rw-r--r--paludis/repositories/e/e_repository_TEST_ever.cc8
-rw-r--r--paludis/repositories/e/e_repository_TEST_exheres_0.cc8
-rw-r--r--paludis/repositories/e/e_repository_TEST_exlibs.cc8
-rw-r--r--paludis/repositories/e/e_repository_TEST_pbin.cc27
-rw-r--r--paludis/repositories/e/e_repository_TEST_phases.cc8
-rw-r--r--paludis/repositories/e/e_repository_TEST_replacing.cc8
-rw-r--r--paludis/repositories/e/e_repository_TEST_symlink_rewriting.cc18
-rw-r--r--paludis/repositories/e/e_repository_mask_file.cc2
-rw-r--r--paludis/repositories/e/e_repository_mask_file.hh3
-rw-r--r--paludis/repositories/e/e_repository_news.cc32
-rw-r--r--paludis/repositories/e/e_repository_news.hh5
-rw-r--r--paludis/repositories/e/e_repository_params.hh27
-rw-r--r--paludis/repositories/e/e_repository_sets.cc32
-rw-r--r--paludis/repositories/e/e_repository_sets_TEST.cc8
-rw-r--r--paludis/repositories/e/e_stripper.cc11
-rw-r--r--paludis/repositories/e/e_stripper.hh15
-rw-r--r--paludis/repositories/e/eapi.cc4
-rw-r--r--paludis/repositories/e/ebuild.cc24
-rw-r--r--paludis/repositories/e/ebuild.hh71
-rw-r--r--paludis/repositories/e/ebuild_flat_metadata_cache.cc107
-rw-r--r--paludis/repositories/e/ebuild_flat_metadata_cache.hh3
-rw-r--r--paludis/repositories/e/ebuild_flat_metadata_cache_TEST.cc278
-rw-r--r--paludis/repositories/e/ebuild_id.cc28
-rw-r--r--paludis/repositories/e/ebuild_id.hh5
-rw-r--r--paludis/repositories/e/eclass_mtimes.cc28
-rw-r--r--paludis/repositories/e/eclass_mtimes.hh12
-rw-r--r--paludis/repositories/e/exheres_layout.cc164
-rw-r--r--paludis/repositories/e/exheres_layout.hh44
-rw-r--r--paludis/repositories/e/exheres_profile.cc30
-rw-r--r--paludis/repositories/e/exheres_profile.hh8
-rw-r--r--paludis/repositories/e/exndbam_id.cc2
-rw-r--r--paludis/repositories/e/exndbam_id.hh4
-rw-r--r--paludis/repositories/e/exndbam_repository.cc69
-rw-r--r--paludis/repositories/e/exndbam_repository.hh10
-rw-r--r--paludis/repositories/e/exndbam_repository_TEST.cc23
-rw-r--r--paludis/repositories/e/extra_distribution_data.cc2
-rw-r--r--paludis/repositories/e/extra_distribution_data.hh4
-rw-r--r--paludis/repositories/e/fetch_visitor.cc32
-rw-r--r--paludis/repositories/e/fetch_visitor.hh5
-rw-r--r--paludis/repositories/e/fetch_visitor_TEST.cc13
-rw-r--r--paludis/repositories/e/fix_locked_dependencies.cc3
-rw-r--r--paludis/repositories/e/info_metadata_key.cc25
-rw-r--r--paludis/repositories/e/info_metadata_key.hh5
-rw-r--r--paludis/repositories/e/layout.cc22
-rw-r--r--paludis/repositories/e/layout.hh52
-rw-r--r--paludis/repositories/e/manifest2_reader.cc11
-rw-r--r--paludis/repositories/e/manifest2_reader.hh3
-rw-r--r--paludis/repositories/e/memoised_hashes.cc15
-rw-r--r--paludis/repositories/e/memoised_hashes.hh4
-rw-r--r--paludis/repositories/e/metadata_xml.cc11
-rw-r--r--paludis/repositories/e/metadata_xml.hh4
-rw-r--r--paludis/repositories/e/pbin_merger.cc21
-rw-r--r--paludis/repositories/e/pbin_merger.hh18
-rw-r--r--paludis/repositories/e/pipe_command_handler.cc6
-rw-r--r--paludis/repositories/e/pretend_fetch_visitor.cc15
-rw-r--r--paludis/repositories/e/pretend_fetch_visitor.hh5
-rw-r--r--paludis/repositories/e/profile.cc4
-rw-r--r--paludis/repositories/e/profile.hh5
-rw-r--r--paludis/repositories/e/profile_file.cc5
-rw-r--r--paludis/repositories/e/profile_file.hh6
-rw-r--r--paludis/repositories/e/traditional_layout.cc171
-rw-r--r--paludis/repositories/e/traditional_layout.hh46
-rw-r--r--paludis/repositories/e/traditional_profile.cc56
-rw-r--r--paludis/repositories/e/traditional_profile.hh6
-rw-r--r--paludis/repositories/e/use_desc.cc9
-rw-r--r--paludis/repositories/e/use_desc.hh4
-rw-r--r--paludis/repositories/e/vdb_id.cc3
-rw-r--r--paludis/repositories/e/vdb_id.hh4
-rw-r--r--paludis/repositories/e/vdb_merger.cc51
-rw-r--r--paludis/repositories/e/vdb_merger.hh28
-rw-r--r--paludis/repositories/e/vdb_merger_TEST.cc55
-rw-r--r--paludis/repositories/e/vdb_repository.cc151
-rw-r--r--paludis/repositories/e/vdb_repository.hh17
-rw-r--r--paludis/repositories/e/vdb_repository_TEST.cc211
-rw-r--r--paludis/repositories/e/vdb_unmerger.cc47
-rw-r--r--paludis/repositories/e/vdb_unmerger.hh9
-rw-r--r--paludis/repositories/e/vdb_unmerger_TEST.cc131
-rw-r--r--paludis/repositories/e/xml_things.cc2
-rw-r--r--paludis/repositories/e/xml_things.hh5
-rw-r--r--paludis/repositories/e/xml_things_handle.hh3
99 files changed, 1622 insertions, 1585 deletions
diff --git a/paludis/repositories/e/check_fetched_files_visitor.cc b/paludis/repositories/e/check_fetched_files_visitor.cc
index 0b6cfa9..94c5a92 100644
--- a/paludis/repositories/e/check_fetched_files_visitor.cc
+++ b/paludis/repositories/e/check_fetched_files_visitor.cc
@@ -31,7 +31,7 @@
#include <paludis/action.hh>
#include <paludis/util/system.hh>
#include <paludis/util/pimp-impl.hh>
-#include <paludis/util/fs_entry.hh>
+#include <paludis/util/fs_stat.hh>
#include <paludis/util/log.hh>
#include <paludis/util/join.hh>
#include <paludis/util/save.hh>
@@ -61,7 +61,7 @@ namespace paludis
{
const Environment * const env;
const std::shared_ptr<const PackageID> id;
- const FSEntry distdir;
+ const FSPath distdir;
const bool check_unneeded;
const bool exclude_unmirrorable;
const bool ignore_unfetched;
@@ -79,10 +79,10 @@ namespace paludis
Imp(
const Environment * const e,
const std::shared_ptr<const PackageID> & i,
- const FSEntry & d,
+ const FSPath & d,
const bool c,
const bool n,
- const FSEntry & m2,
+ const FSPath & m2,
const UseManifest um,
const std::shared_ptr<OutputManager> & md,
const bool x,
@@ -109,10 +109,10 @@ namespace paludis
CheckFetchedFilesVisitor::CheckFetchedFilesVisitor(
const Environment * const e,
const std::shared_ptr<const PackageID> & i,
- const FSEntry & d,
+ const FSPath & d,
const bool c,
const bool n,
- const FSEntry & m2,
+ const FSPath & m2,
const UseManifest um,
const std::shared_ptr<OutputManager> & md,
const bool x,
@@ -189,7 +189,7 @@ CheckFetchedFilesVisitor::visit(const FetchableURISpecTree::NodeType<URILabelsDe
}
bool
-CheckFetchedFilesVisitor::check_distfile_manifest(const FSEntry & distfile)
+CheckFetchedFilesVisitor::check_distfile_manifest(const FSPath & distfile)
{
if (_imp->m2r->begin() == _imp->m2r->end())
{
@@ -225,10 +225,12 @@ CheckFetchedFilesVisitor::check_distfile_manifest(const FSEntry & distfile)
continue;
found = true;
+ FSStat distfile_stat(distfile);
+
Log::get_instance()->message("e.manifest.size", ll_debug, lc_context)
- << "Actual size = " << distfile.file_size()
+ << "Actual size = " << distfile_stat.file_size()
<< "; Manifest file size = " << m->size();
- if (distfile.file_size() != m->size())
+ if (distfile_stat.file_size() != m->size())
{
Log::get_instance()->message("e.manifest.no_size", ll_debug, lc_context)
<< "Malformed Manifest: no file size found";
@@ -375,7 +377,8 @@ CheckFetchedFilesVisitor::visit(const FetchableURISpecTree::NodeType<FetchableUR
_imp->output_manager->stdout_stream() << "Checking '" << node.spec()->filename() << "'... " << std::flush;
- if (! (_imp->distdir / node.spec()->filename()).is_regular_file())
+ FSStat distfile_stat(_imp->distdir / node.spec()->filename());
+ if (! distfile_stat.is_regular_file())
{
if (_imp->in_nofetch)
{
@@ -408,7 +411,7 @@ CheckFetchedFilesVisitor::visit(const FetchableURISpecTree::NodeType<FetchableUR
else
_imp->output_manager->stdout_stream() << "not fetched yet";
}
- else if (0 == (_imp->distdir / node.spec()->filename()).file_size())
+ else if (0 == distfile_stat.file_size())
{
Log::get_instance()->message("e.check_fetched_files.empty", ll_debug, lc_context) << "Empty file for '" << node.spec()->filename() << "'";
_imp->output_manager->stdout_stream() << "empty file";
diff --git a/paludis/repositories/e/check_fetched_files_visitor.hh b/paludis/repositories/e/check_fetched_files_visitor.hh
index ecfb27c..6e96b67 100644
--- a/paludis/repositories/e/check_fetched_files_visitor.hh
+++ b/paludis/repositories/e/check_fetched_files_visitor.hh
@@ -1,7 +1,7 @@
/* vim: set sw=4 sts=4 et foldmethod=syntax : */
/*
- * Copyright (c) 2007, 2008, 2009 Ciaran McCreesh
+ * Copyright (c) 2007, 2008, 2009, 2010 Ciaran McCreesh
*
* This file is part of the Paludis package manager. Paludis is free software;
* you can redistribute it and/or modify it under the terms of the GNU General
@@ -23,7 +23,6 @@
#include <paludis/repositories/e/e_repository_params.hh>
#include <paludis/util/attributes.hh>
#include <paludis/util/pimp.hh>
-#include <paludis/util/fs_entry-fwd.hh>
#include <paludis/output_manager-fwd.hh>
#include <paludis/dep_spec-fwd.hh>
#include <paludis/spec_tree.hh>
@@ -40,16 +39,16 @@ namespace paludis
private Pimp<CheckFetchedFilesVisitor>
{
private:
- bool check_distfile_manifest(const FSEntry & distfile);
+ bool check_distfile_manifest(const FSPath & distfile);
public:
CheckFetchedFilesVisitor(
const Environment * const,
const std::shared_ptr<const PackageID> &,
- const FSEntry & distdir,
+ const FSPath & distdir,
const bool check_unneeded,
const bool fetch_restrict,
- const FSEntry & m2,
+ const FSPath & m2,
const UseManifest um,
const std::shared_ptr<OutputManager> & output_manager,
const bool exclude_unmirrorable,
diff --git a/paludis/repositories/e/dep_spec_pretty_printer.cc b/paludis/repositories/e/dep_spec_pretty_printer.cc
index 2803125..5f20eb8 100644
--- a/paludis/repositories/e/dep_spec_pretty_printer.cc
+++ b/paludis/repositories/e/dep_spec_pretty_printer.cc
@@ -25,7 +25,6 @@
#include <paludis/util/simple_visitor_cast.hh>
#include <paludis/util/pimp-impl.hh>
#include <paludis/util/stringify.hh>
-#include <paludis/util/fs_entry.hh>
#include <paludis/util/set.hh>
#include <paludis/util/options.hh>
#include <paludis/util/indirect_iterator-impl.hh>
diff --git a/paludis/repositories/e/depend_rdepend_TEST.cc b/paludis/repositories/e/depend_rdepend_TEST.cc
index 0e409c6..e0a4a26 100644
--- a/paludis/repositories/e/depend_rdepend_TEST.cc
+++ b/paludis/repositories/e/depend_rdepend_TEST.cc
@@ -105,19 +105,19 @@ namespace
TestEnvironment env;
env.set_paludis_command("/bin/false");
- FSEntry root(FSEntry::cwd() / "depend_rdepend_TEST_dir" / "root");
+ FSPath root(FSPath::cwd() / "depend_rdepend_TEST_dir" / "root");
std::shared_ptr<Map<std::string, std::string> > keys(std::make_shared<Map<std::string, std::string>>());
keys->insert("format", "e");
keys->insert("names_cache", "/var/empty");
- keys->insert("location", stringify(FSEntry::cwd() / "depend_rdepend_TEST_dir" / "repo"));
- keys->insert("profiles", stringify(FSEntry::cwd() / "depend_rdepend_TEST_dir" / "repo/profiles/profile"));
+ keys->insert("location", stringify(FSPath::cwd() / "depend_rdepend_TEST_dir" / "repo"));
+ keys->insert("profiles", stringify(FSPath::cwd() / "depend_rdepend_TEST_dir" / "repo/profiles/profile"));
keys->insert("layout", "traditional");
keys->insert("eapi_when_unknown", "0");
keys->insert("eapi_when_unspecified", "0");
keys->insert("profile_eapi", "0");
- keys->insert("distdir", stringify(FSEntry::cwd() / "depend_rdepend_TEST_dir" / "distdir"));
- keys->insert("builddir", stringify(FSEntry::cwd() / "depend_rdepend_TEST_dir" / "build"));
+ keys->insert("distdir", stringify(FSPath::cwd() / "depend_rdepend_TEST_dir" / "distdir"));
+ keys->insert("builddir", stringify(FSPath::cwd() / "depend_rdepend_TEST_dir" / "build"));
keys->insert("root", stringify(root));
std::shared_ptr<Repository> repo(ERepository::repository_factory_create(&env,
std::bind(from_keys, keys, std::placeholders::_1)));
@@ -127,7 +127,7 @@ namespace
v_keys->insert("format", "vdb");
v_keys->insert("names_cache", "/var/empty");
v_keys->insert("provides_cache", "/var/empty");
- v_keys->insert("location", stringify(FSEntry::cwd() / "depend_rdepend_TEST_dir" / "vdb"));
+ v_keys->insert("location", stringify(FSPath::cwd() / "depend_rdepend_TEST_dir" / "vdb"));
v_keys->insert("root", stringify(root));
std::shared_ptr<Repository> v_repo(VDBRepository::repository_factory_create(&env,
std::bind(from_keys, keys, std::placeholders::_1)));
diff --git a/paludis/repositories/e/e_installed_repository.cc b/paludis/repositories/e/e_installed_repository.cc
index 97aaeb9..b305e81 100644
--- a/paludis/repositories/e/e_installed_repository.cc
+++ b/paludis/repositories/e/e_installed_repository.cc
@@ -38,6 +38,7 @@
#include <paludis/util/wrapped_forward_iterator.hh>
#include <paludis/util/safe_ifstream.hh>
#include <paludis/util/process.hh>
+#include <paludis/util/fs_stat.hh>
#include <paludis/action.hh>
#include <paludis/package_id.hh>
#include <paludis/metadata_key.hh>
@@ -190,18 +191,18 @@ EInstalledRepository::get_environment_variable(
Context context("When fetching environment variable '" + var + "' for '" +
stringify(*id) + "':");
- FSEntry ver_dir(id->fs_location_key()->value());
+ FSPath ver_dir(id->fs_location_key()->value());
- if (! ver_dir.is_directory_or_symlink_to_directory())
+ if (! ver_dir.stat().is_directory_or_symlink_to_directory())
throw ActionFailedError("Could not find Exndbam entry for '" + stringify(*id) + "'");
- if ((ver_dir / var).is_regular_file_or_symlink_to_regular_file())
+ if ((ver_dir / var).stat().is_regular_file_or_symlink_to_regular_file())
{
SafeIFStream f(ver_dir / var);
return strip_trailing_string(
std::string((std::istreambuf_iterator<char>(f)), std::istreambuf_iterator<char>()), "\n");
}
- else if ((ver_dir / "environment.bz2").is_regular_file_or_symlink_to_regular_file())
+ else if ((ver_dir / "environment.bz2").stat().is_regular_file_or_symlink_to_regular_file())
{
std::stringstream p;
Process env_process(ProcessCommand({"bash", "-c", "'( bunzip2 < " + stringify(ver_dir / "environment.bz2" ) +
@@ -226,18 +227,18 @@ EInstalledRepository::perform_config(
{
Context context("When configuring '" + stringify(*id) + "':");
- if (! _imp->params.root().is_directory())
+ if (! _imp->params.root().stat().is_directory())
throw ActionFailedError("Couldn't configure '" + stringify(*id) +
"' because root ('" + stringify(_imp->params.root()) + "') is not a directory");
std::shared_ptr<OutputManager> output_manager(a.options.make_output_manager()(a));
- FSEntry ver_dir(id->fs_location_key()->value());
+ FSPath ver_dir(id->fs_location_key()->value());
- std::shared_ptr<FSEntrySequence> eclassdirs(std::make_shared<FSEntrySequence>());
+ std::shared_ptr<FSPathSequence> eclassdirs(std::make_shared<FSPathSequence>());
eclassdirs->push_back(ver_dir);
- std::shared_ptr<FSEntry> load_env(std::make_shared<FSEntry>(ver_dir / "environment.bz2"));
+ FSPath load_env(ver_dir / "environment.bz2");
EAPIPhases phases(id->eapi()->supported()->ebuild_phases()->ebuild_config());
for (EAPIPhases::ConstIterator phase(phases.begin_phases()), phase_end(phases.end_phases()) ;
@@ -252,7 +253,7 @@ EInstalledRepository::perform_config(
n::ebuild_file() = ver_dir / (stringify(id->name().package()) + "-" + stringify(id->version()) + ".ebuild"),
n::eclassdirs() = eclassdirs,
n::environment() = _imp->params.environment(),
- n::exlibsdirs() = std::make_shared<FSEntrySequence>(),
+ n::exlibsdirs() = std::make_shared<FSPathSequence>(),
n::files_dir() = ver_dir,
n::maybe_output_manager() = output_manager,
n::package_builddir() = _imp->params.builddir() / (stringify(id->name().category()) + "-" + stringify(id->name().package()) + "-" + stringify(id->version()) + "-config"),
@@ -265,7 +266,7 @@ EInstalledRepository::perform_config(
),
make_named_values<EbuildConfigCommandParams>(
- n::load_environment() = load_env.get()
+ n::load_environment() = &load_env
));
config_cmd();
@@ -281,18 +282,18 @@ EInstalledRepository::perform_info(
{
Context context("When infoing '" + stringify(*id) + "':");
- if (! _imp->params.root().is_directory())
+ if (! _imp->params.root().stat().is_directory())
throw ActionFailedError("Couldn't info '" + stringify(*id) +
"' because root ('" + stringify(_imp->params.root()) + "') is not a directory");
std::shared_ptr<OutputManager> output_manager(a.options.make_output_manager()(a));
- FSEntry ver_dir(id->fs_location_key()->value());
+ FSPath ver_dir(id->fs_location_key()->value());
- std::shared_ptr<FSEntrySequence> eclassdirs(std::make_shared<FSEntrySequence>());
+ auto eclassdirs(std::make_shared<FSPathSequence>());
eclassdirs->push_back(ver_dir);
- std::shared_ptr<FSEntry> load_env(std::make_shared<FSEntry>(ver_dir / "environment.bz2"));
+ FSPath load_env(ver_dir / "environment.bz2");
EAPIPhases phases(id->eapi()->supported()->ebuild_phases()->ebuild_info());
@@ -361,7 +362,7 @@ EInstalledRepository::perform_info(
n::ebuild_file() = ver_dir / (stringify(id->name().package()) + "-" + stringify(id->version()) + ".ebuild"),
n::eclassdirs() = eclassdirs,
n::environment() = _imp->params.environment(),
- n::exlibsdirs() = std::make_shared<FSEntrySequence>(),
+ n::exlibsdirs() = std::make_shared<FSPathSequence>(),
n::files_dir() = ver_dir,
n::maybe_output_manager() = output_manager,
n::package_builddir() = _imp->params.builddir() / (stringify(id->name().category()) + "-" + stringify(id->name().package()) + "-" + stringify(id->version()) + "-info"),
@@ -376,9 +377,9 @@ EInstalledRepository::perform_info(
make_named_values<EbuildInfoCommandParams>(
n::expand_vars() = std::make_shared<Map<std::string, std::string> >(),
n::info_vars() = i ? i : std::make_shared<const Set<std::string> >(),
- n::load_environment() = load_env.get(),
- n::profiles() = std::make_shared<FSEntrySequence>(),
- n::profiles_with_parents() = std::make_shared<FSEntrySequence>(),
+ n::load_environment() = &load_env,
+ n::profiles() = std::make_shared<FSPathSequence>(),
+ n::profiles_with_parents() = std::make_shared<FSPathSequence>(),
n::use() = "",
n::use_ebuild_file() = false,
n::use_expand() = "",
diff --git a/paludis/repositories/e/e_installed_repository.hh b/paludis/repositories/e/e_installed_repository.hh
index 2950dec..e028bda 100644
--- a/paludis/repositories/e/e_installed_repository.hh
+++ b/paludis/repositories/e/e_installed_repository.hh
@@ -36,9 +36,9 @@ namespace paludis
{
struct EInstalledRepositoryParams
{
- NamedValue<n::builddir, FSEntry> builddir;
+ NamedValue<n::builddir, FSPath> builddir;
NamedValue<n::environment, Environment *> environment;
- NamedValue<n::root, FSEntry> root;
+ NamedValue<n::root, FSPath> root;
};
class EInstalledRepository :
diff --git a/paludis/repositories/e/e_installed_repository_id.cc b/paludis/repositories/e/e_installed_repository_id.cc
index 8c04dd4..fd4b01a 100644
--- a/paludis/repositories/e/e_installed_repository_id.cc
+++ b/paludis/repositories/e/e_installed_repository_id.cc
@@ -27,13 +27,6 @@
#include <paludis/repositories/e/dependencies_rewriter.hh>
#include <paludis/repositories/e/e_choice_value.hh>
-#include <paludis/name.hh>
-#include <paludis/version_spec.hh>
-#include <paludis/repository.hh>
-#include <paludis/distribution.hh>
-#include <paludis/environment.hh>
-#include <paludis/action.hh>
-#include <paludis/util/fs_entry.hh>
#include <paludis/util/stringify.hh>
#include <paludis/util/log.hh>
#include <paludis/util/pimp-impl.hh>
@@ -44,10 +37,19 @@
#include <paludis/util/make_named_values.hh>
#include <paludis/util/return_literal_function.hh>
#include <paludis/util/make_null_shared_ptr.hh>
+#include <paludis/util/fs_stat.hh>
+
+#include <paludis/name.hh>
+#include <paludis/version_spec.hh>
+#include <paludis/repository.hh>
+#include <paludis/distribution.hh>
+#include <paludis/environment.hh>
+#include <paludis/action.hh>
#include <paludis/output_manager.hh>
#include <paludis/literal_metadata_key.hh>
#include <paludis/user_dep_spec.hh>
#include <paludis/elike_choices.hh>
+
#include <iterator>
using namespace paludis;
@@ -55,7 +57,7 @@ using namespace paludis::erepository;
namespace
{
- std::string file_contents(const FSEntry & f)
+ std::string file_contents(const FSPath & f)
{
Context c("When reading '" + stringify(f) + "':");
SafeIFStream i(f);
@@ -120,12 +122,12 @@ namespace paludis
const VersionSpec version;
const Environment * const environment;
const std::shared_ptr<const Repository> repository;
- const FSEntry dir;
+ const FSPath dir;
mutable std::shared_ptr<EInstalledRepositoryIDKeys> keys;
/* fs location and eapi are special */
- std::shared_ptr<const MetadataValueKey<FSEntry> > fs_location;
+ std::shared_ptr<const MetadataValueKey<FSPath> > fs_location;
std::shared_ptr<const EAPI> eapi;
std::shared_ptr<DependenciesLabelSequence> raw_dependencies_labels;
@@ -135,7 +137,7 @@ namespace paludis
Imp(const QualifiedPackageName & q, const VersionSpec & v,
const Environment * const e,
- const std::shared_ptr<const Repository> r, const FSEntry & f) :
+ const std::shared_ptr<const Repository> r, const FSPath & f) :
name(q),
version(v),
environment(e),
@@ -164,7 +166,7 @@ namespace paludis
EInstalledRepositoryID::EInstalledRepositoryID(const QualifiedPackageName & q, const VersionSpec & v,
const Environment * const e,
const std::shared_ptr<const Repository> & r,
- const FSEntry & f) :
+ const FSPath & f) :
Pimp<EInstalledRepositoryID>(q, v, e, r, f),
_imp(Pimp<EInstalledRepositoryID>::_imp)
{
@@ -187,7 +189,7 @@ EInstalledRepositoryID::need_keys_added() const
// at the top, other keys use it.
if (! _imp->fs_location)
{
- _imp->fs_location = std::make_shared<LiteralMetadataValueKey<FSEntry> >(fs_location_raw_name(), fs_location_human_name(),
+ _imp->fs_location = std::make_shared<LiteralMetadataValueKey<FSPath> >(fs_location_raw_name(), fs_location_human_name(),
mkt_internal, _imp->dir);
add_metadata_key(_imp->fs_location);
}
@@ -208,7 +210,7 @@ EInstalledRepositoryID::need_keys_added() const
std::shared_ptr<const EAPIEbuildEnvironmentVariables> env(eapi()->supported()->ebuild_environment_variables());
if (! env->env_use().empty())
- if ((_imp->dir / env->env_use()).exists())
+ if ((_imp->dir / env->env_use()).stat().exists())
{
_imp->keys->raw_use = std::make_shared<EStringSetKey>(shared_from_this(), env->env_use(), env->description_use(),
file_contents(_imp->dir / env->env_use()), mkt_internal);
@@ -216,7 +218,7 @@ EInstalledRepositoryID::need_keys_added() const
}
if (! vars->slot()->name().empty())
- if ((_imp->dir / vars->slot()->name()).exists())
+ if ((_imp->dir / vars->slot()->name()).stat().exists())
{
_imp->keys->slot = std::make_shared<LiteralMetadataValueKey<SlotName>>(vars->slot()->name(), vars->slot()->description(),
mkt_internal, SlotName(file_contents(_imp->dir / vars->slot()->name())));
@@ -224,7 +226,7 @@ EInstalledRepositoryID::need_keys_added() const
}
if (! vars->inherited()->name().empty())
- if ((_imp->dir / vars->inherited()->name()).exists())
+ if ((_imp->dir / vars->inherited()->name()).stat().exists())
{
_imp->keys->inherited = std::make_shared<EStringSetKey>(shared_from_this(), vars->inherited()->name(), vars->inherited()->description(),
file_contents(_imp->dir / vars->inherited()->name()), mkt_internal);
@@ -232,7 +234,7 @@ EInstalledRepositoryID::need_keys_added() const
}
if (! vars->defined_phases()->name().empty())
- if ((_imp->dir / vars->defined_phases()->name()).exists())
+ if ((_imp->dir / vars->defined_phases()->name()).stat().exists())
{
std::string d(file_contents(_imp->dir / vars->defined_phases()->name()));
if (! d.empty())
@@ -245,7 +247,7 @@ EInstalledRepositoryID::need_keys_added() const
if (! vars->iuse()->name().empty())
{
- if ((_imp->dir / vars->iuse()->name()).exists())
+ if ((_imp->dir / vars->iuse()->name()).stat().exists())
_imp->keys->raw_iuse = std::make_shared<EStringSetKey>(shared_from_this(), vars->iuse()->name(), vars->iuse()->description(),
file_contents(_imp->dir / vars->iuse()->name()), mkt_internal);
else
@@ -260,7 +262,7 @@ EInstalledRepositoryID::need_keys_added() const
if (! vars->iuse_effective()->name().empty())
{
- if ((_imp->dir / vars->iuse_effective()->name()).exists())
+ if ((_imp->dir / vars->iuse_effective()->name()).stat().exists())
{
_imp->keys->raw_iuse_effective = std::make_shared<EStringSetKey>(
shared_from_this(), vars->iuse_effective()->name(), vars->iuse_effective()->description(),
@@ -270,7 +272,7 @@ EInstalledRepositoryID::need_keys_added() const
}
if (! vars->myoptions()->name().empty())
- if ((_imp->dir / vars->myoptions()->name()).exists())
+ if ((_imp->dir / vars->myoptions()->name()).stat().exists())
{
_imp->keys->raw_myoptions = std::make_shared<EMyOptionsKey>(_imp->environment, shared_from_this(), vars->myoptions()->name(),
vars->myoptions()->description(), file_contents(_imp->dir / vars->myoptions()->name()), mkt_internal);
@@ -278,7 +280,7 @@ EInstalledRepositoryID::need_keys_added() const
}
if (! vars->use_expand()->name().empty())
- if ((_imp->dir / vars->use_expand()->name()).exists())
+ if ((_imp->dir / vars->use_expand()->name()).stat().exists())
{
_imp->keys->raw_use_expand = std::make_shared<EStringSetKey>(shared_from_this(), vars->use_expand()->name(), vars->use_expand()->description(),
file_contents(_imp->dir / vars->use_expand()->name()), mkt_internal);
@@ -286,7 +288,7 @@ EInstalledRepositoryID::need_keys_added() const
}
if (! vars->use_expand_hidden()->name().empty())
- if ((_imp->dir / vars->use_expand_hidden()->name()).exists())
+ if ((_imp->dir / vars->use_expand_hidden()->name()).stat().exists())
{
_imp->keys->raw_use_expand_hidden = std::make_shared<EStringSetKey>(shared_from_this(), vars->use_expand_hidden()->name(), vars->use_expand_hidden()->description(),
file_contents(_imp->dir / vars->use_expand_hidden()->name()), mkt_internal);
@@ -294,7 +296,7 @@ EInstalledRepositoryID::need_keys_added() const
}
if (! vars->license()->name().empty())
- if ((_imp->dir / vars->license()->name()).exists())
+ if ((_imp->dir / vars->license()->name()).stat().exists())
{
_imp->keys->license = std::make_shared<ELicenseKey>(_imp->environment, shared_from_this(), vars->license(),
file_contents(_imp->dir / vars->license()->name()), mkt_normal);
@@ -302,7 +304,7 @@ EInstalledRepositoryID::need_keys_added() const
}
if (! vars->provide()->name().empty())
- if ((_imp->dir / vars->provide()->name()).exists())
+ if ((_imp->dir / vars->provide()->name()).stat().exists())
{
_imp->keys->provide = std::make_shared<EProvideKey>(_imp->environment, shared_from_this(), vars->provide()->name(), vars->provide()->description(),
file_contents(_imp->dir / vars->provide()->name()), mkt_internal);
@@ -311,7 +313,7 @@ EInstalledRepositoryID::need_keys_added() const
if (! vars->dependencies()->name().empty())
{
- if ((_imp->dir / vars->dependencies()->name()).exists())
+ if ((_imp->dir / vars->dependencies()->name()).stat().exists())
{
DependenciesRewriter rewriter;
std::string raw_deps_str(file_contents(_imp->dir / vars->dependencies()->name()));
@@ -339,7 +341,7 @@ EInstalledRepositoryID::need_keys_added() const
else
{
if (! vars->build_depend()->name().empty())
- if ((_imp->dir / vars->build_depend()->name()).exists())
+ if ((_imp->dir / vars->build_depend()->name()).stat().exists())
{
_imp->keys->build_dependencies = std::make_shared<EDependenciesKey>(_imp->environment, shared_from_this(), vars->build_depend()->name(),
vars->build_depend()->description(), file_contents(_imp->dir / vars->build_depend()->name()),
@@ -348,7 +350,7 @@ EInstalledRepositoryID::need_keys_added() const
}
if (! vars->run_depend()->name().empty())
- if ((_imp->dir / vars->run_depend()->name()).exists())
+ if ((_imp->dir / vars->run_depend()->name()).stat().exists())
{
_imp->keys->run_dependencies = std::make_shared<EDependenciesKey>(_imp->environment, shared_from_this(), vars->run_depend()->name(),
vars->run_depend()->description(), file_contents(_imp->dir / vars->run_depend()->name()),
@@ -357,7 +359,7 @@ EInstalledRepositoryID::need_keys_added() const
}
if (! vars->pdepend()->name().empty())
- if ((_imp->dir / vars->pdepend()->name()).exists())
+ if ((_imp->dir / vars->pdepend()->name()).stat().exists())
{
_imp->keys->post_dependencies = std::make_shared<EDependenciesKey>(_imp->environment, shared_from_this(), vars->pdepend()->name(),
vars->pdepend()->description(), file_contents(_imp->dir / vars->pdepend()->name()),
@@ -367,7 +369,7 @@ EInstalledRepositoryID::need_keys_added() const
}
if (! vars->restrictions()->name().empty())
- if ((_imp->dir / vars->restrictions()->name()).exists())
+ if ((_imp->dir / vars->restrictions()->name()).stat().exists())
{
_imp->keys->restrictions = std::make_shared<EPlainTextSpecKey>(_imp->environment, shared_from_this(), vars->restrictions(),
file_contents(_imp->dir / vars->restrictions()->name()), mkt_internal);
@@ -375,7 +377,7 @@ EInstalledRepositoryID::need_keys_added() const
}
if (! vars->properties()->name().empty())
- if ((_imp->dir / vars->properties()->name()).exists())
+ if ((_imp->dir / vars->properties()->name()).stat().exists())
{
_imp->keys->properties = std::make_shared<EPlainTextSpecKey>(_imp->environment, shared_from_this(), vars->properties(),
file_contents(_imp->dir / vars->properties()->name()), mkt_internal);
@@ -383,7 +385,7 @@ EInstalledRepositoryID::need_keys_added() const
}
if (! vars->src_uri()->name().empty())
- if ((_imp->dir / vars->src_uri()->name()).exists())
+ if ((_imp->dir / vars->src_uri()->name()).stat().exists())
{
_imp->keys->src_uri = std::make_shared<EFetchableURIKey>(_imp->environment, shared_from_this(), vars->src_uri(),
file_contents(_imp->dir / vars->src_uri()->name()), mkt_dependencies);
@@ -391,7 +393,7 @@ EInstalledRepositoryID::need_keys_added() const
}
if (! vars->short_description()->name().empty())
- if ((_imp->dir / vars->short_description()->name()).exists())
+ if ((_imp->dir / vars->short_description()->name()).stat().exists())
{
_imp->keys->short_description = std::make_shared<LiteralMetadataValueKey<std::string> >(vars->short_description()->name(),
vars->short_description()->description(), mkt_significant, file_contents(_imp->dir / vars->short_description()->name()));
@@ -399,7 +401,7 @@ EInstalledRepositoryID::need_keys_added() const
}
if (! vars->long_description()->name().empty())
- if ((_imp->dir / vars->long_description()->name()).exists())
+ if ((_imp->dir / vars->long_description()->name()).stat().exists())
{
std::string value(file_contents(_imp->dir / vars->long_description()->name()));
if (! value.empty())
@@ -411,7 +413,7 @@ EInstalledRepositoryID::need_keys_added() const
}
if (! vars->upstream_changelog()->name().empty())
- if ((_imp->dir / vars->upstream_changelog()->name()).exists())
+ if ((_imp->dir / vars->upstream_changelog()->name()).stat().exists())
{
std::string value(file_contents(_imp->dir / vars->upstream_changelog()->name()));
if (! value.empty())
@@ -424,7 +426,7 @@ EInstalledRepositoryID::need_keys_added() const
}
if (! vars->upstream_release_notes()->name().empty())
- if ((_imp->dir / vars->upstream_release_notes()->name()).exists())
+ if ((_imp->dir / vars->upstream_release_notes()->name()).stat().exists())
{
std::string value(file_contents(_imp->dir / vars->upstream_release_notes()->name()));
if (! value.empty())
@@ -437,7 +439,7 @@ EInstalledRepositoryID::need_keys_added() const
}
if (! vars->upstream_documentation()->name().empty())
- if ((_imp->dir / vars->upstream_documentation()->name()).exists())
+ if ((_imp->dir / vars->upstream_documentation()->name()).stat().exists())
{
std::string value(file_contents(_imp->dir / vars->upstream_documentation()->name()));
if (! value.empty())
@@ -450,7 +452,7 @@ EInstalledRepositoryID::need_keys_added() const
}
if (! vars->bugs_to()->name().empty())
- if ((_imp->dir / vars->bugs_to()->name()).exists())
+ if ((_imp->dir / vars->bugs_to()->name()).stat().exists())
{
std::string value(file_contents(_imp->dir / vars->bugs_to()->name()));
if (! value.empty())
@@ -462,7 +464,7 @@ EInstalledRepositoryID::need_keys_added() const
}
if (! vars->remote_ids()->name().empty())
- if ((_imp->dir / vars->remote_ids()->name()).exists())
+ if ((_imp->dir / vars->remote_ids()->name()).stat().exists())
{
std::string value(file_contents(_imp->dir / vars->remote_ids()->name()));
if (! value.empty())
@@ -474,7 +476,7 @@ EInstalledRepositoryID::need_keys_added() const
}
if (! vars->homepage()->name().empty())
- if ((_imp->dir / vars->homepage()->name()).exists())
+ if ((_imp->dir / vars->homepage()->name()).stat().exists())
{
_imp->keys->homepage = std::make_shared<ESimpleURIKey>(_imp->environment, shared_from_this(), vars->homepage()->name(),
vars->homepage()->description(),
@@ -500,11 +502,11 @@ EInstalledRepositoryID::need_keys_added() const
add_metadata_key(_imp->keys->choices);
std::shared_ptr<Set<std::string> > from_repositories_value(std::make_shared<Set<std::string>>());
- if ((_imp->dir / "REPOSITORY").exists())
+ if ((_imp->dir / "REPOSITORY").stat().exists())
from_repositories_value->insert(file_contents(_imp->dir / "REPOSITORY"));
- if ((_imp->dir / "repository").exists())
+ if ((_imp->dir / "repository").stat().exists())
from_repositories_value->insert(file_contents(_imp->dir / "repository"));
- if ((_imp->dir / "BINARY_REPOSITORY").exists())
+ if ((_imp->dir / "BINARY_REPOSITORY").stat().exists())
from_repositories_value->insert(file_contents(_imp->dir / "BINARY_REPOSITORY"));
if (! from_repositories_value->empty())
{
@@ -513,70 +515,70 @@ EInstalledRepositoryID::need_keys_added() const
add_metadata_key(_imp->keys->from_repositories);
}
- if ((_imp->dir / "ASFLAGS").exists())
+ if ((_imp->dir / "ASFLAGS").stat().exists())
{
_imp->keys->asflags = std::make_shared<LiteralMetadataValueKey<std::string> >("ASFLAGS", "ASFLAGS",
mkt_internal, file_contents(_imp->dir / "ASFLAGS"));
add_metadata_key(_imp->keys->asflags);
}
- if ((_imp->dir / "CBUILD").exists())
+ if ((_imp->dir / "CBUILD").stat().exists())
{
_imp->keys->cbuild = std::make_shared<LiteralMetadataValueKey<std::string> >("CBUILD", "CBUILD",
mkt_internal, file_contents(_imp->dir / "CBUILD"));
add_metadata_key(_imp->keys->cbuild);
}
- if ((_imp->dir / "CFLAGS").exists())
+ if ((_imp->dir / "CFLAGS").stat().exists())
{
_imp->keys->cflags = std::make_shared<LiteralMetadataValueKey<std::string> >("CFLAGS", "CFLAGS",
mkt_internal, file_contents(_imp->dir / "CFLAGS"));
add_metadata_key(_imp->keys->cflags);
}
- if ((_imp->dir / "CHOST").exists())
+ if ((_imp->dir / "CHOST").stat().exists())
{
_imp->keys->chost = std::make_shared<LiteralMetadataValueKey<std::string> >("CHOST", "CHOST",
mkt_internal, file_contents(_imp->dir / "CHOST"));
add_metadata_key(_imp->keys->chost);
}
- if ((_imp->dir / "CONFIG_PROTECT").exists())
+ if ((_imp->dir / "CONFIG_PROTECT").stat().exists())
{
_imp->keys->config_protect = std::make_shared<LiteralMetadataValueKey<std::string> >("CONFIG_PROTECT", "CONFIG_PROTECT",
mkt_internal, file_contents(_imp->dir / "CONFIG_PROTECT"));
add_metadata_key(_imp->keys->config_protect);
}
- if ((_imp->dir / "CONFIG_PROTECT_MASK").exists())
+ if ((_imp->dir / "CONFIG_PROTECT_MASK").stat().exists())
{
_imp->keys->config_protect_mask = std::make_shared<LiteralMetadataValueKey<std::string> >("CONFIG_PROTECT_MASK", "CONFIG_PROTECT_MASK",
mkt_internal, file_contents(_imp->dir / "CONFIG_PROTECT_MASK"));
add_metadata_key(_imp->keys->config_protect_mask);
}
- if ((_imp->dir / "CXXFLAGS").exists())
+ if ((_imp->dir / "CXXFLAGS").stat().exists())
{
_imp->keys->cxxflags = std::make_shared<LiteralMetadataValueKey<std::string> >("CXXFLAGS", "CXXFLAGS",
mkt_internal, file_contents(_imp->dir / "CXXFLAGS"));
add_metadata_key(_imp->keys->cxxflags);
}
- if ((_imp->dir / "LDFLAGS").exists())
+ if ((_imp->dir / "LDFLAGS").stat().exists())
{
_imp->keys->ldflags = std::make_shared<LiteralMetadataValueKey<std::string> >("LDFLAGS", "LDFLAGS",
mkt_internal, file_contents(_imp->dir / "LDFLAGS"));
add_metadata_key(_imp->keys->ldflags);
}
- if ((_imp->dir / "PKGMANAGER").exists())
+ if ((_imp->dir / "PKGMANAGER").stat().exists())
{
_imp->keys->pkgmanager = std::make_shared<LiteralMetadataValueKey<std::string> >("PKGMANAGER", "Installed using",
mkt_normal, file_contents(_imp->dir / "PKGMANAGER"));
add_metadata_key(_imp->keys->pkgmanager);
}
- if ((_imp->dir / "VDB_FORMAT").exists())
+ if ((_imp->dir / "VDB_FORMAT").stat().exists())
{
_imp->keys->vdb_format = std::make_shared<LiteralMetadataValueKey<std::string> >("VDB_FORMAT", "VDB Format",
mkt_internal, file_contents(_imp->dir / "VDB_FORMAT"));
@@ -661,7 +663,7 @@ EInstalledRepositoryID::eapi() const
Context context("When finding EAPI for '" + canonical_form(idcf_full) + "':");
- if ((_imp->dir / "EAPI").exists())
+ if ((_imp->dir / "EAPI").stat().exists())
_imp->eapi = EAPIData::get_instance()->eapi_from_string(file_contents(_imp->dir / "EAPI"));
else
{
@@ -867,7 +869,7 @@ EInstalledRepositoryID::from_repositories_key() const
return _imp->keys->from_repositories;
}
-const std::shared_ptr<const MetadataValueKey<FSEntry> >
+const std::shared_ptr<const MetadataValueKey<FSPath> >
EInstalledRepositoryID::fs_location_key() const
{
// Avoid loading whole metadata
@@ -875,7 +877,7 @@ EInstalledRepositoryID::fs_location_key() const
{
Lock l(_imp->mutex);
- _imp->fs_location = std::make_shared<LiteralMetadataValueKey<FSEntry> >(fs_location_raw_name(),
+ _imp->fs_location = std::make_shared<LiteralMetadataValueKey<FSPath> >(fs_location_raw_name(),
fs_location_human_name(), mkt_internal, _imp->dir);
add_metadata_key(_imp->fs_location);
}
diff --git a/paludis/repositories/e/e_installed_repository_id.hh b/paludis/repositories/e/e_installed_repository_id.hh
index 12f4985..16dea83 100644
--- a/paludis/repositories/e/e_installed_repository_id.hh
+++ b/paludis/repositories/e/e_installed_repository_id.hh
@@ -23,7 +23,6 @@
#include <paludis/package_id.hh>
#include <paludis/metadata_key.hh>
#include <paludis/environment-fwd.hh>
-#include <paludis/util/fs_entry-fwd.hh>
#include <paludis/repositories/e/e_repository_id.hh>
namespace paludis
@@ -45,7 +44,7 @@ namespace paludis
EInstalledRepositoryID(const QualifiedPackageName &, const VersionSpec &,
const Environment * const,
const std::shared_ptr<const Repository> &,
- const FSEntry & file);
+ const FSPath & file);
public:
~EInstalledRepositoryID();
@@ -77,7 +76,7 @@ namespace paludis
virtual const std::shared_ptr<const MetadataTimeKey> installed_time_key() const;
virtual const std::shared_ptr<const MetadataCollectionKey<PackageIDSequence> > contains_key() const;
virtual const std::shared_ptr<const MetadataValueKey<std::shared_ptr<const PackageID> > > contained_in_key() const;
- virtual const std::shared_ptr<const MetadataValueKey<FSEntry> > fs_location_key() const;
+ virtual const std::shared_ptr<const MetadataValueKey<FSPath> > fs_location_key() const;
virtual const std::shared_ptr<const MetadataCollectionKey<Set<std::string> > > from_repositories_key() const;
virtual const std::shared_ptr<const MetadataCollectionKey<Set<std::string> > > raw_use_key() const;
diff --git a/paludis/repositories/e/e_key.cc b/paludis/repositories/e/e_key.cc
index e8acece..fb96a94 100644
--- a/paludis/repositories/e/e_key.cc
+++ b/paludis/repositories/e/e_key.cc
@@ -30,7 +30,6 @@
#include <paludis/util/pimp-impl.hh>
#include <paludis/util/stringify.hh>
#include <paludis/util/tokeniser.hh>
-#include <paludis/util/fs_entry.hh>
#include <paludis/util/log.hh>
#include <paludis/util/mutex.hh>
#include <paludis/util/join.hh>
@@ -43,6 +42,8 @@
#include <paludis/util/wrapped_forward_iterator.hh>
#include <paludis/util/wrapped_output_iterator.hh>
#include <paludis/util/timestamp.hh>
+#include <paludis/util/fs_stat.hh>
+#include <paludis/util/fs_error.hh>
#include <paludis/contents.hh>
#include <paludis/repository.hh>
@@ -943,7 +944,7 @@ namespace paludis
struct Imp<EContentsKey>
{
const std::shared_ptr<const ERepositoryID> id;
- const FSEntry filename;
+ const FSPath filename;
mutable Mutex value_mutex;
mutable std::shared_ptr<Contents> value;
@@ -951,7 +952,7 @@ namespace paludis
const std::string human_name;
const MetadataKeyType type;
- Imp(const std::shared_ptr<const ERepositoryID> & i, const FSEntry & v,
+ Imp(const std::shared_ptr<const ERepositoryID> & i, const FSPath & v,
const std::string & r, const std::string & h, const MetadataKeyType & t) :
id(i),
filename(v),
@@ -964,7 +965,7 @@ namespace paludis
}
EContentsKey::EContentsKey(const std::shared_ptr<const ERepositoryID> & id,
- const std::string & r, const std::string & h, const FSEntry & v, const MetadataKeyType t) :
+ const std::string & r, const std::string & h, const FSPath & v, const MetadataKeyType t) :
Pimp<EContentsKey>(id, v, r, h, t)
{
}
@@ -985,8 +986,8 @@ EContentsKey::value() const
_imp->value = std::make_shared<Contents>();
- FSEntry f(_imp->filename);
- if (! f.is_regular_file_or_symlink_to_regular_file())
+ FSPath f(_imp->filename);
+ if (! f.stat().is_regular_file_or_symlink_to_regular_file())
{
Log::get_instance()->message("e.contents.not_a_file", ll_warning, lc_context) << "CONTENTS lookup failed for request for '" <<
*_imp->id << "' using '" << _imp->filename << "'";
@@ -1011,7 +1012,7 @@ EContentsKey::value() const
if ("obj" == tokens.at(0))
{
- std::shared_ptr<ContentsEntry> e(std::make_shared<ContentsFileEntry>(tokens.at(1)));
+ std::shared_ptr<ContentsEntry> e(std::make_shared<ContentsFileEntry>(FSPath(tokens.at(1))));
e->add_metadata_key(std::make_shared<LiteralMetadataTimeKey>("mtime", "mtime", mkt_normal,
Timestamp(destringify<time_t>(tokens.at(3)), 0)));
e->add_metadata_key(std::make_shared<LiteralMetadataValueKey<std::string>>("md5", "md5", mkt_normal, tokens.at(2)));
@@ -1019,18 +1020,18 @@ EContentsKey::value() const
}
else if ("dir" == tokens.at(0))
{
- std::shared_ptr<ContentsEntry> e(std::make_shared<ContentsDirEntry>(tokens.at(1)));
+ std::shared_ptr<ContentsEntry> e(std::make_shared<ContentsDirEntry>(FSPath(tokens.at(1))));
_imp->value->add(e);
}
else if ("sym" == tokens.at(0))
{
- std::shared_ptr<ContentsEntry> e(std::make_shared<ContentsSymEntry>(tokens.at(1), tokens.at(2)));
+ std::shared_ptr<ContentsEntry> e(std::make_shared<ContentsSymEntry>(FSPath(tokens.at(1)), tokens.at(2)));
e->add_metadata_key(std::make_shared<LiteralMetadataTimeKey>("mtime", "mtime", mkt_normal,
Timestamp(destringify<time_t>(tokens.at(3)), 0)));
_imp->value->add(e);
}
else if ("misc" == tokens.at(0) || "fif" == tokens.at(0) || "dev" == tokens.at(0))
- _imp->value->add(std::shared_ptr<ContentsEntry>(std::make_shared<ContentsOtherEntry>(tokens.at(1))));
+ _imp->value->add(std::shared_ptr<ContentsEntry>(std::make_shared<ContentsOtherEntry>(FSPath(tokens.at(1)))));
else
Log::get_instance()->message("e.contents.unknown", ll_warning, lc_context) << "CONTENTS has unsupported entry type '" <<
tokens.at(0) << "', skipping";
@@ -1063,7 +1064,7 @@ namespace paludis
struct Imp<EMTimeKey>
{
const std::shared_ptr<const ERepositoryID> id;
- const FSEntry filename;
+ const FSPath filename;
mutable Mutex value_mutex;
mutable std::shared_ptr<Timestamp> value;
@@ -1071,7 +1072,7 @@ namespace paludis
const std::string human_name;
const MetadataKeyType type;
- Imp(const std::shared_ptr<const ERepositoryID> & i, const FSEntry & v,
+ Imp(const std::shared_ptr<const ERepositoryID> & i, const FSPath & v,
const std::string & r, const std::string & h, const MetadataKeyType t) :
id(i),
filename(v),
@@ -1084,7 +1085,7 @@ namespace paludis
}
EMTimeKey::EMTimeKey(const std::shared_ptr<const ERepositoryID> & id,
- const std::string & r, const std::string & h, const FSEntry & v, const MetadataKeyType t) :
+ const std::string & r, const std::string & h, const FSPath & v, const MetadataKeyType t) :
Pimp<EMTimeKey>(id, v, r, h, t)
{
}
@@ -1105,7 +1106,7 @@ EMTimeKey::value() const
try
{
- *_imp->value = _imp->filename.mtim();
+ *_imp->value = _imp->filename.stat().mtim();
}
catch (const FSError & e)
{
diff --git a/paludis/repositories/e/e_key.hh b/paludis/repositories/e/e_key.hh
index 626113f..695b677 100644
--- a/paludis/repositories/e/e_key.hh
+++ b/paludis/repositories/e/e_key.hh
@@ -1,7 +1,7 @@
/* vim: set sw=4 sts=4 et foldmethod=syntax : */
/*
- * Copyright (c) 2007, 2008, 2009 Ciaran McCreesh
+ * Copyright (c) 2007, 2008, 2009, 2010 Ciaran McCreesh
*
* This file is part of the Paludis package manager. Paludis is free software;
* you can redistribute it and/or modify it under the terms of the GNU General
@@ -21,7 +21,6 @@
#define PALUDIS_GUARD_PALUDIS_REPOSITORIES_GENTOO_E_KEY_HH 1
#include <paludis/metadata_key.hh>
-#include <paludis/util/fs_entry.hh>
#include <paludis/util/set.hh>
#include <paludis/util/map-fwd.hh>
#include <paludis/repositories/e/eapi-fwd.hh>
@@ -289,7 +288,7 @@ namespace paludis
public:
EContentsKey(
const std::shared_ptr<const ERepositoryID> &,
- const std::string &, const std::string &, const FSEntry &, const MetadataKeyType);
+ const std::string &, const std::string &, const FSPath &, const MetadataKeyType);
~EContentsKey();
const std::shared_ptr<const Contents> value() const
@@ -306,7 +305,7 @@ namespace paludis
{
public:
EMTimeKey(const std::shared_ptr<const ERepositoryID> &,
- const std::string &, const std::string &, const FSEntry &, const MetadataKeyType);
+ const std::string &, const std::string &, const FSPath &, const MetadataKeyType);
~EMTimeKey();
Timestamp value() const
diff --git a/paludis/repositories/e/e_repository.cc b/paludis/repositories/e/e_repository.cc
index b1e9a57..e5ab9d7 100644
--- a/paludis/repositories/e/e_repository.cc
+++ b/paludis/repositories/e/e_repository.cc
@@ -68,9 +68,9 @@
#include <paludis/util/config_file.hh>
#include <paludis/util/create_iterator-impl.hh>
#include <paludis/util/destringify.hh>
-#include <paludis/util/dir_iterator.hh>
#include <paludis/util/extract_host_from_url.hh>
-#include <paludis/util/fs_entry.hh>
+#include <paludis/util/fs_stat.hh>
+#include <paludis/util/fs_iterator.hh>
#include <paludis/util/hashes.hh>
#include <paludis/util/indirect_iterator-impl.hh>
#include <paludis/util/singleton-impl.hh>
@@ -135,18 +135,18 @@ typedef std::unordered_map<QualifiedPackageName,
typedef std::unordered_map<std::string, std::shared_ptr<MirrorsSequence> > MirrorMap;
typedef std::unordered_map<QualifiedPackageName, std::shared_ptr<const PackageDepSpec>, Hash<QualifiedPackageName> > VirtualsMap;
-typedef std::map<FSEntry, std::string> EAPIForFileMap;
+typedef std::map<FSPath, std::string, FSPathComparator> EAPIForFileMap;
namespace
{
- std::shared_ptr<FSEntrySequence> get_master_locations(
+ std::shared_ptr<FSPathSequence> get_master_locations(
const std::shared_ptr<const ERepositorySequence> & r)
{
- std::shared_ptr<FSEntrySequence> result;
+ std::shared_ptr<FSPathSequence> result;
if (r)
{
- result = std::make_shared<FSEntrySequence>();
+ result = std::make_shared<FSPathSequence>();
for (ERepositorySequence::ConstIterator e(r->begin()), e_end(r->end()) ;
e != e_end ; ++e)
result->push_back((*e)->location_key()->value());
@@ -220,7 +220,7 @@ namespace paludis
mutable MirrorMap mirrors;
mutable std::shared_ptr<erepository::Profile> profile_ptr;
- mutable std::shared_ptr<const FSEntry> main_profile_path;
+ mutable std::shared_ptr<const FSPath> main_profile_path;
mutable std::shared_ptr<ERepositoryNews> news_ptr;
@@ -237,21 +237,21 @@ namespace paludis
std::shared_ptr<const MetadataValueKey<std::string> > format_key;
std::shared_ptr<const MetadataValueKey<std::string> > layout_key;
std::shared_ptr<const MetadataValueKey<std::string> > profile_layout_key;
- std::shared_ptr<const MetadataValueKey<FSEntry> > location_key;
- std::shared_ptr<const MetadataCollectionKey<FSEntrySequence> > profiles_key;
- std::shared_ptr<const MetadataValueKey<FSEntry> > cache_key;
- std::shared_ptr<const MetadataValueKey<FSEntry> > write_cache_key;
+ std::shared_ptr<const MetadataValueKey<FSPath> > location_key;
+ std::shared_ptr<const MetadataCollectionKey<FSPathSequence> > profiles_key;
+ std::shared_ptr<const MetadataValueKey<FSPath> > cache_key;
+ std::shared_ptr<const MetadataValueKey<FSPath> > write_cache_key;
std::shared_ptr<const MetadataValueKey<std::string> > append_repository_name_to_write_cache_key;
std::shared_ptr<const MetadataValueKey<std::string> > ignore_deprecated_profiles;
- std::shared_ptr<const MetadataValueKey<FSEntry> > names_cache_key;
- std::shared_ptr<const MetadataValueKey<FSEntry> > distdir_key;
- std::shared_ptr<const MetadataCollectionKey<FSEntrySequence> > eclassdirs_key;
- std::shared_ptr<const MetadataValueKey<FSEntry> > securitydir_key;
- std::shared_ptr<const MetadataValueKey<FSEntry> > setsdir_key;
- std::shared_ptr<const MetadataValueKey<FSEntry> > newsdir_key;
+ std::shared_ptr<const MetadataValueKey<FSPath> > names_cache_key;
+ std::shared_ptr<const MetadataValueKey<FSPath> > distdir_key;
+ std::shared_ptr<const MetadataCollectionKey<FSPathSequence> > eclassdirs_key;
+ std::shared_ptr<const MetadataValueKey<FSPath> > securitydir_key;
+ std::shared_ptr<const MetadataValueKey<FSPath> > setsdir_key;
+ std::shared_ptr<const MetadataValueKey<FSPath> > newsdir_key;
std::shared_ptr<const MetadataValueKey<std::string> > sync_key;
std::shared_ptr<const MetadataValueKey<std::string> > sync_options_key;
- std::shared_ptr<const MetadataValueKey<FSEntry> > builddir_key;
+ std::shared_ptr<const MetadataValueKey<FSPath> > builddir_key;
std::shared_ptr<const MetadataCollectionKey<Sequence<std::string> > > master_repositories_key;
std::shared_ptr<const MetadataValueKey<std::string> > eapi_when_unknown_key;
std::shared_ptr<const MetadataValueKey<std::string> > eapi_when_unspecified_key;
@@ -262,8 +262,8 @@ namespace paludis
std::shared_ptr<const MetadataValueKey<std::string> > binary_destination_key;
std::shared_ptr<const MetadataValueKey<std::string> > binary_src_uri_prefix_key;
std::shared_ptr<const MetadataCollectionKey<Set<std::string> > > binary_keywords_filter;
- std::shared_ptr<const MetadataValueKey<FSEntry> > accounts_repository_data_location_key;
- std::shared_ptr<const MetadataValueKey<FSEntry> > e_updates_location_key;
+ std::shared_ptr<const MetadataValueKey<FSPath> > accounts_repository_data_location_key;
+ std::shared_ptr<const MetadataValueKey<FSPath> > e_updates_location_key;
std::shared_ptr<const MetadataValueKey<std::string> > accept_keywords_key;
std::shared_ptr<const MetadataValueKey<std::string> > sync_host_key;
std::list<std::shared_ptr<const MetadataKey> > about_keys;
@@ -289,13 +289,13 @@ namespace paludis
mkt_normal, params.layout())),
profile_layout_key(std::make_shared<LiteralMetadataValueKey<std::string> >("profile_layout", "profile_layout",
mkt_normal, params.profile_layout())),
- location_key(std::make_shared<LiteralMetadataValueKey<FSEntry> >("location", "location",
+ location_key(std::make_shared<LiteralMetadataValueKey<FSPath> >("location", "location",
mkt_significant, params.location())),
- profiles_key(std::make_shared<LiteralMetadataFSEntrySequenceKey>(
+ profiles_key(std::make_shared<LiteralMetadataFSPathSequenceKey>(
"profiles", "profiles", mkt_normal, params.profiles())),
- cache_key(std::make_shared<LiteralMetadataValueKey<FSEntry> >("cache", "cache",
+ cache_key(std::make_shared<LiteralMetadataValueKey<FSPath> >("cache", "cache",
mkt_normal, params.cache())),
- write_cache_key(std::make_shared<LiteralMetadataValueKey<FSEntry> >("write_cache", "write_cache",
+ write_cache_key(std::make_shared<LiteralMetadataValueKey<FSPath> >("write_cache", "write_cache",
mkt_normal, params.write_cache())),
append_repository_name_to_write_cache_key(std::make_shared<LiteralMetadataValueKey<std::string> >(
"append_repository_name_to_write_cache", "append_repository_name_to_write_cache",
@@ -303,23 +303,23 @@ namespace paludis
ignore_deprecated_profiles(std::make_shared<LiteralMetadataValueKey<std::string> >(
"ignore_deprecated_profiles", "ignore_deprecated_profiles",
mkt_internal, stringify(params.ignore_deprecated_profiles()))),
- names_cache_key(std::make_shared<LiteralMetadataValueKey<FSEntry> >(
+ names_cache_key(std::make_shared<LiteralMetadataValueKey<FSPath> >(
"names_cache", "names_cache", mkt_normal, params.names_cache())),
- distdir_key(std::make_shared<LiteralMetadataValueKey<FSEntry> >(
+ distdir_key(std::make_shared<LiteralMetadataValueKey<FSPath> >(
"distdir", "distdir", mkt_normal, params.distdir())),
- eclassdirs_key(std::make_shared<LiteralMetadataFSEntrySequenceKey>(
+ eclassdirs_key(std::make_shared<LiteralMetadataFSPathSequenceKey>(
"eclassdirs", "eclassdirs", mkt_normal, params.eclassdirs())),
- securitydir_key(std::make_shared<LiteralMetadataValueKey<FSEntry> >(
+ securitydir_key(std::make_shared<LiteralMetadataValueKey<FSPath> >(
"securitydir", "securitydir", mkt_normal, params.securitydir())),
- setsdir_key(std::make_shared<LiteralMetadataValueKey<FSEntry> >(
+ setsdir_key(std::make_shared<LiteralMetadataValueKey<FSPath> >(
"setsdir", "setsdir", mkt_normal, params.setsdir())),
- newsdir_key(std::make_shared<LiteralMetadataValueKey<FSEntry> >(
+ newsdir_key(std::make_shared<LiteralMetadataValueKey<FSPath> >(
"newsdir", "newsdir", mkt_normal, params.newsdir())),
sync_key(std::make_shared<LiteralMetadataValueKey<std::string> >(
"sync", "sync", mkt_normal, params.sync())),
sync_options_key(std::make_shared<LiteralMetadataValueKey<std::string> >(
"sync_options", "sync_options", mkt_normal, params.sync_options())),
- builddir_key(std::make_shared<LiteralMetadataValueKey<FSEntry> >(
+ builddir_key(std::make_shared<LiteralMetadataValueKey<FSPath> >(
"builddir", "builddir", mkt_normal, params.builddir())),
master_repositories_key(params.master_repositories() ?
std::shared_ptr<MetadataCollectionKey<Sequence<std::string> > >(std::make_shared<LiteralMetadataStringSequenceKey>(
@@ -335,15 +335,15 @@ namespace paludis
"use_manifest", "use_manifest", mkt_normal, stringify(params.use_manifest()))),
info_pkgs_key(layout->info_packages_files()->end() != std::find_if(layout->info_packages_files()->begin(),
layout->info_packages_files()->end(),
- std::bind(std::mem_fn(&FSEntry::is_regular_file_or_symlink_to_regular_file),
- std::placeholders::_1)) ?
+ std::bind(std::mem_fn(&FSStat::is_regular_file_or_symlink_to_regular_file),
+ std::bind(std::mem_fn(&FSPath::stat), std::placeholders::_1))) ?
std::make_shared<InfoPkgsMetadataKey>(params.environment(), layout->info_packages_files(), repo) :
std::shared_ptr<InfoPkgsMetadataKey>()
),
info_vars_key(layout->info_variables_files()->end() != std::find_if(layout->info_variables_files()->begin(),
layout->info_variables_files()->end(),
- std::bind(std::mem_fn(&FSEntry::is_regular_file_or_symlink_to_regular_file),
- std::placeholders::_1)) ?
+ std::bind(std::mem_fn(&FSStat::is_regular_file_or_symlink_to_regular_file),
+ std::bind(std::mem_fn(&FSPath::stat), std::placeholders::_1))) ?
std::make_shared<InfoVarsMetadataKey>(layout->info_variables_files()) :
std::shared_ptr<InfoVarsMetadataKey>()
),
@@ -363,7 +363,7 @@ namespace paludis
master_mtime(0)
{
- if ((params.location() / "metadata" / "about.conf").is_regular_file_or_symlink_to_regular_file())
+ if ((params.location() / "metadata" / "about.conf").stat().is_regular_file_or_symlink_to_regular_file())
{
Context context("When loading about.conf:");
KeyValueConfigFile k(params.location() / "metadata" / "about.conf", { },
@@ -385,9 +385,10 @@ namespace paludis
mkt_significant, k.get("homepage")));
}
- FSEntry mtf(params.location() / "metadata" / "timestamp");
- if (mtf.exists())
- master_mtime = mtf.mtim().seconds();
+ FSPath mtf(params.location() / "metadata" / "timestamp");
+ FSStat mtfs(mtf.stat());
+ if (mtfs.exists())
+ master_mtime = mtfs.mtim().seconds();
}
Imp<ERepository>::~Imp()
@@ -402,23 +403,23 @@ namespace paludis
if (profile_ptr)
return;
- std::shared_ptr<const FSEntrySequence> profiles(params.profiles());
+ std::shared_ptr<const FSPathSequence> profiles(params.profiles());
if (params.auto_profiles())
{
- FSEntry profiles_desc("/dev/null");
- for (FSEntrySequence::ConstIterator f(layout->profiles_desc_files()->begin()),
+ FSPath profiles_desc("/dev/null");
+ for (FSPathSequence::ConstIterator f(layout->profiles_desc_files()->begin()),
f_end(layout->profiles_desc_files()->end()) ;
f != f_end ; ++f)
- if (f->is_regular_file_or_symlink_to_regular_file())
+ if (f->stat().is_regular_file_or_symlink_to_regular_file())
profiles_desc = *f;
- std::shared_ptr<FSEntrySequence> auto_profiles(std::make_shared<FSEntrySequence>());
+ std::shared_ptr<FSPathSequence> auto_profiles(std::make_shared<FSPathSequence>());
- if (profiles_desc == FSEntry("/dev/null"))
+ if (profiles_desc == FSPath("/dev/null"))
{
- auto_profiles->push_back(FSEntry("/var/empty"));
- main_profile_path = std::make_shared<FSEntry>("/var/empty");
+ auto_profiles->push_back(FSPath("/var/empty"));
+ main_profile_path = std::make_shared<FSPath>("/var/empty");
}
else
{
@@ -432,18 +433,18 @@ namespace paludis
if (tokens.size() < 3)
continue;
- FSEntry p(profiles_desc.dirname().realpath().dirname() / "profiles" / tokens.at(1));
+ FSPath p(profiles_desc.dirname().realpath().dirname() / "profiles" / tokens.at(1));
auto_profiles->push_back(p);
- main_profile_path = std::make_shared<FSEntry>(p);
+ main_profile_path = std::make_shared<FSPath>(p);
break;
}
}
profiles = auto_profiles;
}
else if (params.profiles()->empty())
- main_profile_path = std::make_shared<FSEntry>("/var/empty");
+ main_profile_path = std::make_shared<FSPath>("/var/empty");
else
- main_profile_path = std::make_shared<FSEntry>(*params.profiles()->begin());
+ main_profile_path = std::make_shared<FSPath>(*params.profiles()->begin());
profile_ptr = ProfileFactory::get_instance()->create(
params.profile_layout(),
@@ -457,18 +458,18 @@ namespace paludis
namespace
{
RepositoryName
- fetch_repo_name(const FSEntry & tree_root)
+ fetch_repo_name(const FSPath & tree_root)
{
bool illegal(false);
try
{
do
{
- FSEntry name_file(tree_root);
+ FSPath name_file(tree_root);
name_file /= "profiles";
name_file /= "repo_name";
- if (! name_file.is_regular_file())
+ if (! name_file.stat().is_regular_file())
break;
LineConfigFile f(name_file, { lcfo_disallow_comments, lcfo_disallow_continuations, lcfo_no_skip_blank_lines });
@@ -612,7 +613,7 @@ ERepository::repository_masked(const PackageID & id) const
using namespace std::placeholders;
- std::shared_ptr<const FSEntrySequence> repository_mask_files(_imp->layout->repository_mask_files());
+ std::shared_ptr<const FSPathSequence> repository_mask_files(_imp->layout->repository_mask_files());
ProfileFile<MaskFile> repository_mask_file(this);
std::for_each(repository_mask_files->begin(), repository_mask_files->end(),
std::bind(&ProfileFile<MaskFile>::add_file, std::ref(repository_mask_file), _1));
@@ -671,11 +672,11 @@ ERepository::arch_flags() const
_imp->arch_flags = std::make_shared<Set<UnprefixedChoiceName>>();
bool found_one(false);
- std::shared_ptr<const FSEntrySequence> arch_list_files(_imp->layout->arch_list_files());
- for (FSEntrySequence::ConstIterator p(arch_list_files->begin()), p_end(arch_list_files->end()) ;
+ std::shared_ptr<const FSPathSequence> arch_list_files(_imp->layout->arch_list_files());
+ for (FSPathSequence::ConstIterator p(arch_list_files->begin()), p_end(arch_list_files->end()) ;
p != p_end ; ++p)
{
- if (! p->exists())
+ if (! p->stat().exists())
continue;
LineConfigFile archs(*p, { lcfo_disallow_continuations });
@@ -702,11 +703,11 @@ ERepository::need_mirrors() const
if (! _imp->has_mirrors)
{
bool found_one(false);
- std::shared_ptr<const FSEntrySequence> mirror_files(_imp->layout->mirror_files());
- for (FSEntrySequence::ConstIterator p(mirror_files->begin()), p_end(mirror_files->end()) ;
+ std::shared_ptr<const FSPathSequence> mirror_files(_imp->layout->mirror_files());
+ for (FSPathSequence::ConstIterator p(mirror_files->begin()), p_end(mirror_files->end()) ;
p != p_end ; ++p)
{
- if (p->exists())
+ if (p->stat().exists())
{
LineConfigFile mirrors(*p, { lcfo_disallow_continuations });
for (LineConfigFile::ConstIterator line(mirrors.begin()) ; line != mirrors.end() ; ++line)
@@ -800,14 +801,14 @@ ERepository::purge_invalid_cache() const
{
Context context("When purging invalid write_cache:");
- FSEntry write_cache(_imp->params.write_cache());
- if (write_cache == FSEntry("/var/empty"))
+ FSPath write_cache(_imp->params.write_cache());
+ if (write_cache == FSPath("/var/empty"))
return;
if (_imp->params.append_repository_name_to_write_cache())
write_cache /= stringify(name());
- if (! write_cache.is_directory_or_symlink_to_directory())
+ if (! write_cache.stat().is_directory_or_symlink_to_directory())
return;
const std::shared_ptr<const EAPI> eapi(EAPIData::get_instance()->eapi_from_string(
@@ -815,18 +816,19 @@ ERepository::purge_invalid_cache() const
std::shared_ptr<EclassMtimes> eclass_mtimes(std::make_shared<EclassMtimes>(this, _imp->params.eclassdirs()));
time_t master_mtime(0);
- FSEntry master_mtime_file(_imp->params.location() / "metadata" / "timestamp");
- if (master_mtime_file.exists())
- master_mtime = master_mtime_file.mtim().seconds();
+ FSPath master_mtime_file(_imp->params.location() / "metadata" / "timestamp");
+ FSStat master_mtime_file_stat(master_mtime_file.stat());
+ if (master_mtime_file_stat.exists())
+ master_mtime = master_mtime_file_stat.mtim().seconds();
- for (DirIterator dc(write_cache, { dio_inode_sort }), dc_end ; dc != dc_end ; ++dc)
+ for (FSIterator dc(write_cache, { fsio_inode_sort }), dc_end ; dc != dc_end ; ++dc)
{
- if (! dc->is_directory_or_symlink_to_directory())
+ if (! dc->stat().is_directory_or_symlink_to_directory())
continue;
- for (DirIterator dp(*dc, { dio_inode_sort }), dp_end ; dp != dp_end ; ++dp)
+ for (FSIterator dp(*dc, { fsio_inode_sort }), dp_end ; dp != dp_end ; ++dp)
{
- if (! dp->is_regular_file_or_symlink_to_regular_file())
+ if (! dp->stat().is_regular_file_or_symlink_to_regular_file())
continue;
try
@@ -852,7 +854,7 @@ ERepository::purge_invalid_cache() const
}
if (! found)
- FSEntry(*dp).unlink();
+ FSPath(*dp).unlink();
}
catch (const Exception & e)
{
@@ -1075,19 +1077,19 @@ ERepository::some_ids_might_not_be_masked() const
void
ERepository::make_manifest(const QualifiedPackageName & qpn)
{
- FSEntry package_dir = _imp->layout->package_directory(qpn);
+ FSPath package_dir = _imp->layout->package_directory(qpn);
- FSEntry(package_dir / "Manifest").unlink();
- SafeOFStream manifest(FSEntry(package_dir / "Manifest"));
+ FSPath(package_dir / "Manifest").unlink();
+ SafeOFStream manifest(FSPath(package_dir / "Manifest"));
if (! manifest)
throw ERepositoryConfigurationError("Couldn't open Manifest for writing.");
- std::shared_ptr<Map<FSEntry, std::string> > files = _imp->layout->manifest_files(qpn);
+ auto files(_imp->layout->manifest_files(qpn));
- for (Map<FSEntry, std::string>::ConstIterator f(files->begin()) ;
- f != files->end() ; ++f)
+ for (auto f(files->begin()) ; f != files->end() ; ++f)
{
- FSEntry file(f->first);
+ FSPath file(f->first);
+ FSStat file_stat(file);
std::string filename = file.basename();
std::string file_type(f->second);
@@ -1100,7 +1102,7 @@ ERepository::make_manifest(const QualifiedPackageName & qpn)
RMD160 rmd160sum(file_stream);
manifest << file_type << " " << filename << " "
- << file.file_size() << " RMD160 " << rmd160sum.hexsum();
+ << file.stat().file_size() << " RMD160 " << rmd160sum.hexsum();
file_stream.clear();
file_stream.seekg(0, std::ios::beg);
@@ -1135,9 +1137,10 @@ ERepository::make_manifest(const QualifiedPackageName & qpn)
continue;
done_files.insert(*d);
- FSEntry f(params().distdir() / *d);
+ FSPath f(params().distdir() / *d);
+ FSStat f_stat(f);
- if (! f.is_regular_file_or_symlink_to_regular_file())
+ if (! f_stat.is_regular_file_or_symlink_to_regular_file())
throw MissingDistfileError("Distfile '" + f.basename() + "' does not exist");
SafeIFStream file_stream(f);
@@ -1145,7 +1148,7 @@ ERepository::make_manifest(const QualifiedPackageName & qpn)
MemoisedHashes * hashes = MemoisedHashes::get_instance();
manifest << "DIST " << f.basename() << " "
- << f.file_size()
+ << f_stat.file_size()
<< " RMD160 " << hashes->get<RMD160>(f, file_stream)
<< " SHA1 " << hashes->get<SHA1>(f, file_stream)
<< " SHA256 " << hashes->get<SHA256>(f, file_stream)
@@ -1192,16 +1195,16 @@ ERepository::format_key() const
return _imp->format_key;
}
-const std::shared_ptr<const MetadataValueKey<FSEntry> >
+const std::shared_ptr<const MetadataValueKey<FSPath> >
ERepository::location_key() const
{
return _imp->location_key;
}
-const std::shared_ptr<const MetadataValueKey<FSEntry> >
+const std::shared_ptr<const MetadataValueKey<FSPath> >
ERepository::installed_root_key() const
{
- return std::shared_ptr<const MetadataValueKey<FSEntry> >();
+ return std::shared_ptr<const MetadataValueKey<FSPath> >();
}
const std::shared_ptr<const MetadataCollectionKey<Set<std::string> > >
@@ -1219,7 +1222,7 @@ ERepository::repository_factory_name(
if (key_function("location").empty())
throw ERepositoryConfigurationError("Key 'location' unspecified or empty");
- return fetch_repo_name(FSEntry(key_function("location")));
+ return fetch_repo_name(FSPath(key_function("location")));
}
std::shared_ptr<Repository>
@@ -1235,8 +1238,8 @@ ERepository::repository_factory_create(
if ('/' != location.at(0))
throw ERepositoryConfigurationError("Key 'location' must start with a / (relative paths are not allowed)");
- std::shared_ptr<KeyValueConfigFile> layout_conf((FSEntry(location) / "metadata/layout.conf").exists() ?
- new KeyValueConfigFile(FSEntry(location) / "metadata/layout.conf", { },
+ std::shared_ptr<KeyValueConfigFile> layout_conf((FSPath(location) / "metadata/layout.conf").stat().exists() ?
+ new KeyValueConfigFile(FSPath(location) / "metadata/layout.conf", { },
&KeyValueConfigFile::no_defaults, &KeyValueConfigFile::no_transformation)
: 0);
@@ -1246,7 +1249,7 @@ ERepository::repository_factory_create(
if (layout_conf)
{
Log::get_instance()->message("e.ebuild.configuration.master_repository", ll_warning, lc_context) << "Key 'master_repository' in '"
- << f("repo_file") << "' will override '" << (FSEntry(location) / "metadata/layout.conf")
+ << f("repo_file") << "' will override '" << (FSPath(location) / "metadata/layout.conf")
<< "'. You should probably remove the 'master_repository' setting from your repository config file.";
}
@@ -1297,23 +1300,23 @@ ERepository::repository_factory_create(
}
catch (const NoSuchRepositoryError &)
{
- throw ERepositoryConfigurationError("According to '" + stringify(FSEntry(location) / "metadata/layout.conf")
+ throw ERepositoryConfigurationError("According to '" + stringify(FSPath(location) / "metadata/layout.conf")
+ "', the repository specified by '" + f("repo_file") + "' requires repository '" + *t +
"', which you do not have available");
}
}
}
- std::shared_ptr<FSEntrySequence> profiles(std::make_shared<FSEntrySequence>());
+ std::shared_ptr<FSPathSequence> profiles(std::make_shared<FSPathSequence>());
bool profiles_explicitly_set(false), auto_profiles(false);
- tokenise_whitespace(f("profiles"), create_inserter<FSEntry>(std::back_inserter(*profiles)));
+ tokenise_whitespace(f("profiles"), create_inserter<FSPath>(std::back_inserter(*profiles)));
if (profiles->empty())
{
if (master_repositories)
std::copy((*master_repositories->begin())->params().profiles()->begin(),
(*master_repositories->begin())->params().profiles()->end(), profiles->back_inserter());
- else if (FSEntry(location).is_directory_or_symlink_to_directory() &&
- (DirIterator(FSEntry(location)) != DirIterator()))
+ else if (FSPath(location).stat().is_directory_or_symlink_to_directory() &&
+ (FSIterator(FSPath(location), { fsio_inode_sort, fsio_first_only }) != FSIterator()))
{
/* only require profiles = if we've definitely been synced. requiring profiles = on
* unsynced doesn't play nice with layout.conf specifying masters. */
@@ -1325,8 +1328,8 @@ ERepository::repository_factory_create(
else
profiles_explicitly_set = true;
- std::shared_ptr<FSEntrySequence> eclassdirs(std::make_shared<FSEntrySequence>());
- tokenise_whitespace(f("eclassdirs"), create_inserter<FSEntry>(std::back_inserter(*eclassdirs)));
+ std::shared_ptr<FSPathSequence> eclassdirs(std::make_shared<FSPathSequence>());
+ tokenise_whitespace(f("eclassdirs"), create_inserter<FSPath>(std::back_inserter(*eclassdirs)));
if (eclassdirs->empty())
{
if (master_repositories)
@@ -1335,7 +1338,7 @@ ERepository::repository_factory_create(
e_end(master_repositories->end()) ; e != e_end ; ++e)
std::copy((*e)->params().eclassdirs()->begin(), (*e)->params().eclassdirs()->end(), eclassdirs->back_inserter());
}
- eclassdirs->push_back(location + "/eclass");
+ eclassdirs->push_back(FSPath(location + "/eclass"));
}
std::string distdir(f("distdir"));
@@ -1371,7 +1374,7 @@ ERepository::repository_factory_create(
if (cache.empty())
{
cache = location + "/metadata/cache";
- if (! FSEntry(cache).exists())
+ if (! FSPath(cache).stat().exists())
cache = "/var/empty";
}
@@ -1513,9 +1516,9 @@ ERepository::repository_factory_create(
n::binary_distdir() = binary_distdir,
n::binary_keywords_filter() = binary_keywords_filter,
n::binary_uri_prefix() = binary_uri_prefix,
- n::builddir() = FSEntry(builddir).realpath_if_exists(),
+ n::builddir() = FSPath(builddir).realpath_if_exists(),
n::cache() = cache,
- n::distdir() = FSEntry(distdir).realpath_if_exists(),
+ n::distdir() = FSPath(distdir).realpath_if_exists(),
n::eapi_when_unknown() = eapi_when_unknown,
n::eapi_when_unspecified() = eapi_when_unspecified,
n::eclassdirs() = eclassdirs,
@@ -1523,21 +1526,21 @@ ERepository::repository_factory_create(
n::environment() = env,
n::ignore_deprecated_profiles() = ignore_deprecated_profiles,
n::layout() = layout,
- n::location() = FSEntry(location).realpath_if_exists(),
+ n::location() = FSPath(location).realpath_if_exists(),
n::master_repositories() = master_repositories,
- n::names_cache() = FSEntry(names_cache).realpath_if_exists(),
- n::newsdir() = FSEntry(newsdir).realpath_if_exists(),
+ n::names_cache() = FSPath(names_cache).realpath_if_exists(),
+ n::newsdir() = FSPath(newsdir).realpath_if_exists(),
n::profile_eapi_when_unspecified() = profile_eapi,
n::profile_layout() = profile_layout,
n::profiles() = profiles,
n::profiles_explicitly_set() = profiles_explicitly_set,
- n::securitydir() = FSEntry(securitydir).realpath_if_exists(),
- n::setsdir() = FSEntry(setsdir).realpath_if_exists(),
+ n::securitydir() = FSPath(securitydir).realpath_if_exists(),
+ n::setsdir() = FSPath(setsdir).realpath_if_exists(),
n::sync() = sync,
n::sync_options() = sync_options,
n::use_manifest() = use_manifest,
n::write_bin_uri_prefix() = "",
- n::write_cache() = FSEntry(write_cache).realpath_if_exists()
+ n::write_cache() = FSPath(write_cache).realpath_if_exists()
));
}
@@ -1555,8 +1558,8 @@ ERepository::repository_factory_dependencies(
if (location.empty())
throw ERepositoryConfigurationError("Key 'location' not specified or empty");
- std::shared_ptr<KeyValueConfigFile> layout_conf((FSEntry(location) / "metadata/layout.conf").exists() ?
- new KeyValueConfigFile(FSEntry(location) / "metadata/layout.conf", { },
+ std::shared_ptr<KeyValueConfigFile> layout_conf((FSPath(location) / "metadata/layout.conf").stat().exists() ?
+ new KeyValueConfigFile(FSPath(location) / "metadata/layout.conf", { },
&KeyValueConfigFile::no_defaults, &KeyValueConfigFile::no_transformation)
: 0);
@@ -1586,15 +1589,15 @@ ERepository::use_desc() const
}
const std::string
-ERepository::eapi_for_file(const FSEntry & f) const
+ERepository::eapi_for_file(const FSPath & f) const
{
- FSEntry dir(f.dirname());
+ FSPath dir(f.dirname());
Lock lock(_imp->mutexes->eapi_for_file_mutex);
EAPIForFileMap::const_iterator i(_imp->eapi_for_file_map.find(dir));
if (i == _imp->eapi_for_file_map.end())
{
Context context("When finding the EAPI to use for file '" + stringify(f) + "':");
- if ((dir / "eapi").is_regular_file_or_symlink_to_regular_file())
+ if ((dir / "eapi").stat().is_regular_file_or_symlink_to_regular_file())
{
LineConfigFile file(dir / "eapi", { lcfo_disallow_continuations });
if (file.begin() == file.end())
@@ -1684,7 +1687,7 @@ namespace
KeyValueConfigFile file;
Suffixes() :
- file(FSEntry(getenv_with_default("PALUDIS_SUFFIXES_FILE", DATADIR "/paludis/ebuild_entries_suffixes.conf")),
+ file(FSPath(getenv_with_default("PALUDIS_SUFFIXES_FILE", DATADIR "/paludis/ebuild_entries_suffixes.conf")),
{ }, &KeyValueConfigFile::no_defaults, &KeyValueConfigFile::no_transformation)
{
}
@@ -1715,7 +1718,7 @@ namespace
}
const std::shared_ptr<const ERepositoryID>
-ERepository::make_id(const QualifiedPackageName & q, const FSEntry & f) const
+ERepository::make_id(const QualifiedPackageName & q, const FSPath & f) const
{
Context context("When creating ID for '" + stringify(q) + "' from '" + stringify(f) + "':");
@@ -1877,27 +1880,28 @@ namespace
namespace
{
bool
- check_userpriv(const FSEntry & f, const Environment * env, bool mandatory)
+ check_userpriv(const FSPath & f, const Environment * env, bool mandatory)
{
Context c("When checking permissions on '" + stringify(f) + "' for userpriv:");
if (! getenv_with_default("PALUDIS_BYPASS_USERPRIV_CHECKS", "").empty())
return false;
- if (f.exists())
+ FSStat f_stat(f);
+ if (f_stat.exists())
{
- if (f.group() != env->reduced_gid())
+ if (f_stat.group() != env->reduced_gid())
{
if (mandatory)
- throw ConfigurationError("Directory '" + stringify(f) + "' owned by group '" + get_group_name(f.group())
+ throw ConfigurationError("Directory '" + stringify(f) + "' owned by group '" + get_group_name(f_stat.group())
+ "', not '" + get_group_name(env->reduced_gid()) + "'");
else
Log::get_instance()->message("e.ebuild.userpriv_disabled", ll_warning, lc_context) << "Directory '" <<
- f << "' owned by group '" << get_group_name(f.group()) << "', not '"
+ f << "' owned by group '" << get_group_name(f_stat.group()) << "', not '"
<< get_group_name(env->reduced_gid()) << "', so cannot enable userpriv";
return false;
}
- else if (! f.has_permission(fs_ug_group, fs_perm_write))
+ else if (0 == (f_stat.permissions() & S_IWGRP))
{
if (mandatory)
throw ConfigurationError("Directory '" + stringify(f) + "' does not have group write permission");
@@ -1949,7 +1953,7 @@ ERepository::fetch(const std::shared_ptr<const ERepositoryID> & id,
}
bool fetch_userpriv_ok(_imp->params.environment()->reduced_gid() != getgid() &&
- check_userpriv(FSEntry(_imp->params.distdir()), _imp->params.environment(),
+ check_userpriv(FSPath(_imp->params.distdir()), _imp->params.environment(),
id->eapi()->supported()->userpriv_cannot_use_root()));
std::string archives, all_archives;
@@ -2040,18 +2044,18 @@ ERepository::fetch(const std::shared_ptr<const ERepositoryID> & id,
((! fetch_action.options.ignore_unfetched()) && (! id->eapi()->supported()->ebuild_phases()->ebuild_fetch_extra().empty()))))
{
bool userpriv_ok((! userpriv_restrict) && (_imp->params.environment()->reduced_gid() != getgid()) &&
- check_userpriv(FSEntry(_imp->params.builddir()), _imp->params.environment(),
+ check_userpriv(FSPath(_imp->params.builddir()), _imp->params.environment(),
id->eapi()->supported()->userpriv_cannot_use_root()));
std::string use(make_use(_imp->params.environment(), *id, profile()));
std::shared_ptr<Map<std::string, std::string> > expand_vars(make_expand(
_imp->params.environment(), *id, profile()));
- std::shared_ptr<const FSEntrySequence> exlibsdirs(layout()->exlibsdirs(id->name()));
+ std::shared_ptr<const FSPathSequence> exlibsdirs(layout()->exlibsdirs(id->name()));
EAPIPhases fetch_extra_phases(id->eapi()->supported()->ebuild_phases()->ebuild_fetch_extra());
if ((! fetch_action.options.ignore_unfetched()) && (fetch_extra_phases.begin_phases() != fetch_extra_phases.end_phases()))
{
- FSEntry package_builddir(_imp->params.builddir() / (stringify(id->name().category()) + "-" +
+ FSPath package_builddir(_imp->params.builddir() / (stringify(id->name().category()) + "-" +
stringify(id->name().package()) + "-" + stringify(id->version()) + "-fetch_extra"));
for (EAPIPhases::ConstIterator phase(fetch_extra_phases.begin_phases()), phase_end(fetch_extra_phases.end_phases()) ;
@@ -2224,12 +2228,11 @@ namespace
return o;
}
- void installed_this(const FSEntry &)
+ void installed_this(const FSPath &)
{
}
- bool ignore_merged(const std::shared_ptr<const FSEntrySet> & s,
- const FSEntry & f)
+ bool ignore_merged(const std::shared_ptr<const FSPathSet> & s, const FSPath & f)
{
return s->end() != s->find(f);
}
@@ -2372,17 +2375,17 @@ ERepository::install(const std::shared_ptr<const ERepositoryID> & id,
std::shared_ptr<Map<std::string, std::string> > expand_vars(make_expand(
_imp->params.environment(), *id, profile()));
- std::shared_ptr<const FSEntrySequence> exlibsdirs(layout()->exlibsdirs(id->name()));
+ std::shared_ptr<const FSPathSequence> exlibsdirs(layout()->exlibsdirs(id->name()));
bool userpriv_ok((! userpriv_restrict) && (_imp->params.environment()->reduced_gid() != getgid()) &&
- check_userpriv(FSEntry(_imp->params.distdir()), _imp->params.environment(), id->eapi()->supported()->userpriv_cannot_use_root()) &&
- check_userpriv(FSEntry(_imp->params.builddir()), _imp->params.environment(), id->eapi()->supported()->userpriv_cannot_use_root()));
+ check_userpriv(FSPath(_imp->params.distdir()), _imp->params.environment(), id->eapi()->supported()->userpriv_cannot_use_root()) &&
+ check_userpriv(FSPath(_imp->params.builddir()), _imp->params.environment(), id->eapi()->supported()->userpriv_cannot_use_root()));
- FSEntry package_builddir(_imp->params.builddir() / (stringify(id->name().category()) + "-" +
+ FSPath package_builddir(_imp->params.builddir() / (stringify(id->name().category()) + "-" +
stringify(id->name().package()) + "-" + stringify(id->version())));
std::string used_config_protect;
- std::shared_ptr<FSEntrySet> merged_entries(std::make_shared<FSEntrySet>());
+ auto merged_entries(std::make_shared<FSPathSet>());
std::shared_ptr<const ChoiceValue> preserve_work_choice(
id->choices_key()->value()->find_by_name_with_prefix(
@@ -2441,7 +2444,7 @@ ERepository::install(const std::shared_ptr<const ERepositoryID> & id,
if (preserve_work_choice && preserve_work_choice->enabled())
extra_merger_options += mo_nondestructive;
- Timestamp build_start_time(FSEntry(package_builddir / "temp" / "build_start_time").mtim());
+ Timestamp build_start_time(FSPath(package_builddir / "temp" / "build_start_time").stat().mtim());
(*install_action.options.destination()).destination_interface()->merge(
make_named_values<MergeParams>(
n::build_start_time() = build_start_time,
@@ -2461,9 +2464,9 @@ ERepository::install(const std::shared_ptr<const ERepositoryID> & id,
if ((! id->eapi()->supported()->is_pbin()) && (! strip_restrict))
{
std::string libdir("lib");
- FSEntry root(install_action.options.destination()->installed_root_key() ?
+ FSPath root(install_action.options.destination()->installed_root_key() ?
stringify(install_action.options.destination()->installed_root_key()->value()) : "/");
- if ((root / "usr" / "lib").is_symbolic_link())
+ if ((root / "usr" / "lib").stat().is_symlink())
{
libdir = (root / "usr" / "lib").readlink();
if (std::string::npos != libdir.find_first_of("./"))
@@ -2616,7 +2619,7 @@ ERepository::info(const std::shared_ptr<const ERepositoryID> & id,
std::bind(std::equal_to<std::string>(), std::bind(std::mem_fn(&StringDepSpec::text), _1), "nouserpriv"));
}
bool userpriv_ok((! userpriv_restrict) && (_imp->params.environment()->reduced_gid() != getgid()) &&
- check_userpriv(FSEntry(_imp->params.builddir()), _imp->params.environment(), id->eapi()->supported()->userpriv_cannot_use_root()));
+ check_userpriv(FSPath(_imp->params.builddir()), _imp->params.environment(), id->eapi()->supported()->userpriv_cannot_use_root()));
/* make use */
std::string use(make_use(_imp->params.environment(), *id, profile()));
@@ -2626,7 +2629,7 @@ ERepository::info(const std::shared_ptr<const ERepositoryID> & id,
std::shared_ptr<Map<std::string, std::string> > expand_vars(make_expand(
_imp->params.environment(), *id, profile()));
- std::shared_ptr<const FSEntrySequence> exlibsdirs(layout()->exlibsdirs(id->name()));
+ std::shared_ptr<const FSPathSequence> exlibsdirs(layout()->exlibsdirs(id->name()));
EAPIPhases phases(id->eapi()->supported()->ebuild_phases()->ebuild_info());
for (EAPIPhases::ConstIterator phase(phases.begin_phases()), phase_end(phases.end_phases()) ;
@@ -2663,7 +2666,7 @@ ERepository::info(const std::shared_ptr<const ERepositoryID> & id,
n::expand_vars() = expand_vars,
n::info_vars() = info_vars_key() ?
info_vars_key()->value() : std::make_shared<const Set<std::string>>(),
- n::load_environment() = static_cast<const FSEntry *>(0),
+ n::load_environment() = static_cast<const FSPath *>(0),
n::profiles() = _imp->params.profiles(),
n::profiles_with_parents() = profile()->profiles_with_parents(),
n::use() = use,
@@ -2708,9 +2711,9 @@ ERepository::get_environment_variable(
std::bind(std::equal_to<std::string>(), std::bind(std::mem_fn(&StringDepSpec::text), _1), "nouserpriv"));
}
bool userpriv_ok((! userpriv_restrict) && (_imp->params.environment()->reduced_gid() != getgid()) &&
- check_userpriv(FSEntry(_imp->params.builddir()), _imp->params.environment(), id->eapi()->supported()->userpriv_cannot_use_root()));
+ check_userpriv(FSPath(_imp->params.builddir()), _imp->params.environment(), id->eapi()->supported()->userpriv_cannot_use_root()));
- std::shared_ptr<const FSEntrySequence> exlibsdirs(layout()->exlibsdirs(id->name()));
+ std::shared_ptr<const FSPathSequence> exlibsdirs(layout()->exlibsdirs(id->name()));
EbuildVariableCommand cmd(make_named_values<EbuildCommandParams>(
n::builddir() = _imp->params.builddir(),
@@ -2780,12 +2783,12 @@ ERepository::merge(const MergeParams & m)
n::environment_file() = m.environment_file(),
n::fix_mtimes_before() = fix_mtimes ? m.build_start_time() : Timestamp(0, 0),
n::image() = m.image_dir(),
- n::install_under() = FSEntry("/"),
+ n::install_under() = FSPath("/"),
n::merged_entries() = m.merged_entries(),
n::options() = m.options(),
n::output_manager() = m.output_manager(),
n::package_id() = m.package_id(),
- n::root() = FSEntry("/"),
+ n::root() = FSPath("/"),
n::tar_file() = _imp->params.binary_distdir() / (bin_dist_base + ".tar")
));
@@ -2798,12 +2801,12 @@ ERepository::merge(const MergeParams & m)
if (0 != compress_process.run().wait())
throw ActionFailedError("Compressing tarball failed");
- FSEntry binary_ebuild_location(layout()->binary_ebuild_location(
+ FSPath binary_ebuild_location(layout()->binary_ebuild_location(
m.package_id()->name(), m.package_id()->version(),
"pbin-1+" + std::static_pointer_cast<const ERepositoryID>(m.package_id())->eapi()->name()));
- binary_ebuild_location.dirname().dirname().mkdir();
- binary_ebuild_location.dirname().mkdir();
+ binary_ebuild_location.dirname().dirname().mkdir(0755, { fspmkdo_ok_if_exists });
+ binary_ebuild_location.dirname().mkdir(0755, { fspmkdo_ok_if_exists });
std::string binary_keywords;
if (m.package_id()->keywords_key())
@@ -2840,12 +2843,12 @@ ERepository::merge(const MergeParams & m)
{
/* 0.1 replacing 00.1 etc */
if (is_replace->fs_location_key()->value() != binary_ebuild_location)
- FSEntry(is_replace->fs_location_key()->value()).unlink();
+ FSPath(is_replace->fs_location_key()->value()).unlink();
do
{
- FSEntry cache(_imp->params.write_cache());
- if (cache == FSEntry("/var/empty"))
+ FSPath cache(_imp->params.write_cache());
+ if (cache == FSPath("/var/empty"))
break;
if (_imp->params.append_repository_name_to_write_cache())
@@ -2854,7 +2857,7 @@ ERepository::merge(const MergeParams & m)
cache /= stringify(is_replace->name().category());
cache /= (stringify(is_replace->name().package()) + "-" + stringify(is_replace->version()));
- if (cache.is_regular_file_or_symlink_to_regular_file())
+ if (cache.stat().is_regular_file_or_symlink_to_regular_file())
cache.unlink();
}
while (false);
@@ -2868,7 +2871,7 @@ ERepository::merge(const MergeParams & m)
}
bool
-ERepository::is_package_file(const QualifiedPackageName & n, const FSEntry & e) const
+ERepository::is_package_file(const QualifiedPackageName & n, const FSPath & e) const
{
Context context("When working out whether '" + stringify(e) + "' is a package file for '" + stringify(n) + "':");
@@ -2884,7 +2887,7 @@ ERepository::is_package_file(const QualifiedPackageName & n, const FSEntry & e)
}
VersionSpec
-ERepository::extract_package_file_version(const QualifiedPackageName & n, const FSEntry & e) const
+ERepository::extract_package_file_version(const QualifiedPackageName & n, const FSPath & e) const
{
Context context("When extracting version from '" + stringify(e) + "':");
std::string::size_type p(e.basename().rfind('.'));
@@ -2926,13 +2929,13 @@ ERepository::pretend(
std::bind(std::equal_to<std::string>(), std::bind(std::mem_fn(&StringDepSpec::text), _1), "nouserpriv"));
}
bool userpriv_ok((! userpriv_restrict) && (_imp->params.environment()->reduced_gid() != getgid()) &&
- check_userpriv(FSEntry(_imp->params.builddir()), _imp->params.environment(), id->eapi()->supported()->userpriv_cannot_use_root()));
+ check_userpriv(FSPath(_imp->params.builddir()), _imp->params.environment(), id->eapi()->supported()->userpriv_cannot_use_root()));
std::string use(make_use(_imp->params.environment(), *id, profile()));
std::shared_ptr<Map<std::string, std::string> > expand_vars(make_expand(
_imp->params.environment(), *id, profile()));
- std::shared_ptr<const FSEntrySequence> exlibsdirs(layout()->exlibsdirs(id->name()));
+ std::shared_ptr<const FSPathSequence> exlibsdirs(layout()->exlibsdirs(id->name()));
std::shared_ptr<OutputManager> output_manager;
@@ -3053,7 +3056,7 @@ ERepository::pretend(
}
const std::string
-ERepository::get_package_file_manifest_key(const FSEntry & e, const QualifiedPackageName & q) const
+ERepository::get_package_file_manifest_key(const FSPath & e, const QualifiedPackageName & q) const
{
if (! is_package_file(q, e))
return "";
@@ -3073,7 +3076,7 @@ ERepository::binary_ebuild_name(const QualifiedPackageName & q, const VersionSpe
}
const std::string
-ERepository::_guess_eapi(const QualifiedPackageName &, const FSEntry & e) const
+ERepository::_guess_eapi(const QualifiedPackageName &, const FSPath & e) const
{
std::string::size_type p(e.basename().rfind('.'));
if (std::string::npos == p)
diff --git a/paludis/repositories/e/e_repository.hh b/paludis/repositories/e/e_repository.hh
index e8b4b7c..2891bb8 100644
--- a/paludis/repositories/e/e_repository.hh
+++ b/paludis/repositories/e/e_repository.hh
@@ -23,7 +23,6 @@
#include <paludis/repository.hh>
#include <paludis/package_database.hh>
#include <paludis/mask-fwd.hh>
-#include <paludis/util/fs_entry.hh>
#include <paludis/util/pimp.hh>
#include <paludis/repositories/e/e_repository_params.hh>
#include <paludis/repositories/e/e_repository_id.hh>
@@ -64,7 +63,7 @@ namespace paludis
void need_mirrors() const;
- const std::string _guess_eapi(const QualifiedPackageName &, const FSEntry & e) const;
+ const std::string _guess_eapi(const QualifiedPackageName &, const FSPath & e) const;
protected:
virtual void need_keys_added() const;
@@ -170,8 +169,8 @@ namespace paludis
/* Keys */
virtual const std::shared_ptr<const MetadataValueKey<std::string> > format_key() const;
- virtual const std::shared_ptr<const MetadataValueKey<FSEntry> > location_key() const;
- virtual const std::shared_ptr<const MetadataValueKey<FSEntry> > installed_root_key() const;
+ virtual const std::shared_ptr<const MetadataValueKey<FSPath> > location_key() const;
+ virtual const std::shared_ptr<const MetadataValueKey<FSPath> > installed_root_key() const;
virtual const std::shared_ptr<const MetadataCollectionKey<Set<std::string> > > info_vars_key() const;
virtual const std::shared_ptr<const MetadataValueKey<std::string> > accept_keywords_key() const;
virtual const std::shared_ptr<const MetadataValueKey<std::string> > sync_host_key() const;
@@ -196,7 +195,7 @@ namespace paludis
const std::shared_ptr<const Set<UnprefixedChoiceName> > arch_flags() const PALUDIS_ATTRIBUTE((warn_unused_result));
const std::shared_ptr<const UseDesc> use_desc() const PALUDIS_ATTRIBUTE((warn_unused_result));
- const std::string eapi_for_file(const FSEntry &) const PALUDIS_ATTRIBUTE((warn_unused_result));
+ const std::string eapi_for_file(const FSPath &) const PALUDIS_ATTRIBUTE((warn_unused_result));
///\name Set methods
///\{
@@ -208,14 +207,14 @@ namespace paludis
///\name Entries
///\{
- bool is_package_file(const QualifiedPackageName &, const FSEntry &) const
+ bool is_package_file(const QualifiedPackageName &, const FSPath &) const
PALUDIS_ATTRIBUTE((warn_unused_result));
- VersionSpec extract_package_file_version(const QualifiedPackageName &, const FSEntry &) const
+ VersionSpec extract_package_file_version(const QualifiedPackageName &, const FSPath &) const
PALUDIS_ATTRIBUTE((warn_unused_result));
const std::shared_ptr<const erepository::ERepositoryID> make_id(
- const QualifiedPackageName &, const FSEntry &) const
+ const QualifiedPackageName &, const FSPath &) const
PALUDIS_ATTRIBUTE((warn_unused_result));
void fetch(const std::shared_ptr<const erepository::ERepositoryID> &,
@@ -233,7 +232,7 @@ namespace paludis
void info(const std::shared_ptr<const erepository::ERepositoryID> &,
const InfoAction &) const;
- const std::string get_package_file_manifest_key(const FSEntry &, const QualifiedPackageName &) const;
+ const std::string get_package_file_manifest_key(const FSPath &, const QualifiedPackageName &) const;
const std::string binary_ebuild_name(const QualifiedPackageName &, const VersionSpec &, const std::string &) const
PALUDIS_ATTRIBUTE((warn_unused_result));
diff --git a/paludis/repositories/e/e_repository_TEST.cc b/paludis/repositories/e/e_repository_TEST.cc
index ece9777..b593474 100644
--- a/paludis/repositories/e/e_repository_TEST.cc
+++ b/paludis/repositories/e/e_repository_TEST.cc
@@ -32,6 +32,7 @@
#include <paludis/util/make_named_values.hh>
#include <paludis/util/set.hh>
#include <paludis/util/return_literal_function.hh>
+#include <paludis/util/fs_stat.hh>
#include <paludis/standard_output_manager.hh>
#include <paludis/util/safe_ifstream.hh>
#include <paludis/package_id.hh>
@@ -102,9 +103,9 @@ namespace test_cases
std::shared_ptr<Map<std::string, std::string> > keys(std::make_shared<Map<std::string, std::string>>());
keys->insert("format", "e");
keys->insert("names_cache", "/var/empty");
- keys->insert("location", stringify(FSEntry::cwd() / "e_repository_TEST_dir" / "repo1"));
- keys->insert("profiles", stringify(FSEntry::cwd() / "e_repository_TEST_dir" / "repo1/profiles/profile"));
- keys->insert("builddir", stringify(FSEntry::cwd() / "e_repository_TEST_dir" / "build"));
+ keys->insert("location", stringify(FSPath::cwd() / "e_repository_TEST_dir" / "repo1"));
+ keys->insert("profiles", stringify(FSPath::cwd() / "e_repository_TEST_dir" / "repo1/profiles/profile"));
+ keys->insert("builddir", stringify(FSPath::cwd() / "e_repository_TEST_dir" / "build"));
std::shared_ptr<Repository> repo(ERepository::repository_factory_create(&env,
std::bind(from_keys, keys, std::placeholders::_1)));
TEST_CHECK_STRINGIFY_EQUAL(repo->name(), "test-repo-1");
@@ -122,9 +123,9 @@ namespace test_cases
std::shared_ptr<Map<std::string, std::string> > keys(std::make_shared<Map<std::string, std::string>>());
keys->insert("format", "e");
keys->insert("names_cache", "/var/empty");
- keys->insert("location", stringify(FSEntry::cwd() / "e_repository_TEST_dir" / "repo2"));
- keys->insert("profiles", stringify(FSEntry::cwd() / "e_repository_TEST_dir" / "repo2/profiles/profile"));
- keys->insert("builddir", stringify(FSEntry::cwd() / "e_repository_TEST_dir" / "build"));
+ keys->insert("location", stringify(FSPath::cwd() / "e_repository_TEST_dir" / "repo2"));
+ keys->insert("profiles", stringify(FSPath::cwd() / "e_repository_TEST_dir" / "repo2/profiles/profile"));
+ keys->insert("builddir", stringify(FSPath::cwd() / "e_repository_TEST_dir" / "build"));
std::shared_ptr<Repository> repo(ERepository::repository_factory_create(&env,
std::bind(from_keys, keys, std::placeholders::_1)));
TEST_CHECK_STRINGIFY_EQUAL(repo->name(), "x-repo2");
@@ -142,9 +143,9 @@ namespace test_cases
std::shared_ptr<Map<std::string, std::string> > keys(std::make_shared<Map<std::string, std::string>>());
keys->insert("format", "e");
keys->insert("names_cache", "/var/empty");
- keys->insert("location", stringify(FSEntry::cwd() / "e_repository_TEST_dir" / "repo3"));
- keys->insert("profiles", stringify(FSEntry::cwd() / "e_repository_TEST_dir" / "repo3/profiles/profile"));
- keys->insert("builddir", stringify(FSEntry::cwd() / "e_repository_TEST_dir" / "build"));
+ keys->insert("location", stringify(FSPath::cwd() / "e_repository_TEST_dir" / "repo3"));
+ keys->insert("profiles", stringify(FSPath::cwd() / "e_repository_TEST_dir" / "repo3/profiles/profile"));
+ keys->insert("builddir", stringify(FSPath::cwd() / "e_repository_TEST_dir" / "build"));
std::shared_ptr<Repository> repo(ERepository::repository_factory_create(&env,
std::bind(from_keys, keys, std::placeholders::_1)));
TEST_CHECK_STRINGIFY_EQUAL(repo->name(), "x-repo3");
@@ -162,9 +163,9 @@ namespace test_cases
std::shared_ptr<Map<std::string, std::string> > keys(std::make_shared<Map<std::string, std::string>>());
keys->insert("format", "e");
keys->insert("names_cache", "/var/empty");
- keys->insert("location", stringify(FSEntry::cwd() / "e_repository_TEST_dir" / "repo1"));
- keys->insert("profiles", stringify(FSEntry::cwd() / "e_repository_TEST_dir" / "repo1/profiles/profile"));
- keys->insert("builddir", stringify(FSEntry::cwd() / "e_repository_TEST_dir" / "build"));
+ keys->insert("location", stringify(FSPath::cwd() / "e_repository_TEST_dir" / "repo1"));
+ keys->insert("profiles", stringify(FSPath::cwd() / "e_repository_TEST_dir" / "repo1/profiles/profile"));
+ keys->insert("builddir", stringify(FSPath::cwd() / "e_repository_TEST_dir" / "build"));
std::shared_ptr<Repository> repo(ERepository::repository_factory_create(&env,
std::bind(from_keys, keys, std::placeholders::_1)));
@@ -191,9 +192,9 @@ namespace test_cases
std::shared_ptr<Map<std::string, std::string> > keys(std::make_shared<Map<std::string, std::string>>());
keys->insert("format", "e");
keys->insert("names_cache", "/var/empty");
- keys->insert("location", stringify(FSEntry::cwd() / "e_repository_TEST_dir" / "repo1"));
- keys->insert("profiles", stringify(FSEntry::cwd() / "e_repository_TEST_dir" / "repo1/profiles/profile"));
- keys->insert("builddir", stringify(FSEntry::cwd() / "e_repository_TEST_dir" / "build"));
+ keys->insert("location", stringify(FSPath::cwd() / "e_repository_TEST_dir" / "repo1"));
+ keys->insert("profiles", stringify(FSPath::cwd() / "e_repository_TEST_dir" / "repo1/profiles/profile"));
+ keys->insert("builddir", stringify(FSPath::cwd() / "e_repository_TEST_dir" / "build"));
std::shared_ptr<Repository> repo(ERepository::repository_factory_create(&env,
std::bind(from_keys, keys, std::placeholders::_1)));
@@ -222,9 +223,9 @@ namespace test_cases
std::shared_ptr<Map<std::string, std::string> > keys(std::make_shared<Map<std::string, std::string>>());
keys->insert("format", "e");
keys->insert("names_cache", "/var/empty");
- keys->insert("location", stringify(FSEntry::cwd() / "e_repository_TEST_dir" / "repo4"));
- keys->insert("profiles", stringify(FSEntry::cwd() / "e_repository_TEST_dir" / "repo4/profiles/profile"));
- keys->insert("builddir", stringify(FSEntry::cwd() / "e_repository_TEST_dir" / "build"));
+ keys->insert("location", stringify(FSPath::cwd() / "e_repository_TEST_dir" / "repo4"));
+ keys->insert("profiles", stringify(FSPath::cwd() / "e_repository_TEST_dir" / "repo4/profiles/profile"));
+ keys->insert("builddir", stringify(FSPath::cwd() / "e_repository_TEST_dir" / "build"));
std::shared_ptr<Repository> repo(ERepository::repository_factory_create(&env,
std::bind(from_keys, keys, std::placeholders::_1)));
@@ -259,9 +260,9 @@ namespace test_cases
std::shared_ptr<Map<std::string, std::string> > keys(std::make_shared<Map<std::string, std::string>>());
keys->insert("format", "e");
keys->insert("names_cache", "/var/empty");
- keys->insert("location", stringify(FSEntry::cwd() / "e_repository_TEST_dir" / "repo4"));
- keys->insert("profiles", stringify(FSEntry::cwd() / "e_repository_TEST_dir" / "repo4/profiles/profile"));
- keys->insert("builddir", stringify(FSEntry::cwd() / "e_repository_TEST_dir" / "build"));
+ keys->insert("location", stringify(FSPath::cwd() / "e_repository_TEST_dir" / "repo4"));
+ keys->insert("profiles", stringify(FSPath::cwd() / "e_repository_TEST_dir" / "repo4/profiles/profile"));
+ keys->insert("builddir", stringify(FSPath::cwd() / "e_repository_TEST_dir" / "build"));
std::shared_ptr<Repository> repo(ERepository::repository_factory_create(&env,
std::bind(from_keys, keys, std::placeholders::_1)));
@@ -300,9 +301,9 @@ namespace test_cases
std::shared_ptr<Map<std::string, std::string> > keys(std::make_shared<Map<std::string, std::string>>());
keys->insert("format", "e");
keys->insert("names_cache", "/var/empty");
- keys->insert("location", stringify(FSEntry::cwd() / "e_repository_TEST_dir" / "repo4"));
- keys->insert("profiles", stringify(FSEntry::cwd() / "e_repository_TEST_dir" / "repo4/profiles/profile"));
- keys->insert("builddir", stringify(FSEntry::cwd() / "e_repository_TEST_dir" / "build"));
+ keys->insert("location", stringify(FSPath::cwd() / "e_repository_TEST_dir" / "repo4"));
+ keys->insert("profiles", stringify(FSPath::cwd() / "e_repository_TEST_dir" / "repo4/profiles/profile"));
+ keys->insert("builddir", stringify(FSPath::cwd() / "e_repository_TEST_dir" / "build"));
std::shared_ptr<Repository> repo(ERepository::repository_factory_create(&env,
std::bind(from_keys, keys, std::placeholders::_1)));
@@ -350,9 +351,9 @@ namespace test_cases
std::shared_ptr<Map<std::string, std::string> > keys(std::make_shared<Map<std::string, std::string>>());
keys->insert("format", "e");
keys->insert("names_cache", "/var/empty");
- keys->insert("location", stringify(FSEntry::cwd() / "e_repository_TEST_dir" / "repo5"));
- keys->insert("profiles", stringify(FSEntry::cwd() / "e_repository_TEST_dir" / "repo5/profiles/profile"));
- keys->insert("builddir", stringify(FSEntry::cwd() / "e_repository_TEST_dir" / "build"));
+ keys->insert("location", stringify(FSPath::cwd() / "e_repository_TEST_dir" / "repo5"));
+ keys->insert("profiles", stringify(FSPath::cwd() / "e_repository_TEST_dir" / "repo5/profiles/profile"));
+ keys->insert("builddir", stringify(FSPath::cwd() / "e_repository_TEST_dir" / "build"));
std::shared_ptr<Repository> repo(ERepository::repository_factory_create(&env,
std::bind(from_keys, keys, std::placeholders::_1)));
@@ -383,9 +384,9 @@ namespace test_cases
std::shared_ptr<Map<std::string, std::string> > keys(std::make_shared<Map<std::string, std::string>>());
keys->insert("format", "e");
keys->insert("names_cache", "/var/empty");
- keys->insert("location", stringify(FSEntry::cwd() / "e_repository_TEST_dir" / "repo4"));
- keys->insert("profiles", stringify(FSEntry::cwd() / "e_repository_TEST_dir" / "repo4/profiles/profile"));
- keys->insert("builddir", stringify(FSEntry::cwd() / "e_repository_TEST_dir" / "build"));
+ keys->insert("location", stringify(FSPath::cwd() / "e_repository_TEST_dir" / "repo4"));
+ keys->insert("profiles", stringify(FSPath::cwd() / "e_repository_TEST_dir" / "repo4/profiles/profile"));
+ keys->insert("builddir", stringify(FSPath::cwd() / "e_repository_TEST_dir" / "build"));
std::shared_ptr<Repository> repo(ERepository::repository_factory_create(&env,
std::bind(from_keys, keys, std::placeholders::_1)));
@@ -428,9 +429,9 @@ namespace test_cases
std::shared_ptr<Map<std::string, std::string> > keys(std::make_shared<Map<std::string, std::string>>());
keys->insert("format", "e");
keys->insert("names_cache", "/var/empty");
- keys->insert("location", stringify(FSEntry::cwd() / "e_repository_TEST_dir" / "repo8"));
- keys->insert("profiles", stringify(FSEntry::cwd() / "e_repository_TEST_dir" / "repo8/profiles/profile"));
- keys->insert("builddir", stringify(FSEntry::cwd() / "e_repository_TEST_dir" / "build"));
+ keys->insert("location", stringify(FSPath::cwd() / "e_repository_TEST_dir" / "repo8"));
+ keys->insert("profiles", stringify(FSPath::cwd() / "e_repository_TEST_dir" / "repo8/profiles/profile"));
+ keys->insert("builddir", stringify(FSPath::cwd() / "e_repository_TEST_dir" / "build"));
std::shared_ptr<Repository> repo(ERepository::repository_factory_create(&env,
std::bind(from_keys, keys, std::placeholders::_1)));
@@ -480,10 +481,10 @@ namespace test_cases
std::shared_ptr<Map<std::string, std::string> > keys(std::make_shared<Map<std::string, std::string>>());
keys->insert("format", "e");
keys->insert("names_cache", "/var/empty");
- keys->insert("write_cache", stringify(FSEntry::cwd() / "e_repository_TEST_dir" / "repo7/metadata/cache"));
- keys->insert("location", stringify(FSEntry::cwd() / "e_repository_TEST_dir" / "repo7"));
- keys->insert("profiles", stringify(FSEntry::cwd() / "e_repository_TEST_dir" / "repo7/profiles/profile"));
- keys->insert("builddir", stringify(FSEntry::cwd() / "e_repository_TEST_dir" / "build"));
+ keys->insert("write_cache", stringify(FSPath::cwd() / "e_repository_TEST_dir" / "repo7/metadata/cache"));
+ keys->insert("location", stringify(FSPath::cwd() / "e_repository_TEST_dir" / "repo7"));
+ keys->insert("profiles", stringify(FSPath::cwd() / "e_repository_TEST_dir" / "repo7/profiles/profile"));
+ keys->insert("builddir", stringify(FSPath::cwd() / "e_repository_TEST_dir" / "build"));
std::shared_ptr<Repository> repo(ERepository::repository_factory_create(&env,
std::bind(from_keys, keys, std::placeholders::_1)));
env.package_database()->add_repository(1, repo);
@@ -562,9 +563,9 @@ namespace test_cases
std::shared_ptr<Map<std::string, std::string> > keys(std::make_shared<Map<std::string, std::string>>());
keys->insert("format", "e");
keys->insert("names_cache", "/var/empty");
- keys->insert("location", stringify(FSEntry::cwd() / "e_repository_TEST_dir" / "repo7"));
- keys->insert("profiles", stringify(FSEntry::cwd() / "e_repository_TEST_dir" / "repo7/profiles/profile"));
- keys->insert("builddir", stringify(FSEntry::cwd() / "e_repository_TEST_dir" / "build"));
+ keys->insert("location", stringify(FSPath::cwd() / "e_repository_TEST_dir" / "repo7"));
+ keys->insert("profiles", stringify(FSPath::cwd() / "e_repository_TEST_dir" / "repo7/profiles/profile"));
+ keys->insert("builddir", stringify(FSPath::cwd() / "e_repository_TEST_dir" / "build"));
std::shared_ptr<Repository> repo(ERepository::repository_factory_create(&env,
std::bind(from_keys, keys, std::placeholders::_1)));
env.package_database()->add_repository(1, repo);
@@ -606,9 +607,9 @@ namespace test_cases
std::shared_ptr<Map<std::string, std::string> > keys(std::make_shared<Map<std::string, std::string>>());
keys->insert("format", "e");
keys->insert("names_cache", "/var/empty");
- keys->insert("location", stringify(FSEntry::cwd() / "e_repository_TEST_dir" / "repo9"));
- keys->insert("profiles", stringify(FSEntry::cwd() / "e_repository_TEST_dir" / "repo9/profiles/child"));
- keys->insert("builddir", stringify(FSEntry::cwd() / "e_repository_TEST_dir" / "build"));
+ keys->insert("location", stringify(FSPath::cwd() / "e_repository_TEST_dir" / "repo9"));
+ keys->insert("profiles", stringify(FSPath::cwd() / "e_repository_TEST_dir" / "repo9/profiles/child"));
+ keys->insert("builddir", stringify(FSPath::cwd() / "e_repository_TEST_dir" / "build"));
std::shared_ptr<ERepository> repo(std::static_pointer_cast<ERepository>(ERepository::repository_factory_create(&env,
std::bind(from_keys, keys, std::placeholders::_1))));
env.package_database()->add_repository(1, repo);
@@ -687,9 +688,9 @@ namespace test_cases
std::shared_ptr<Map<std::string, std::string> > keys18(std::make_shared<Map<std::string, std::string>>());
keys18->insert("format", "e");
keys18->insert("names_cache", "/var/empty");
- keys18->insert("location", stringify(FSEntry::cwd() / "e_repository_TEST_dir" / "repo18"));
- keys18->insert("profiles", stringify(FSEntry::cwd() / "e_repository_TEST_dir" / "repo18/profiles/profile"));
- keys18->insert("builddir", stringify(FSEntry::cwd() / "e_repository_TEST_dir" / "build"));
+ keys18->insert("location", stringify(FSPath::cwd() / "e_repository_TEST_dir" / "repo18"));
+ keys18->insert("profiles", stringify(FSPath::cwd() / "e_repository_TEST_dir" / "repo18/profiles/profile"));
+ keys18->insert("builddir", stringify(FSPath::cwd() / "e_repository_TEST_dir" / "build"));
std::shared_ptr<Repository> repo18(ERepository::repository_factory_create(&env,
std::bind(from_keys, keys18, std::placeholders::_1)));
env.package_database()->add_repository(1, repo18);
@@ -697,9 +698,9 @@ namespace test_cases
std::shared_ptr<Map<std::string, std::string> > keys19(std::make_shared<Map<std::string, std::string>>());
keys19->insert("format", "e");
keys19->insert("names_cache", "/var/empty");
- keys19->insert("location", stringify(FSEntry::cwd() / "e_repository_TEST_dir" / "repo19"));
+ keys19->insert("location", stringify(FSPath::cwd() / "e_repository_TEST_dir" / "repo19"));
keys19->insert("master_repository", "test-repo-18");
- keys19->insert("builddir", stringify(FSEntry::cwd() / "e_repository_TEST_dir" / "build"));
+ keys19->insert("builddir", stringify(FSPath::cwd() / "e_repository_TEST_dir" / "build"));
std::shared_ptr<Repository> repo19(ERepository::repository_factory_create(&env,
std::bind(from_keys, keys19, std::placeholders::_1)));
env.package_database()->add_repository(1, repo19);
@@ -743,9 +744,9 @@ namespace test_cases
std::shared_ptr<Map<std::string, std::string> > keys(std::make_shared<Map<std::string, std::string>>());
keys->insert("format", "e");
keys->insert("names_cache", "/var/empty");
- keys->insert("location", stringify(FSEntry::cwd() / "e_repository_TEST_dir" / "repo10"));
- keys->insert("profiles", stringify(FSEntry::cwd() / "e_repository_TEST_dir" / "repo10/profiles/profile/subprofile"));
- keys->insert("builddir", stringify(FSEntry::cwd() / "e_repository_TEST_dir" / "build"));
+ keys->insert("location", stringify(FSPath::cwd() / "e_repository_TEST_dir" / "repo10"));
+ keys->insert("profiles", stringify(FSPath::cwd() / "e_repository_TEST_dir" / "repo10/profiles/profile/subprofile"));
+ keys->insert("builddir", stringify(FSPath::cwd() / "e_repository_TEST_dir" / "build"));
std::shared_ptr<Repository> repo(ERepository::repository_factory_create(&env,
std::bind(from_keys, keys, std::placeholders::_1)));
env.package_database()->add_repository(1, repo);
@@ -778,9 +779,9 @@ namespace test_cases
std::shared_ptr<Map<std::string, std::string> > keys(std::make_shared<Map<std::string, std::string>>());
keys->insert("format", "e");
keys->insert("names_cache", "/var/empty");
- keys->insert("location", stringify(FSEntry::cwd() / "e_repository_TEST_dir" / "repo15"));
- keys->insert("profiles", stringify(FSEntry::cwd() / "e_repository_TEST_dir" / "repo15/profiles/profile"));
- keys->insert("builddir", stringify(FSEntry::cwd() / "e_repository_TEST_dir" / "build"));
+ keys->insert("location", stringify(FSPath::cwd() / "e_repository_TEST_dir" / "repo15"));
+ keys->insert("profiles", stringify(FSPath::cwd() / "e_repository_TEST_dir" / "repo15/profiles/profile"));
+ keys->insert("builddir", stringify(FSPath::cwd() / "e_repository_TEST_dir" / "build"));
std::shared_ptr<ERepository> repo(std::static_pointer_cast<ERepository>(ERepository::repository_factory_create(&env,
std::bind(from_keys, keys, std::placeholders::_1))));
env.package_database()->add_repository(1, repo);
@@ -820,9 +821,9 @@ namespace test_cases
std::shared_ptr<Map<std::string, std::string> > keys(std::make_shared<Map<std::string, std::string>>());
keys->insert("format", "e");
keys->insert("names_cache", "/var/empty");
- keys->insert("location", stringify(FSEntry::cwd() / "e_repository_TEST_dir" / "repo15"));
- keys->insert("profiles", stringify(FSEntry::cwd() / "e_repository_TEST_dir" / "repo15/profiles/profile/subprofile"));
- keys->insert("builddir", stringify(FSEntry::cwd() / "e_repository_TEST_dir" / "build"));
+ keys->insert("location", stringify(FSPath::cwd() / "e_repository_TEST_dir" / "repo15"));
+ keys->insert("profiles", stringify(FSPath::cwd() / "e_repository_TEST_dir" / "repo15/profiles/profile/subprofile"));
+ keys->insert("builddir", stringify(FSPath::cwd() / "e_repository_TEST_dir" / "build"));
std::shared_ptr<ERepository> repo(std::static_pointer_cast<ERepository>(ERepository::repository_factory_create(&env,
std::bind(from_keys, keys, std::placeholders::_1))));
env.package_database()->add_repository(1, repo);
@@ -868,16 +869,16 @@ namespace test_cases
std::shared_ptr<Map<std::string, std::string> > keys(std::make_shared<Map<std::string, std::string>>());
keys->insert("format", "e");
keys->insert("names_cache", "/var/empty");
- keys->insert("location", stringify(FSEntry::cwd() / "e_repository_TEST_dir" / "repo11"));
- keys->insert("profiles", stringify(FSEntry::cwd() / "e_repository_TEST_dir" / "repo11/profiles/profile"));
- keys->insert("builddir", stringify(FSEntry::cwd() / "e_repository_TEST_dir" / "build"));
+ keys->insert("location", stringify(FSPath::cwd() / "e_repository_TEST_dir" / "repo11"));
+ keys->insert("profiles", stringify(FSPath::cwd() / "e_repository_TEST_dir" / "repo11/profiles/profile"));
+ keys->insert("builddir", stringify(FSPath::cwd() / "e_repository_TEST_dir" / "build"));
std::shared_ptr<ERepository> repo(std::static_pointer_cast<ERepository>(ERepository::repository_factory_create(&env,
std::bind(from_keys, keys, std::placeholders::_1))));
repo->make_manifest(QualifiedPackageName("category/package"));
std::multiset<std::string> made_manifest, reference_manifest;
- SafeIFStream made_manifest_stream(FSEntry("e_repository_TEST_dir/repo11/category/package/Manifest")),
- reference_manifest_stream(FSEntry("e_repository_TEST_dir/repo11/Manifest_correct"));
+ SafeIFStream made_manifest_stream(FSPath("e_repository_TEST_dir/repo11/category/package/Manifest")),
+ reference_manifest_stream(FSPath("e_repository_TEST_dir/repo11/Manifest_correct"));
std::string line;
@@ -913,14 +914,14 @@ namespace test_cases
std::shared_ptr<Map<std::string, std::string> > keys(std::make_shared<Map<std::string, std::string>>());
keys->insert("format", "exheres");
keys->insert("names_cache", "/var/empty");
- keys->insert("location", stringify(FSEntry::cwd() / "e_repository_TEST_dir" / "repo12"));
- keys->insert("profiles", stringify(FSEntry::cwd() / "e_repository_TEST_dir" / "repo12/profiles/profile"));
+ keys->insert("location", stringify(FSPath::cwd() / "e_repository_TEST_dir" / "repo12"));
+ keys->insert("profiles", stringify(FSPath::cwd() / "e_repository_TEST_dir" / "repo12/profiles/profile"));
keys->insert("layout", "exheres");
keys->insert("eapi_when_unknown", "exheres-0");
keys->insert("eapi_when_unspecified", "exheres-0");
keys->insert("profile_eapi", "exheres-0");
- keys->insert("distdir", stringify(FSEntry::cwd() / "e_repository_TEST_dir" / "distdir"));
- keys->insert("builddir", stringify(FSEntry::cwd() / "e_repository_TEST_dir" / "build"));
+ keys->insert("distdir", stringify(FSPath::cwd() / "e_repository_TEST_dir" / "distdir"));
+ keys->insert("builddir", stringify(FSPath::cwd() / "e_repository_TEST_dir" / "build"));
std::shared_ptr<Repository> repo(ERepository::repository_factory_create(&env,
std::bind(from_keys, keys, std::placeholders::_1)));
env.package_database()->add_repository(1, repo);
@@ -953,31 +954,31 @@ namespace test_cases
PackageDepSpec(parse_user_package_dep_spec("cat/fetched-files",
&env, { })), { }))]->last());
TEST_CHECK(bool(fetched_files_id));
- TEST_CHECK((FSEntry("e_repository_TEST_dir") / "distdir" / "already-fetched.txt").is_regular_file());
+ TEST_CHECK((FSPath("e_repository_TEST_dir") / "distdir" / "already-fetched.txt").stat().is_regular_file());
fetched_files_id->perform_action(action);
- TEST_CHECK((FSEntry("e_repository_TEST_dir") / "distdir" / "already-fetched.txt").is_regular_file());
+ TEST_CHECK((FSPath("e_repository_TEST_dir") / "distdir" / "already-fetched.txt").stat().is_regular_file());
}
{
TestMessageSuffix suffix("fetchable files", true);
- TEST_CHECK(! (FSEntry("e_repository_TEST_dir") / "distdir" / "fetchable-1.txt").is_regular_file());
+ TEST_CHECK(! (FSPath("e_repository_TEST_dir") / "distdir" / "fetchable-1.txt").stat().is_regular_file());
const std::shared_ptr<const PackageID> fetchable_files_id(*env[selection::RequireExactlyOne(generator::Matches(
PackageDepSpec(parse_user_package_dep_spec("cat/fetchable-files",
&env, { })), { }))]->last());
TEST_CHECK(bool(fetchable_files_id));
fetchable_files_id->perform_action(action);
- TEST_CHECK((FSEntry("e_repository_TEST_dir") / "distdir" / "fetchable-1.txt").is_regular_file());
+ TEST_CHECK((FSPath("e_repository_TEST_dir") / "distdir" / "fetchable-1.txt").stat().is_regular_file());
}
{
TestMessageSuffix suffix("arrow files", true);
- TEST_CHECK(! (FSEntry("e_repository_TEST_dir") / "distdir" / "arrowed.txt").is_regular_file());
+ TEST_CHECK(! (FSPath("e_repository_TEST_dir") / "distdir" / "arrowed.txt").stat().is_regular_file());
const std::shared_ptr<const PackageID> arrow_files_id(*env[selection::RequireExactlyOne(generator::Matches(
PackageDepSpec(parse_user_package_dep_spec("cat/arrow-files",
&env, { })), { }))]->last());
TEST_CHECK(bool(arrow_files_id));
arrow_files_id->perform_action(action);
- TEST_CHECK((FSEntry("e_repository_TEST_dir") / "distdir" / "arrowed.txt").is_regular_file());
+ TEST_CHECK((FSPath("e_repository_TEST_dir") / "distdir" / "arrowed.txt").stat().is_regular_file());
}
{
@@ -1026,9 +1027,9 @@ namespace test_cases
std::shared_ptr<Map<std::string, std::string> > keys(std::make_shared<Map<std::string, std::string>>());
keys->insert("format", "e");
keys->insert("names_cache", "/var/empty");
- keys->insert("location", stringify(FSEntry::cwd() / "e_repository_TEST_dir" / "repo11"));
- keys->insert("profiles", stringify(FSEntry::cwd() / "e_repository_TEST_dir" / "repo11/profiles/profile"));
- keys->insert("builddir", stringify(FSEntry::cwd() / "e_repository_TEST_dir" / "build"));
+ keys->insert("location", stringify(FSPath::cwd() / "e_repository_TEST_dir" / "repo11"));
+ keys->insert("profiles", stringify(FSPath::cwd() / "e_repository_TEST_dir" / "repo11/profiles/profile"));
+ keys->insert("builddir", stringify(FSPath::cwd() / "e_repository_TEST_dir" / "build"));
std::shared_ptr<ERepository> repo(std::static_pointer_cast<ERepository>(ERepository::repository_factory_create(&env,
std::bind(from_keys, keys, std::placeholders::_1))));
env.package_database()->add_repository(1, repo);
diff --git a/paludis/repositories/e/e_repository_TEST_0.cc b/paludis/repositories/e/e_repository_TEST_0.cc
index 8dab2f6..106d475 100644
--- a/paludis/repositories/e/e_repository_TEST_0.cc
+++ b/paludis/repositories/e/e_repository_TEST_0.cc
@@ -114,14 +114,14 @@ namespace test_cases
std::shared_ptr<Map<std::string, std::string> > keys(std::make_shared<Map<std::string, std::string>>());
keys->insert("format", "e");
keys->insert("names_cache", "/var/empty");
- keys->insert("location", stringify(FSEntry::cwd() / "e_repository_TEST_0_dir" / "repo"));
- keys->insert("profiles", stringify(FSEntry::cwd() / "e_repository_TEST_0_dir" / "repo/profiles/profile"));
+ keys->insert("location", stringify(FSPath::cwd() / "e_repository_TEST_0_dir" / "repo"));
+ keys->insert("profiles", stringify(FSPath::cwd() / "e_repository_TEST_0_dir" / "repo/profiles/profile"));
keys->insert("layout", "traditional");
keys->insert("eapi_when_unknown", "0");
keys->insert("eapi_when_unspecified", "0");
keys->insert("profile_eapi", "0");
- keys->insert("distdir", stringify(FSEntry::cwd() / "e_repository_TEST_0_dir" / "distdir"));
- keys->insert("builddir", stringify(FSEntry::cwd() / "e_repository_TEST_0_dir" / "build"));
+ keys->insert("distdir", stringify(FSPath::cwd() / "e_repository_TEST_0_dir" / "distdir"));
+ keys->insert("builddir", stringify(FSPath::cwd() / "e_repository_TEST_0_dir" / "build"));
std::shared_ptr<Repository> repo(ERepository::repository_factory_create(&env,
std::bind(from_keys, keys, std::placeholders::_1)));
env.package_database()->add_repository(1, repo);
diff --git a/paludis/repositories/e/e_repository_TEST_1.cc b/paludis/repositories/e/e_repository_TEST_1.cc
index 417c7b2..d30c80b 100644
--- a/paludis/repositories/e/e_repository_TEST_1.cc
+++ b/paludis/repositories/e/e_repository_TEST_1.cc
@@ -107,14 +107,14 @@ namespace test_cases
std::shared_ptr<Map<std::string, std::string> > keys(std::make_shared<Map<std::string, std::string>>());
keys->insert("format", "e");
keys->insert("names_cache", "/var/empty");
- keys->insert("location", stringify(FSEntry::cwd() / "e_repository_TEST_1_dir" / "repo"));
- keys->insert("profiles", stringify(FSEntry::cwd() / "e_repository_TEST_1_dir" / "repo/profiles/profile"));
+ keys->insert("location", stringify(FSPath::cwd() / "e_repository_TEST_1_dir" / "repo"));
+ keys->insert("profiles", stringify(FSPath::cwd() / "e_repository_TEST_1_dir" / "repo/profiles/profile"));
keys->insert("layout", "traditional");
keys->insert("eapi_when_unknown", "0");
keys->insert("eapi_when_unspecified", "0");
keys->insert("profile_eapi", "0");
- keys->insert("distdir", stringify(FSEntry::cwd() / "e_repository_TEST_1_dir" / "distdir"));
- keys->insert("builddir", stringify(FSEntry::cwd() / "e_repository_TEST_1_dir" / "build"));
+ keys->insert("distdir", stringify(FSPath::cwd() / "e_repository_TEST_1_dir" / "distdir"));
+ keys->insert("builddir", stringify(FSPath::cwd() / "e_repository_TEST_1_dir" / "build"));
std::shared_ptr<Repository> repo(ERepository::repository_factory_create(&env,
std::bind(from_keys, keys, std::placeholders::_1)));
env.package_database()->add_repository(1, repo);
diff --git a/paludis/repositories/e/e_repository_TEST_2.cc b/paludis/repositories/e/e_repository_TEST_2.cc
index 6a63c6d..88d5201 100644
--- a/paludis/repositories/e/e_repository_TEST_2.cc
+++ b/paludis/repositories/e/e_repository_TEST_2.cc
@@ -107,14 +107,14 @@ namespace test_cases
std::shared_ptr<Map<std::string, std::string> > keys(std::make_shared<Map<std::string, std::string>>());
keys->insert("format", "e");
keys->insert("names_cache", "/var/empty");
- keys->insert("location", stringify(FSEntry::cwd() / "e_repository_TEST_2_dir" / "repo"));
- keys->insert("profiles", stringify(FSEntry::cwd() / "e_repository_TEST_2_dir" / "repo/profiles/profile"));
+ keys->insert("location", stringify(FSPath::cwd() / "e_repository_TEST_2_dir" / "repo"));
+ keys->insert("profiles", stringify(FSPath::cwd() / "e_repository_TEST_2_dir" / "repo/profiles/profile"));
keys->insert("layout", "traditional");
keys->insert("eapi_when_unknown", "0");
keys->insert("eapi_when_unspecified", "0");
keys->insert("profile_eapi", "0");
- keys->insert("distdir", stringify(FSEntry::cwd() / "e_repository_TEST_2_dir" / "distdir"));
- keys->insert("builddir", stringify(FSEntry::cwd() / "e_repository_TEST_2_dir" / "build"));
+ keys->insert("distdir", stringify(FSPath::cwd() / "e_repository_TEST_2_dir" / "distdir"));
+ keys->insert("builddir", stringify(FSPath::cwd() / "e_repository_TEST_2_dir" / "build"));
std::shared_ptr<Repository> repo(ERepository::repository_factory_create(&env,
std::bind(from_keys, keys, std::placeholders::_1)));
env.package_database()->add_repository(1, repo);
diff --git a/paludis/repositories/e/e_repository_TEST_3.cc b/paludis/repositories/e/e_repository_TEST_3.cc
index ee84192..6a2fb3d 100644
--- a/paludis/repositories/e/e_repository_TEST_3.cc
+++ b/paludis/repositories/e/e_repository_TEST_3.cc
@@ -107,14 +107,14 @@ namespace test_cases
std::shared_ptr<Map<std::string, std::string> > keys(std::make_shared<Map<std::string, std::string>>());
keys->insert("format", "e");
keys->insert("names_cache", "/var/empty");
- keys->insert("location", stringify(FSEntry::cwd() / "e_repository_TEST_3_dir" / "repo"));
- keys->insert("profiles", stringify(FSEntry::cwd() / "e_repository_TEST_3_dir" / "repo/profiles/profile"));
+ keys->insert("location", stringify(FSPath::cwd() / "e_repository_TEST_3_dir" / "repo"));
+ keys->insert("profiles", stringify(FSPath::cwd() / "e_repository_TEST_3_dir" / "repo/profiles/profile"));
keys->insert("layout", "traditional");
keys->insert("eapi_when_unknown", "0");
keys->insert("eapi_when_unspecified", "0");
keys->insert("profile_eapi", "0");
- keys->insert("distdir", stringify(FSEntry::cwd() / "e_repository_TEST_3_dir" / "distdir"));
- keys->insert("builddir", stringify(FSEntry::cwd() / "e_repository_TEST_3_dir" / "build"));
+ keys->insert("distdir", stringify(FSPath::cwd() / "e_repository_TEST_3_dir" / "distdir"));
+ keys->insert("builddir", stringify(FSPath::cwd() / "e_repository_TEST_3_dir" / "build"));
std::shared_ptr<Repository> repo(ERepository::repository_factory_create(&env,
std::bind(from_keys, keys, std::placeholders::_1)));
env.package_database()->add_repository(1, repo);
diff --git a/paludis/repositories/e/e_repository_TEST_4.cc b/paludis/repositories/e/e_repository_TEST_4.cc
index ce63a15..6971d52 100644
--- a/paludis/repositories/e/e_repository_TEST_4.cc
+++ b/paludis/repositories/e/e_repository_TEST_4.cc
@@ -107,14 +107,14 @@ namespace test_cases
std::shared_ptr<Map<std::string, std::string> > keys(std::make_shared<Map<std::string, std::string>>());
keys->insert("format", "e");
keys->insert("names_cache", "/var/empty");
- keys->insert("location", stringify(FSEntry::cwd() / "e_repository_TEST_4_dir" / "repo"));
- keys->insert("profiles", stringify(FSEntry::cwd() / "e_repository_TEST_4_dir" / "repo/profiles/profile"));
+ keys->insert("location", stringify(FSPath::cwd() / "e_repository_TEST_4_dir" / "repo"));
+ keys->insert("profiles", stringify(FSPath::cwd() / "e_repository_TEST_4_dir" / "repo/profiles/profile"));
keys->insert("layout", "traditional");
keys->insert("eapi_when_unknown", "0");
keys->insert("eapi_when_unspecified", "0");
keys->insert("profile_eapi", "0");
- keys->insert("distdir", stringify(FSEntry::cwd() / "e_repository_TEST_4_dir" / "distdir"));
- keys->insert("builddir", stringify(FSEntry::cwd() / "e_repository_TEST_4_dir" / "build"));
+ keys->insert("distdir", stringify(FSPath::cwd() / "e_repository_TEST_4_dir" / "distdir"));
+ keys->insert("builddir", stringify(FSPath::cwd() / "e_repository_TEST_4_dir" / "build"));
std::shared_ptr<Repository> repo(ERepository::repository_factory_create(&env,
std::bind(from_keys, keys, std::placeholders::_1)));
env.package_database()->add_repository(1, repo);
diff --git a/paludis/repositories/e/e_repository_TEST_dependencies_rewriter.cc b/paludis/repositories/e/e_repository_TEST_dependencies_rewriter.cc
index 9060904..1ca688e 100644
--- a/paludis/repositories/e/e_repository_TEST_dependencies_rewriter.cc
+++ b/paludis/repositories/e/e_repository_TEST_dependencies_rewriter.cc
@@ -97,9 +97,9 @@ namespace test_cases
std::shared_ptr<Map<std::string, std::string> > keys(std::make_shared<Map<std::string, std::string>>());
keys->insert("format", "e");
keys->insert("names_cache", "/var/empty");
- keys->insert("location", stringify(FSEntry::cwd() / "e_repository_TEST_dependencies_rewriter_dir" / "repo"));
- keys->insert("profiles", stringify(FSEntry::cwd() / "e_repository_TEST_dependencies_rewriter_dir" / "repo/profiles/profile"));
- keys->insert("builddir", stringify(FSEntry::cwd() / "e_repository_TEST_dependencies_rewriter_dir" / "build"));
+ keys->insert("location", stringify(FSPath::cwd() / "e_repository_TEST_dependencies_rewriter_dir" / "repo"));
+ keys->insert("profiles", stringify(FSPath::cwd() / "e_repository_TEST_dependencies_rewriter_dir" / "repo/profiles/profile"));
+ keys->insert("builddir", stringify(FSPath::cwd() / "e_repository_TEST_dependencies_rewriter_dir" / "build"));
std::shared_ptr<Repository> repo(ERepository::repository_factory_create(&env,
std::bind(from_keys, keys, std::placeholders::_1)));
env.package_database()->add_repository(1, repo);
diff --git a/paludis/repositories/e/e_repository_TEST_ever.cc b/paludis/repositories/e/e_repository_TEST_ever.cc
index f29ed9d..ed65748 100644
--- a/paludis/repositories/e/e_repository_TEST_ever.cc
+++ b/paludis/repositories/e/e_repository_TEST_ever.cc
@@ -115,14 +115,14 @@ namespace
std::shared_ptr<Map<std::string, std::string> > keys(std::make_shared<Map<std::string, std::string>>());
keys->insert("format", "e");
keys->insert("names_cache", "/var/empty");
- keys->insert("location", stringify(FSEntry::cwd() / "e_repository_TEST_ever_dir" / "repo1"));
- keys->insert("profiles", stringify(FSEntry::cwd() / "e_repository_TEST_ever_dir" / "repo1/profiles/profile"));
+ keys->insert("location", stringify(FSPath::cwd() / "e_repository_TEST_ever_dir" / "repo1"));
+ keys->insert("profiles", stringify(FSPath::cwd() / "e_repository_TEST_ever_dir" / "repo1/profiles/profile"));
keys->insert("layout", "exheres");
keys->insert("eapi_when_unknown", "exheres-0");
keys->insert("eapi_when_unspecified", "exheres-0");
keys->insert("profile_eapi", "exheres-0");
- keys->insert("distdir", stringify(FSEntry::cwd() / "e_repository_TEST_ever_dir" / "distdir"));
- keys->insert("builddir", stringify(FSEntry::cwd() / "e_repository_TEST_ever_dir" / "build"));
+ keys->insert("distdir", stringify(FSPath::cwd() / "e_repository_TEST_ever_dir" / "distdir"));
+ keys->insert("builddir", stringify(FSPath::cwd() / "e_repository_TEST_ever_dir" / "build"));
std::shared_ptr<Repository> repo(ERepository::repository_factory_create(&env,
std::bind(from_keys, keys, std::placeholders::_1)));
env.package_database()->add_repository(1, repo);
diff --git a/paludis/repositories/e/e_repository_TEST_exheres_0.cc b/paludis/repositories/e/e_repository_TEST_exheres_0.cc
index 0f5d831..acaf812 100644
--- a/paludis/repositories/e/e_repository_TEST_exheres_0.cc
+++ b/paludis/repositories/e/e_repository_TEST_exheres_0.cc
@@ -112,14 +112,14 @@ namespace test_cases
std::shared_ptr<Map<std::string, std::string> > keys(std::make_shared<Map<std::string, std::string>>());
keys->insert("format", "e");
keys->insert("names_cache", "/var/empty");
- keys->insert("location", stringify(FSEntry::cwd() / "e_repository_TEST_exheres_0_dir" / "repo"));
- keys->insert("profiles", stringify(FSEntry::cwd() / "e_repository_TEST_exheres_0_dir" / "repo/profiles/profile"));
+ keys->insert("location", stringify(FSPath::cwd() / "e_repository_TEST_exheres_0_dir" / "repo"));
+ keys->insert("profiles", stringify(FSPath::cwd() / "e_repository_TEST_exheres_0_dir" / "repo/profiles/profile"));
keys->insert("layout", "exheres");
keys->insert("eapi_when_unknown", "exheres-0");
keys->insert("eapi_when_unspecified", "exheres-0");
keys->insert("profile_eapi_when_unspecified", "exheres-0");
- keys->insert("distdir", stringify(FSEntry::cwd() / "e_repository_TEST_exheres_0_dir" / "distdir"));
- keys->insert("builddir", stringify(FSEntry::cwd() / "e_repository_TEST_exheres_0_dir" / "build"));
+ keys->insert("distdir", stringify(FSPath::cwd() / "e_repository_TEST_exheres_0_dir" / "distdir"));
+ keys->insert("builddir", stringify(FSPath::cwd() / "e_repository_TEST_exheres_0_dir" / "build"));
std::shared_ptr<Repository> repo(ERepository::repository_factory_create(&env,
std::bind(from_keys, keys, std::placeholders::_1)));
env.package_database()->add_repository(1, repo);
diff --git a/paludis/repositories/e/e_repository_TEST_exlibs.cc b/paludis/repositories/e/e_repository_TEST_exlibs.cc
index 9e9254f..9c6bb89 100644
--- a/paludis/repositories/e/e_repository_TEST_exlibs.cc
+++ b/paludis/repositories/e/e_repository_TEST_exlibs.cc
@@ -123,14 +123,14 @@ namespace
std::shared_ptr<Map<std::string, std::string> > keys(std::make_shared<Map<std::string, std::string>>());
keys->insert("format", "e");
keys->insert("names_cache", "/var/empty");
- keys->insert("location", stringify(FSEntry::cwd() / "e_repository_TEST_exlibs_dir" / "repo1"));
- keys->insert("profiles", stringify(FSEntry::cwd() / "e_repository_TEST_exlibs_dir" / "repo1/profiles/profile"));
+ keys->insert("location", stringify(FSPath::cwd() / "e_repository_TEST_exlibs_dir" / "repo1"));
+ keys->insert("profiles", stringify(FSPath::cwd() / "e_repository_TEST_exlibs_dir" / "repo1/profiles/profile"));
keys->insert("layout", "exheres");
keys->insert("eapi_when_unknown", "exheres-0");
keys->insert("eapi_when_unspecified", "exheres-0");
keys->insert("profile_eapi", "exheres-0");
- keys->insert("distdir", stringify(FSEntry::cwd() / "e_repository_TEST_exlibs_dir" / "distdir"));
- keys->insert("builddir", stringify(FSEntry::cwd() / "e_repository_TEST_exlibs_dir" / "build"));
+ keys->insert("distdir", stringify(FSPath::cwd() / "e_repository_TEST_exlibs_dir" / "distdir"));
+ keys->insert("builddir", stringify(FSPath::cwd() / "e_repository_TEST_exlibs_dir" / "build"));
std::shared_ptr<Repository> repo(ERepository::repository_factory_create(&env,
std::bind(from_keys, keys, std::placeholders::_1)));
env.package_database()->add_repository(1, repo);
diff --git a/paludis/repositories/e/e_repository_TEST_pbin.cc b/paludis/repositories/e/e_repository_TEST_pbin.cc
index c041f0b..2831bc5 100644
--- a/paludis/repositories/e/e_repository_TEST_pbin.cc
+++ b/paludis/repositories/e/e_repository_TEST_pbin.cc
@@ -31,6 +31,7 @@
#include <paludis/util/map.hh>
#include <paludis/util/make_named_values.hh>
#include <paludis/util/set.hh>
+#include <paludis/util/fs_stat.hh>
#include <paludis/standard_output_manager.hh>
#include <paludis/util/safe_ifstream.hh>
#include <paludis/package_id.hh>
@@ -110,19 +111,19 @@ namespace test_cases
{
TestEnvironment env;
env.set_paludis_command("/bin/false");
- FSEntry root(FSEntry::cwd() / "e_repository_TEST_pbin_dir" / "root");
+ FSPath root(FSPath::cwd() / "e_repository_TEST_pbin_dir" / "root");
std::shared_ptr<Map<std::string, std::string> > keys(std::make_shared<Map<std::string, std::string>>());
keys->insert("format", "e");
keys->insert("names_cache", "/var/empty");
- keys->insert("location", stringify(FSEntry::cwd() / "e_repository_TEST_pbin_dir" / ("repo" + base_eapi)));
- keys->insert("profiles", stringify(FSEntry::cwd() / "e_repository_TEST_pbin_dir" / ("repo" + base_eapi + "/profiles/profile")));
+ keys->insert("location", stringify(FSPath::cwd() / "e_repository_TEST_pbin_dir" / ("repo" + base_eapi)));
+ keys->insert("profiles", stringify(FSPath::cwd() / "e_repository_TEST_pbin_dir" / ("repo" + base_eapi + "/profiles/profile")));
keys->insert("layout", "traditional");
keys->insert("eapi_when_unknown", "0");
keys->insert("eapi_when_unspecified", "0");
keys->insert("profile_eapi", "0");
- keys->insert("distdir", stringify(FSEntry::cwd() / "e_repository_TEST_pbin_dir" / "distdir"));
- keys->insert("builddir", stringify(FSEntry::cwd() / "e_repository_TEST_pbin_dir" / "build"));
+ keys->insert("distdir", stringify(FSPath::cwd() / "e_repository_TEST_pbin_dir" / "distdir"));
+ keys->insert("builddir", stringify(FSPath::cwd() / "e_repository_TEST_pbin_dir" / "build"));
keys->insert("root", stringify(root));
std::shared_ptr<Repository> repo(ERepository::repository_factory_create(&env,
std::bind(from_keys, keys, std::placeholders::_1)));
@@ -131,18 +132,18 @@ namespace test_cases
std::shared_ptr<Map<std::string, std::string> > b_keys(std::make_shared<Map<std::string, std::string>>());
b_keys->insert("format", "e");
b_keys->insert("names_cache", "/var/empty");
- b_keys->insert("location", stringify(FSEntry::cwd() / "e_repository_TEST_pbin_dir" / ("binrepo" + base_eapi)));
- b_keys->insert("profiles", stringify(FSEntry::cwd() / "e_repository_TEST_pbin_dir" / ("binrepo" + base_eapi + "/profiles/profile")));
+ b_keys->insert("location", stringify(FSPath::cwd() / "e_repository_TEST_pbin_dir" / ("binrepo" + base_eapi)));
+ b_keys->insert("profiles", stringify(FSPath::cwd() / "e_repository_TEST_pbin_dir" / ("binrepo" + base_eapi + "/profiles/profile")));
b_keys->insert("layout", "traditional");
b_keys->insert("eapi_when_unknown", "0");
b_keys->insert("eapi_when_unspecified", "0");
b_keys->insert("profile_eapi", "0");
- b_keys->insert("distdir", stringify(FSEntry::cwd() / "e_repository_TEST_pbin_dir" / "distdir"));
- b_keys->insert("binary_distdir", stringify(FSEntry::cwd() / "e_repository_TEST_pbin_dir" / "distdir"));
+ b_keys->insert("distdir", stringify(FSPath::cwd() / "e_repository_TEST_pbin_dir" / "distdir"));
+ b_keys->insert("binary_distdir", stringify(FSPath::cwd() / "e_repository_TEST_pbin_dir" / "distdir"));
b_keys->insert("binary_keywords_filter", "test");
b_keys->insert("binary_destination", "true");
b_keys->insert("master_repository", "repo" + base_eapi);
- b_keys->insert("builddir", stringify(FSEntry::cwd() / "e_repository_TEST_pbin_dir" / "build"));
+ b_keys->insert("builddir", stringify(FSPath::cwd() / "e_repository_TEST_pbin_dir" / "build"));
b_keys->insert("root", stringify(root));
std::shared_ptr<Repository> b_repo(ERepository::repository_factory_create(&env,
std::bind(from_keys, b_keys, std::placeholders::_1)));
@@ -152,7 +153,7 @@ namespace test_cases
v_keys->insert("format", "vdb");
v_keys->insert("names_cache", "/var/empty");
v_keys->insert("provides_cache", "/var/empty");
- v_keys->insert("location", stringify(FSEntry::cwd() / "e_repository_TEST_pbin_dir" / "vdb"));
+ v_keys->insert("location", stringify(FSPath::cwd() / "e_repository_TEST_pbin_dir" / "vdb"));
v_keys->insert("root", stringify(root));
std::shared_ptr<Repository> v_repo(VDBRepository::repository_factory_create(&env,
std::bind(from_keys, keys, std::placeholders::_1)));
@@ -176,7 +177,7 @@ namespace test_cases
id->perform_action(bin_action);
}
- TEST_CHECK(! (root / ("installed-" + base_eapi)).exists());
+ TEST_CHECK(! (root / ("installed-" + base_eapi)).stat().exists());
b_repo->invalidate();
{
@@ -198,7 +199,7 @@ namespace test_cases
id->perform_action(install_action);
}
- TEST_CHECK((root / ("installed-" + base_eapi)).exists());
+ TEST_CHECK((root / ("installed-" + base_eapi)).stat().exists());
}
} test_e_repository_install_eapi_pbin_0("0"), test_e_repository_install_eapi_pbin_1("1"),
test_e_repository_install_eapi_pbin_2("2"), test_e_repository_install_eapi_pbin_3("3"),
diff --git a/paludis/repositories/e/e_repository_TEST_phases.cc b/paludis/repositories/e/e_repository_TEST_phases.cc
index 1129c5b..7e36036 100644
--- a/paludis/repositories/e/e_repository_TEST_phases.cc
+++ b/paludis/repositories/e/e_repository_TEST_phases.cc
@@ -123,14 +123,14 @@ namespace
std::shared_ptr<Map<std::string, std::string> > keys(std::make_shared<Map<std::string, std::string>>());
keys->insert("format", "e");
keys->insert("names_cache", "/var/empty");
- keys->insert("location", stringify(FSEntry::cwd() / "e_repository_TEST_phases_dir" / "repo1"));
- keys->insert("profiles", stringify(FSEntry::cwd() / "e_repository_TEST_phases_dir" / "repo1/profiles/profile"));
+ keys->insert("location", stringify(FSPath::cwd() / "e_repository_TEST_phases_dir" / "repo1"));
+ keys->insert("profiles", stringify(FSPath::cwd() / "e_repository_TEST_phases_dir" / "repo1/profiles/profile"));
keys->insert("layout", "exheres");
keys->insert("eapi_when_unknown", "exheres-0");
keys->insert("eapi_when_unspecified", "exheres-0");
keys->insert("profile_eapi", "exheres-0");
- keys->insert("distdir", stringify(FSEntry::cwd() / "e_repository_TEST_phases_dir" / "distdir"));
- keys->insert("builddir", stringify(FSEntry::cwd() / "e_repository_TEST_phases_dir" / "build"));
+ keys->insert("distdir", stringify(FSPath::cwd() / "e_repository_TEST_phases_dir" / "distdir"));
+ keys->insert("builddir", stringify(FSPath::cwd() / "e_repository_TEST_phases_dir" / "build"));
std::shared_ptr<Repository> repo(ERepository::repository_factory_create(&env,
std::bind(from_keys, keys, std::placeholders::_1)));
env.package_database()->add_repository(1, repo);
diff --git a/paludis/repositories/e/e_repository_TEST_replacing.cc b/paludis/repositories/e/e_repository_TEST_replacing.cc
index b68234a..e873be4 100644
--- a/paludis/repositories/e/e_repository_TEST_replacing.cc
+++ b/paludis/repositories/e/e_repository_TEST_replacing.cc
@@ -116,15 +116,15 @@ namespace
std::shared_ptr<Map<std::string, std::string> > keys(std::make_shared<Map<std::string, std::string>>());
keys->insert("format", "e");
keys->insert("names_cache", "/var/empty");
- keys->insert("location", stringify(FSEntry::cwd() / "e_repository_TEST_replacing_dir" / repo_path));
- keys->insert("profiles", stringify(FSEntry::cwd() / "e_repository_TEST_replacing_dir" / repo_path
+ keys->insert("location", stringify(FSPath::cwd() / "e_repository_TEST_replacing_dir" / repo_path));
+ keys->insert("profiles", stringify(FSPath::cwd() / "e_repository_TEST_replacing_dir" / repo_path
/ "profiles/profile"));
keys->insert("layout", "exheres");
keys->insert("eapi_when_unknown", eapi);
keys->insert("eapi_when_unspecified", eapi);
keys->insert("profile_eapi", eapi);
- keys->insert("distdir", stringify(FSEntry::cwd() / "e_repository_TEST_replacing_dir" / "distdir"));
- keys->insert("builddir", stringify(FSEntry::cwd() / "e_repository_TEST_replacing_dir" / "build"));
+ keys->insert("distdir", stringify(FSPath::cwd() / "e_repository_TEST_replacing_dir" / "distdir"));
+ keys->insert("builddir", stringify(FSPath::cwd() / "e_repository_TEST_replacing_dir" / "build"));
std::shared_ptr<Repository> repo(ERepository::repository_factory_create(&env,
std::bind(from_keys, keys, std::placeholders::_1)));
env.package_database()->add_repository(1, repo);
diff --git a/paludis/repositories/e/e_repository_TEST_symlink_rewriting.cc b/paludis/repositories/e/e_repository_TEST_symlink_rewriting.cc
index c8fcbb3..a69984c 100644
--- a/paludis/repositories/e/e_repository_TEST_symlink_rewriting.cc
+++ b/paludis/repositories/e/e_repository_TEST_symlink_rewriting.cc
@@ -108,15 +108,15 @@ namespace test_cases
std::shared_ptr<Map<std::string, std::string> > keys(std::make_shared<Map<std::string, std::string>>());
keys->insert("format", "e");
keys->insert("names_cache", "/var/empty");
- keys->insert("location", stringify(FSEntry::cwd() / "e_repository_TEST_symlink_rewriting_dir" / "repo"));
- keys->insert("profiles", stringify(FSEntry::cwd() / "e_repository_TEST_symlink_rewriting_dir" / "repo/profiles/profile"));
+ keys->insert("location", stringify(FSPath::cwd() / "e_repository_TEST_symlink_rewriting_dir" / "repo"));
+ keys->insert("profiles", stringify(FSPath::cwd() / "e_repository_TEST_symlink_rewriting_dir" / "repo/profiles/profile"));
keys->insert("layout", "traditional");
keys->insert("eapi_when_unknown", "0");
keys->insert("eapi_when_unspecified", "0");
keys->insert("profile_eapi", "0");
- keys->insert("distdir", stringify(FSEntry::cwd() / "e_repository_TEST_symlink_rewriting_dir" / "distdir"));
- keys->insert("builddir", stringify(FSEntry::cwd() / "e_repository_TEST_symlink_rewriting_dir" / "symlinked_build"));
- keys->insert("root", stringify(FSEntry(stringify(FSEntry::cwd() / "e_repository_TEST_symlink_rewriting_dir" / "root")).realpath()));
+ keys->insert("distdir", stringify(FSPath::cwd() / "e_repository_TEST_symlink_rewriting_dir" / "distdir"));
+ keys->insert("builddir", stringify(FSPath::cwd() / "e_repository_TEST_symlink_rewriting_dir" / "symlinked_build"));
+ keys->insert("root", stringify(FSPath(stringify(FSPath::cwd() / "e_repository_TEST_symlink_rewriting_dir" / "root")).realpath()));
std::shared_ptr<Repository> repo(ERepository::repository_factory_create(&env,
std::bind(from_keys, keys, std::placeholders::_1)));
env.package_database()->add_repository(1, repo);
@@ -125,9 +125,9 @@ namespace test_cases
keys->insert("format", "vdb");
keys->insert("names_cache", "/var/empty");
keys->insert("provides_cache", "/var/empty");
- keys->insert("location", stringify(FSEntry::cwd() / "e_repository_TEST_symlink_rewriting_dir" / "vdb"));
- keys->insert("builddir", stringify(FSEntry::cwd() / "e_repository_TEST_symlink_rewriting_dir" / "build"));
- keys->insert("root", stringify(FSEntry(stringify(FSEntry::cwd() / "e_repository_TEST_symlink_rewriting_dir" / "root")).realpath()));
+ keys->insert("location", stringify(FSPath::cwd() / "e_repository_TEST_symlink_rewriting_dir" / "vdb"));
+ keys->insert("builddir", stringify(FSPath::cwd() / "e_repository_TEST_symlink_rewriting_dir" / "build"));
+ keys->insert("root", stringify(FSPath(stringify(FSPath::cwd() / "e_repository_TEST_symlink_rewriting_dir" / "root")).realpath()));
std::shared_ptr<Repository> installed_repo(VDBRepository::repository_factory_create(&env,
std::bind(from_keys, keys, std::placeholders::_1)));
env.package_database()->add_repository(1, installed_repo);
@@ -146,7 +146,7 @@ namespace test_cases
TEST_CHECK(bool(id));
id->perform_action(action);
- TEST_CHECK_EQUAL(FSEntry(stringify(FSEntry::cwd() / "e_repository_TEST_symlink_rewriting_dir" / "root/bar")).readlink(), "/foo");
+ TEST_CHECK_EQUAL(FSPath(stringify(FSPath::cwd() / "e_repository_TEST_symlink_rewriting_dir" / "root/bar")).readlink(), "/foo");
}
} test_e_repository_symlink_rewriting;
}
diff --git a/paludis/repositories/e/e_repository_mask_file.cc b/paludis/repositories/e/e_repository_mask_file.cc
index c8201c3..fe286a6 100644
--- a/paludis/repositories/e/e_repository_mask_file.cc
+++ b/paludis/repositories/e/e_repository_mask_file.cc
@@ -51,7 +51,7 @@ namespace paludis
};
}
-MaskFile::MaskFile(const FSEntry & f, const LineConfigFileOptions & opts) :
+MaskFile::MaskFile(const FSPath & f, const LineConfigFileOptions & opts) :
Pimp<MaskFile>()
{
LineConfigFileOptions myopts(opts);
diff --git a/paludis/repositories/e/e_repository_mask_file.hh b/paludis/repositories/e/e_repository_mask_file.hh
index fdb7fd8..be1582f 100644
--- a/paludis/repositories/e/e_repository_mask_file.hh
+++ b/paludis/repositories/e/e_repository_mask_file.hh
@@ -22,7 +22,6 @@
#include <paludis/util/pimp.hh>
#include <paludis/util/attributes.hh>
-#include <paludis/util/fs_entry.hh>
#include <paludis/util/config_file.hh>
#include <paludis/util/wrapped_forward_iterator.hh>
#include <paludis/mask-fwd.hh>
@@ -45,7 +44,7 @@ namespace paludis
///\name Basic operations
///\{
- MaskFile(const FSEntry &, const LineConfigFileOptions &);
+ MaskFile(const FSPath &, const LineConfigFileOptions &);
~MaskFile();
///\}
diff --git a/paludis/repositories/e/e_repository_news.cc b/paludis/repositories/e/e_repository_news.cc
index e098825..c8b8476 100644
--- a/paludis/repositories/e/e_repository_news.cc
+++ b/paludis/repositories/e/e_repository_news.cc
@@ -23,9 +23,6 @@
#include <paludis/repositories/e/extra_distribution_data.hh>
#include <paludis/util/config_file.hh>
-#include <paludis/environment.hh>
-#include <paludis/util/dir_iterator.hh>
-#include <paludis/util/fs_entry.hh>
#include <paludis/util/log.hh>
#include <paludis/util/strip.hh>
#include <paludis/util/pimp-impl.hh>
@@ -33,6 +30,11 @@
#include <paludis/util/options.hh>
#include <paludis/util/wrapped_forward_iterator-impl.hh>
#include <paludis/util/safe_ofstream.hh>
+#include <paludis/util/fs_path.hh>
+#include <paludis/util/fs_stat.hh>
+#include <paludis/util/fs_iterator.hh>
+
+#include <paludis/environment.hh>
#include <paludis/distribution.hh>
#include <paludis/elike_package_dep_spec.hh>
#include <paludis/selection.hh>
@@ -67,9 +69,9 @@ namespace paludis
const ERepository * const e_repository;
const erepository::ERepositoryParams params;
- const FSEntry news_directory;
- const FSEntry skip_file;
- const FSEntry unread_file;
+ const FSPath news_directory;
+ const FSPath skip_file;
+ const FSPath unread_file;
Imp(const Environment * const e, const ERepository * const p,
const erepository::ERepositoryParams & k) :
@@ -123,12 +125,12 @@ ERepositoryNews::update_news() const
stringify(_imp->params.newsdir()) + "' for repository '" +
stringify(_imp->e_repository->name()) + "':");
- if (! _imp->params.newsdir().is_directory_or_symlink_to_directory())
+ if (! _imp->params.newsdir().stat().is_directory_or_symlink_to_directory())
return;
std::set<std::string> skip;
- if (_imp->skip_file.is_regular_file_or_symlink_to_regular_file())
+ if (_imp->skip_file.stat().is_regular_file_or_symlink_to_regular_file())
{
Context local_context("When handling news skip file '" + stringify(
_imp->skip_file) + "':");
@@ -136,7 +138,7 @@ ERepositoryNews::update_news() const
std::copy(s.begin(), s.end(), std::inserter(skip, skip.end()));
}
- for (DirIterator d(_imp->params.newsdir()), d_end ; d != d_end ; ++d)
+ for (FSIterator d(_imp->params.newsdir(), { }), d_end ; d != d_end ; ++d)
{
Context local_context("When handling news entry '" + stringify(*d) + "':");
@@ -148,9 +150,9 @@ ERepositoryNews::update_news() const
return;
}
- if (! d->is_directory_or_symlink_to_directory())
+ if (! d->stat().is_directory_or_symlink_to_directory())
continue;
- if (! (*d / (d->basename() + ".en.txt")).is_regular_file_or_symlink_to_regular_file())
+ if (! (*d / (d->basename() + ".en.txt")).stat().is_regular_file_or_symlink_to_regular_file())
continue;
if (skip.end() != skip.find(d->basename()))
@@ -198,8 +200,8 @@ ERepositoryNews::update_news() const
Context header_context("When checking Display-If-Profile headers:");
bool local_show(false);
- std::shared_ptr<const FSEntrySequence> c(_imp->params.profiles());
- for (FSEntrySequence::ConstIterator p(c->begin()), p_end(c->end()) ; p != p_end ; ++p)
+ std::shared_ptr<const FSPathSequence> c(_imp->params.profiles());
+ for (FSPathSequence::ConstIterator p(c->begin()), p_end(c->end()) ; p != p_end ; ++p)
{
std::string profile(strip_leading_string(strip_trailing_string(
strip_leading_string(stringify(p->realpath()),
@@ -267,7 +269,7 @@ namespace paludis
};
}
-NewsFile::NewsFile(const FSEntry & our_filename) :
+NewsFile::NewsFile(const FSPath & our_filename) :
Pimp<NewsFile>()
{
Context context("When parsing GLEP 42 news file '" + stringify(our_filename) + "':");
@@ -389,7 +391,7 @@ NewsFile::end_display_if_profile() const
return DisplayIfProfileConstIterator(_imp->display_if_profile.end());
}
-NewsError::NewsError(const FSEntry & f, const std::string & m) throw () :
+NewsError::NewsError(const FSPath & f, const std::string & m) throw () :
Exception("Error in news file '" + stringify(f) + "': " + m)
{
}
diff --git a/paludis/repositories/e/e_repository_news.hh b/paludis/repositories/e/e_repository_news.hh
index cb15a45..cb3c274 100644
--- a/paludis/repositories/e/e_repository_news.hh
+++ b/paludis/repositories/e/e_repository_news.hh
@@ -33,7 +33,6 @@
namespace paludis
{
class Environment;
- class FSEntry;
class ERepository;
/**
@@ -65,7 +64,7 @@ namespace paludis
public Exception
{
public:
- NewsError(const FSEntry &, const std::string &) throw ();
+ NewsError(const FSPath &, const std::string &) throw ();
};
/**
@@ -84,7 +83,7 @@ namespace paludis
/**
* Constructor, from a filename.
*/
- NewsFile(const FSEntry & filename);
+ NewsFile(const FSPath & filename);
~NewsFile();
diff --git a/paludis/repositories/e/e_repository_params.hh b/paludis/repositories/e/e_repository_params.hh
index c83b89e..30112a3 100644
--- a/paludis/repositories/e/e_repository_params.hh
+++ b/paludis/repositories/e/e_repository_params.hh
@@ -20,8 +20,9 @@
#ifndef PALUDIS_GUARD_PALUDIS_REPOSITORIES_E_E_REPOSITORY_PARAMS_HH
#define PALUDIS_GUARD_PALUDIS_REPOSITORIES_E_E_REPOSITORY_PARAMS_HH 1
-#include <paludis/util/fs_entry.hh>
+#include <paludis/util/fs_path.hh>
#include <paludis/util/named_value.hh>
+#include <memory>
/** \file
* Declaration for the ERepositoryParams class.
@@ -81,34 +82,34 @@ namespace paludis
NamedValue<n::append_repository_name_to_write_cache, bool> append_repository_name_to_write_cache;
NamedValue<n::auto_profiles, bool> auto_profiles;
NamedValue<n::binary_destination, bool> binary_destination;
- NamedValue<n::binary_distdir, FSEntry> binary_distdir;
+ NamedValue<n::binary_distdir, FSPath> binary_distdir;
NamedValue<n::binary_keywords_filter, std::string> binary_keywords_filter;
NamedValue<n::binary_uri_prefix, std::string> binary_uri_prefix;
- NamedValue<n::builddir, FSEntry> builddir;
- NamedValue<n::cache, FSEntry> cache;
- NamedValue<n::distdir, FSEntry> distdir;
+ NamedValue<n::builddir, FSPath> builddir;
+ NamedValue<n::cache, FSPath> cache;
+ NamedValue<n::distdir, FSPath> distdir;
NamedValue<n::eapi_when_unknown, std::string> eapi_when_unknown;
NamedValue<n::eapi_when_unspecified, std::string> eapi_when_unspecified;
- NamedValue<n::eclassdirs, std::shared_ptr<const FSEntrySequence> > eclassdirs;
+ NamedValue<n::eclassdirs, std::shared_ptr<const FSPathSequence> > eclassdirs;
NamedValue<n::entry_format, std::string> entry_format;
NamedValue<n::environment, Environment *> environment;
NamedValue<n::ignore_deprecated_profiles, bool> ignore_deprecated_profiles;
NamedValue<n::layout, std::string> layout;
- NamedValue<n::location, FSEntry> location;
+ NamedValue<n::location, FSPath> location;
NamedValue<n::master_repositories, std::shared_ptr<const ERepositorySequence> > master_repositories;
- NamedValue<n::names_cache, FSEntry> names_cache;
- NamedValue<n::newsdir, FSEntry> newsdir;
+ NamedValue<n::names_cache, FSPath> names_cache;
+ NamedValue<n::newsdir, FSPath> newsdir;
NamedValue<n::profile_eapi_when_unspecified, std::string> profile_eapi_when_unspecified;
NamedValue<n::profile_layout, std::string> profile_layout;
- NamedValue<n::profiles, std::shared_ptr<const FSEntrySequence> > profiles;
+ NamedValue<n::profiles, std::shared_ptr<const FSPathSequence> > profiles;
NamedValue<n::profiles_explicitly_set, bool> profiles_explicitly_set;
- NamedValue<n::securitydir, FSEntry> securitydir;
- NamedValue<n::setsdir, FSEntry> setsdir;
+ NamedValue<n::securitydir, FSPath> securitydir;
+ NamedValue<n::setsdir, FSPath> setsdir;
NamedValue<n::sync, std::string> sync;
NamedValue<n::sync_options, std::string> sync_options;
NamedValue<n::use_manifest, erepository::UseManifest> use_manifest;
NamedValue<n::write_bin_uri_prefix, std::string> write_bin_uri_prefix;
- NamedValue<n::write_cache, FSEntry> write_cache;
+ NamedValue<n::write_cache, FSPath> write_cache;
};
}
diff --git a/paludis/repositories/e/e_repository_sets.cc b/paludis/repositories/e/e_repository_sets.cc
index c380d68..1f8771c 100644
--- a/paludis/repositories/e/e_repository_sets.cc
+++ b/paludis/repositories/e/e_repository_sets.cc
@@ -42,8 +42,6 @@
#include <paludis/version_requirements.hh>
#include <paludis/util/config_file.hh>
-#include <paludis/util/dir_iterator.hh>
-#include <paludis/util/fs_entry.hh>
#include <paludis/util/is_file_with_extension.hh>
#include <paludis/util/log.hh>
#include <paludis/util/make_named_values.hh>
@@ -54,6 +52,8 @@
#include <paludis/util/strip.hh>
#include <paludis/util/tokeniser.hh>
#include <paludis/util/wrapped_forward_iterator.hh>
+#include <paludis/util/fs_stat.hh>
+#include <paludis/util/fs_iterator.hh>
#include <functional>
#include <algorithm>
@@ -114,11 +114,11 @@ ERepositorySets::package_set(const SetName & ss) const
std::pair<SetName, SetFileSetOperatorMode> s(find_base_set_name_and_suffix_mode(ss));
- if ((_imp->params.setsdir() / (stringify(s.first) + ".conf")).exists())
+ if ((_imp->params.setsdir() / (stringify(s.first) + ".conf")).stat().exists())
{
std::shared_ptr<GeneralSetDepTag> tag(std::make_shared<GeneralSetDepTag>(ss, stringify(_imp->e_repository->name())));
- FSEntry ff(_imp->params.setsdir() / (stringify(s.first) + ".conf"));
+ FSPath ff(_imp->params.setsdir() / (stringify(s.first) + ".conf"));
Context context("When loading package set '" + stringify(s.first) + "' from '" + stringify(ff) + "':");
SetFile f(make_named_values<SetFileParams>(
@@ -146,21 +146,15 @@ ERepositorySets::sets_list() const
result->insert(SetName("security"));
result->insert(SetName("system"));
- if (_imp->params.setsdir().exists())
+ if (_imp->params.setsdir().stat().exists())
{
using namespace std::placeholders;
- std::list<FSEntry> repo_sets;
- std::remove_copy_if(
- DirIterator(_imp->params.setsdir()),
- DirIterator(),
- std::back_inserter(repo_sets),
- std::bind(std::logical_not<bool>(), std::bind(is_file_with_extension, _1, ".conf", IsFileWithOptions())));
-
- std::list<FSEntry>::const_iterator f(repo_sets.begin()),
- f_end(repo_sets.end());
+ for (FSIterator f(_imp->params.setsdir(), { }), f_end ; f != f_end ; ++f)
+ {
+ if (! is_file_with_extension(*f, ".conf", { }))
+ continue;
- for ( ; f != f_end ; ++f)
try
{
result->insert(SetName(strip_trailing_string(f->basename(), ".conf")));
@@ -170,6 +164,7 @@ ERepositorySets::sets_list() const
Log::get_instance()->message("e.sets.failure", ll_warning, lc_context) << "Skipping set '"
<< *f << "' due to exception '" << e.message() << "' (" << e.what() << ")";
}
+ }
}
return result;
@@ -260,20 +255,19 @@ ERepositorySets::security_set(bool insecurity) const
std::shared_ptr<SetSpecTree> security_packages(std::make_shared<SetSpecTree>(std::make_shared<AllDepSpec>()));
- if (!_imp->params.securitydir().is_directory_or_symlink_to_directory())
+ if (!_imp->params.securitydir().stat().is_directory_or_symlink_to_directory())
return security_packages;
std::map<std::string, std::shared_ptr<GLSADepTag> > glsa_tags;
- for (DirIterator f(_imp->params.securitydir()), f_end ; f != f_end; ++f)
+ for (FSIterator f(_imp->params.securitydir(), { }), f_end ; f != f_end; ++f)
{
if (! is_file_with_prefix_extension(*f, "glsa-", ".xml", { }))
continue;
Context local_context("When parsing security advisory '" + stringify(*f) + "':");
- const std::shared_ptr<const EAPI> eapi(EAPIData::get_instance()->eapi_from_string(
- _imp->e_repository->eapi_for_file(*f)));
+ const std::shared_ptr<const EAPI> eapi(EAPIData::get_instance()->eapi_from_string(_imp->e_repository->eapi_for_file(*f)));
if (! eapi->supported())
throw GLSAError("Can't use advisory '" + stringify(*f) +
"' because it uses an unsupported EAPI");
diff --git a/paludis/repositories/e/e_repository_sets_TEST.cc b/paludis/repositories/e/e_repository_sets_TEST.cc
index a4a3619..31f3e66 100644
--- a/paludis/repositories/e/e_repository_sets_TEST.cc
+++ b/paludis/repositories/e/e_repository_sets_TEST.cc
@@ -59,7 +59,7 @@ namespace test_cases
std::shared_ptr<Map<std::string, std::string> > keys(std::make_shared<Map<std::string, std::string>>());
keys->insert("format", "e");
keys->insert("names_cache", "/var/empty");
- keys->insert("location", stringify(FSEntry::cwd() / "e_repository_sets_TEST_dir/repo1"));
+ keys->insert("location", stringify(FSPath::cwd() / "e_repository_sets_TEST_dir/repo1"));
keys->insert("profiles", "e_repository_sets_TEST_dir/repo1/profiles/profile");
std::shared_ptr<Repository> repo(ERepository::repository_factory_create(&env,
std::bind(from_keys, keys, std::placeholders::_1)));
@@ -86,7 +86,7 @@ namespace test_cases
std::shared_ptr<Map<std::string, std::string> > keys(std::make_shared<Map<std::string, std::string>>());
keys->insert("format", "e");
keys->insert("names_cache", "/var/empty");
- keys->insert("location", stringify(FSEntry::cwd() / "e_repository_sets_TEST_dir/repo1"));
+ keys->insert("location", stringify(FSPath::cwd() / "e_repository_sets_TEST_dir/repo1"));
keys->insert("profiles", "e_repository_sets_TEST_dir/repo1/profiles/profile");
std::shared_ptr<Repository> repo(ERepository::repository_factory_create(&env,
std::bind(from_keys, keys, std::placeholders::_1)));
@@ -126,7 +126,7 @@ namespace test_cases
std::shared_ptr<Map<std::string, std::string> > keys(std::make_shared<Map<std::string, std::string>>());
keys->insert("format", "e");
keys->insert("names_cache", "/var/empty");
- keys->insert("location", stringify(FSEntry::cwd() / "e_repository_sets_TEST_dir/repo1"));
+ keys->insert("location", stringify(FSPath::cwd() / "e_repository_sets_TEST_dir/repo1"));
keys->insert("profiles", "e_repository_sets_TEST_dir/repo1/profiles/profile");
std::shared_ptr<Repository> repo(ERepository::repository_factory_create(&env,
std::bind(from_keys, keys, std::placeholders::_1)));
@@ -157,7 +157,7 @@ namespace test_cases
std::shared_ptr<Map<std::string, std::string> > keys(std::make_shared<Map<std::string, std::string> >());
keys->insert("format", "e");
keys->insert("names_cache", "/var/empty");
- keys->insert("location", stringify(FSEntry::cwd() / "e_repository_sets_TEST_dir/repo1"));
+ keys->insert("location", stringify(FSPath::cwd() / "e_repository_sets_TEST_dir/repo1"));
keys->insert("profiles", "e_repository_sets_TEST_dir/repo1/profiles/profile");
std::shared_ptr<Repository> repo(ERepository::repository_factory_create(&env,
std::bind(from_keys, keys, std::placeholders::_1)));
diff --git a/paludis/repositories/e/e_stripper.cc b/paludis/repositories/e/e_stripper.cc
index 922b78c..ec0fcd6 100644
--- a/paludis/repositories/e/e_stripper.cc
+++ b/paludis/repositories/e/e_stripper.cc
@@ -18,7 +18,6 @@
*/
#include <paludis/repositories/e/e_stripper.hh>
-#include <paludis/util/fs_entry.hh>
#include <paludis/util/pimp-impl.hh>
#include <paludis/util/make_named_values.hh>
#include <paludis/output_manager.hh>
@@ -58,31 +57,31 @@ EStripper::~EStripper()
}
void
-EStripper::on_strip(const FSEntry & f)
+EStripper::on_strip(const FSPath & f)
{
_imp->options.output_manager()->stdout_stream() << "str " << f.strip_leading(_imp->options.image_dir()) << std::endl;
}
void
-EStripper::on_split(const FSEntry & f, const FSEntry & g)
+EStripper::on_split(const FSPath & f, const FSPath & g)
{
_imp->options.output_manager()->stdout_stream() << "spl " << f.strip_leading(_imp->options.image_dir()) <<
" -> " << g.strip_leading(_imp->options.image_dir()) << std::endl;
}
void
-EStripper::on_unknown(const FSEntry & f)
+EStripper::on_unknown(const FSPath & f)
{
_imp->options.output_manager()->stdout_stream() << "--- " << f.strip_leading(_imp->options.image_dir()) << std::endl;
}
void
-EStripper::on_enter_dir(const FSEntry &)
+EStripper::on_enter_dir(const FSPath &)
{
}
void
-EStripper::on_leave_dir(const FSEntry &)
+EStripper::on_leave_dir(const FSPath &)
{
}
diff --git a/paludis/repositories/e/e_stripper.hh b/paludis/repositories/e/e_stripper.hh
index 1d7c012..36937ad 100644
--- a/paludis/repositories/e/e_stripper.hh
+++ b/paludis/repositories/e/e_stripper.hh
@@ -22,7 +22,6 @@
#include <paludis/stripper.hh>
#include <paludis/package_id-fwd.hh>
-#include <paludis/util/fs_entry-fwd.hh>
#include <paludis/output_manager-fwd.hh>
#include <memory>
@@ -42,8 +41,8 @@ namespace paludis
{
struct EStripperOptions
{
- NamedValue<n::debug_dir, FSEntry> debug_dir;
- NamedValue<n::image_dir, FSEntry> image_dir;
+ NamedValue<n::debug_dir, FSPath> debug_dir;
+ NamedValue<n::image_dir, FSPath> image_dir;
NamedValue<n::output_manager, std::shared_ptr<OutputManager> > output_manager;
NamedValue<n::package_id, std::shared_ptr<const PackageID> > package_id;
NamedValue<n::split, bool> split;
@@ -58,11 +57,11 @@ namespace paludis
Pimp<EStripper>::ImpPtr & _imp;
protected:
- virtual void on_strip(const FSEntry &);
- virtual void on_split(const FSEntry &, const FSEntry &);
- virtual void on_enter_dir(const FSEntry &);
- virtual void on_leave_dir(const FSEntry &);
- virtual void on_unknown(const FSEntry &);
+ virtual void on_strip(const FSPath &);
+ virtual void on_split(const FSPath &, const FSPath &);
+ virtual void on_enter_dir(const FSPath &);
+ virtual void on_leave_dir(const FSPath &);
+ virtual void on_unknown(const FSPath &);
public:
EStripper(const EStripperOptions &);
diff --git a/paludis/repositories/e/eapi.cc b/paludis/repositories/e/eapi.cc
index 31754b7..d739416 100644
--- a/paludis/repositories/e/eapi.cc
+++ b/paludis/repositories/e/eapi.cc
@@ -20,7 +20,6 @@
#include <paludis/repositories/e/eapi.hh>
#include <paludis/name.hh>
#include <paludis/dep_spec.hh>
-#include <paludis/util/dir_iterator.hh>
#include <paludis/util/is_file_with_extension.hh>
#include <paludis/util/system.hh>
#include <paludis/util/strip.hh>
@@ -35,6 +34,7 @@
#include <paludis/util/wrapped_output_iterator.hh>
#include <paludis/util/hashes.hh>
#include <paludis/util/make_named_values.hh>
+#include <paludis/util/fs_iterator.hh>
#include <unordered_map>
#include <map>
#include <vector>
@@ -351,7 +351,7 @@ namespace paludis
{
Context c("When loading EAPI data:");
- for (DirIterator d(getenv_with_default("PALUDIS_EAPIS_DIR", DATADIR "/paludis/eapis")), d_end ;
+ for (FSIterator d(FSPath(getenv_with_default("PALUDIS_EAPIS_DIR", DATADIR "/paludis/eapis")), { fsio_inode_sort }), d_end ;
d != d_end ; ++d)
{
if (! is_file_with_extension(*d, ".conf", { }))
diff --git a/paludis/repositories/e/ebuild.cc b/paludis/repositories/e/ebuild.cc
index 5b4b832..9f4f178 100644
--- a/paludis/repositories/e/ebuild.cc
+++ b/paludis/repositories/e/ebuild.cc
@@ -149,10 +149,10 @@ EbuildCommand::operator() ()
process.pipe_command_handler("PALUDIS_PIPE_COMMAND", std::bind(&pipe_command_handler, params.environment(),
params.package_id(), _1, params.maybe_output_manager()));
- std::shared_ptr<const FSEntrySequence> syncers_dirs(params.environment()->syncers_dirs());
- std::shared_ptr<const FSEntrySequence> bashrc_files(params.environment()->bashrc_files());
- std::shared_ptr<const FSEntrySequence> fetchers_dirs(params.environment()->fetchers_dirs());
- std::shared_ptr<const FSEntrySequence> hook_dirs(params.environment()->hook_dirs());
+ std::shared_ptr<const FSPathSequence> syncers_dirs(params.environment()->syncers_dirs());
+ std::shared_ptr<const FSPathSequence> bashrc_files(params.environment()->bashrc_files());
+ std::shared_ptr<const FSPathSequence> fetchers_dirs(params.environment()->fetchers_dirs());
+ std::shared_ptr<const FSPathSequence> hook_dirs(params.environment()->hook_dirs());
process
.setenv("PV", stringify(params.package_id()->version().remove_revision()))
@@ -974,10 +974,10 @@ WriteVDBEntryCommand::operator() ()
stringify(params.output_directory()) + "' '" +
stringify(params.environment_file()) + "'");
- std::shared_ptr<const FSEntrySequence> syncers_dirs(params.environment()->syncers_dirs());
- std::shared_ptr<const FSEntrySequence> bashrc_files(params.environment()->bashrc_files());
- std::shared_ptr<const FSEntrySequence> fetchers_dirs(params.environment()->fetchers_dirs());
- std::shared_ptr<const FSEntrySequence> hook_dirs(params.environment()->hook_dirs());
+ std::shared_ptr<const FSPathSequence> syncers_dirs(params.environment()->syncers_dirs());
+ std::shared_ptr<const FSPathSequence> bashrc_files(params.environment()->bashrc_files());
+ std::shared_ptr<const FSPathSequence> fetchers_dirs(params.environment()->fetchers_dirs());
+ std::shared_ptr<const FSPathSequence> hook_dirs(params.environment()->hook_dirs());
Process process((ProcessCommand(ebuild_cmd)));
@@ -1192,10 +1192,10 @@ WriteBinaryEbuildCommand::operator() ()
stringify(params.environment_file()) + "' '" +
stringify(params.image()) + "'");
- std::shared_ptr<const FSEntrySequence> syncers_dirs(params.environment()->syncers_dirs());
- std::shared_ptr<const FSEntrySequence> bashrc_files(params.environment()->bashrc_files());
- std::shared_ptr<const FSEntrySequence> fetchers_dirs(params.environment()->fetchers_dirs());
- std::shared_ptr<const FSEntrySequence> hook_dirs(params.environment()->hook_dirs());
+ std::shared_ptr<const FSPathSequence> syncers_dirs(params.environment()->syncers_dirs());
+ std::shared_ptr<const FSPathSequence> bashrc_files(params.environment()->bashrc_files());
+ std::shared_ptr<const FSPathSequence> fetchers_dirs(params.environment()->fetchers_dirs());
+ std::shared_ptr<const FSPathSequence> hook_dirs(params.environment()->hook_dirs());
Process process((ProcessCommand(ebuild_cmd)));
diff --git a/paludis/repositories/e/ebuild.hh b/paludis/repositories/e/ebuild.hh
index 9f9a1df..c3f7137 100644
--- a/paludis/repositories/e/ebuild.hh
+++ b/paludis/repositories/e/ebuild.hh
@@ -20,7 +20,6 @@
#ifndef PALUDIS_GUARD_PALUDIS_EBUILD_HH
#define PALUDIS_GUARD_PALUDIS_EBUILD_HH 1
-#include <paludis/util/fs_entry-fwd.hh>
#include <paludis/util/attributes.hh>
#include <paludis/util/map-fwd.hh>
#include <paludis/util/process-fwd.hh>
@@ -105,20 +104,20 @@ namespace paludis
*/
struct EbuildCommandParams
{
- NamedValue<n::builddir, FSEntry> builddir;
+ NamedValue<n::builddir, FSPath> builddir;
NamedValue<n::clearenv, bool> clearenv;
NamedValue<n::commands, std::string> commands;
- NamedValue<n::distdir, FSEntry> distdir;
- NamedValue<n::ebuild_dir, FSEntry> ebuild_dir;
- NamedValue<n::ebuild_file, FSEntry> ebuild_file;
- NamedValue<n::eclassdirs, std::shared_ptr<const FSEntrySequence> > eclassdirs;
+ NamedValue<n::distdir, FSPath> distdir;
+ NamedValue<n::ebuild_dir, FSPath> ebuild_dir;
+ NamedValue<n::ebuild_file, FSPath> ebuild_file;
+ NamedValue<n::eclassdirs, std::shared_ptr<const FSPathSequence> > eclassdirs;
NamedValue<n::environment, const Environment *> environment;
- NamedValue<n::exlibsdirs, std::shared_ptr<const FSEntrySequence> > exlibsdirs;
- NamedValue<n::files_dir, FSEntry> files_dir;
+ NamedValue<n::exlibsdirs, std::shared_ptr<const FSPathSequence> > exlibsdirs;
+ NamedValue<n::files_dir, FSPath> files_dir;
NamedValue<n::maybe_output_manager, std::shared_ptr<OutputManager> > maybe_output_manager;
- NamedValue<n::package_builddir, FSEntry> package_builddir;
+ NamedValue<n::package_builddir, FSPath> package_builddir;
NamedValue<n::package_id, std::shared_ptr<const erepository::ERepositoryID> > package_id;
- NamedValue<n::portdir, FSEntry> portdir;
+ NamedValue<n::portdir, FSPath> portdir;
NamedValue<n::root, std::string> root;
NamedValue<n::sandbox, bool> sandbox;
NamedValue<n::sydbox, bool> sydbox;
@@ -137,8 +136,8 @@ namespace paludis
NamedValue<n::a, std::string> a;
NamedValue<n::aa, std::string> aa;
NamedValue<n::expand_vars, std::shared_ptr<const Map<std::string, std::string> > > expand_vars;
- NamedValue<n::profiles, std::shared_ptr<const FSEntrySequence> > profiles;
- NamedValue<n::profiles_with_parents, std::shared_ptr<const FSEntrySequence> > profiles_with_parents;
+ NamedValue<n::profiles, std::shared_ptr<const FSPathSequence> > profiles;
+ NamedValue<n::profiles_with_parents, std::shared_ptr<const FSPathSequence> > profiles_with_parents;
NamedValue<n::use, std::string> use;
NamedValue<n::use_expand, std::string> use_expand;
NamedValue<n::use_expand_hidden, std::string> use_expand_hidden;
@@ -156,9 +155,9 @@ namespace paludis
NamedValue<n::a, std::string> a;
NamedValue<n::aa, std::string> aa;
NamedValue<n::expand_vars, std::shared_ptr<const Map<std::string, std::string> > > expand_vars;
- NamedValue<n::loadsaveenv_dir, FSEntry> loadsaveenv_dir;
- NamedValue<n::profiles, std::shared_ptr<const FSEntrySequence> > profiles;
- NamedValue<n::profiles_with_parents, std::shared_ptr<const FSEntrySequence> > profiles_with_parents;
+ NamedValue<n::loadsaveenv_dir, FSPath> loadsaveenv_dir;
+ NamedValue<n::profiles, std::shared_ptr<const FSPathSequence> > profiles;
+ NamedValue<n::profiles_with_parents, std::shared_ptr<const FSPathSequence> > profiles_with_parents;
NamedValue<n::slot, std::string> slot;
NamedValue<n::use, std::string> use;
NamedValue<n::use_expand, std::string> use_expand;
@@ -180,9 +179,9 @@ namespace paludis
NamedValue<n::config_protect, std::string> config_protect;
NamedValue<n::config_protect_mask, std::string> config_protect_mask;
NamedValue<n::expand_vars, std::shared_ptr<const Map<std::string, std::string> > > expand_vars;
- NamedValue<n::loadsaveenv_dir, FSEntry> loadsaveenv_dir;
- NamedValue<n::profiles, std::shared_ptr<const FSEntrySequence> > profiles;
- NamedValue<n::profiles_with_parents, std::shared_ptr<const FSEntrySequence> > profiles_with_parents;
+ NamedValue<n::loadsaveenv_dir, FSPath> loadsaveenv_dir;
+ NamedValue<n::profiles, std::shared_ptr<const FSPathSequence> > profiles;
+ NamedValue<n::profiles_with_parents, std::shared_ptr<const FSPathSequence> > profiles_with_parents;
NamedValue<n::replacing_ids, std::shared_ptr<const PackageIDSequence> > replacing_ids;
NamedValue<n::slot, std::string> slot;
NamedValue<n::use, std::string> use;
@@ -200,8 +199,8 @@ namespace paludis
struct EbuildPretendCommandParams
{
NamedValue<n::expand_vars, std::shared_ptr<const Map<std::string, std::string> > > expand_vars;
- NamedValue<n::profiles, std::shared_ptr<const FSEntrySequence> > profiles;
- NamedValue<n::profiles_with_parents, std::shared_ptr<const FSEntrySequence> > profiles_with_parents;
+ NamedValue<n::profiles, std::shared_ptr<const FSPathSequence> > profiles;
+ NamedValue<n::profiles_with_parents, std::shared_ptr<const FSPathSequence> > profiles_with_parents;
NamedValue<n::use, std::string> use;
NamedValue<n::use_expand, std::string> use_expand;
NamedValue<n::use_expand_hidden, std::string> use_expand_hidden;
@@ -217,8 +216,8 @@ namespace paludis
struct EbuildBadOptionsCommandParams
{
NamedValue<n::expand_vars, std::shared_ptr<const Map<std::string, std::string> > > expand_vars;
- NamedValue<n::profiles, std::shared_ptr<const FSEntrySequence> > profiles;
- NamedValue<n::profiles_with_parents, std::shared_ptr<const FSEntrySequence> > profiles_with_parents;
+ NamedValue<n::profiles, std::shared_ptr<const FSPathSequence> > profiles;
+ NamedValue<n::profiles_with_parents, std::shared_ptr<const FSPathSequence> > profiles_with_parents;
NamedValue<n::unmet_requirements, std::shared_ptr<const Sequence<std::string> > > unmet_requirements;
NamedValue<n::use, std::string> use;
NamedValue<n::use_expand, std::string> use_expand;
@@ -234,8 +233,8 @@ namespace paludis
*/
struct EbuildUninstallCommandParams
{
- NamedValue<n::load_environment, const FSEntry *> load_environment;
- NamedValue<n::loadsaveenv_dir, FSEntry> loadsaveenv_dir;
+ NamedValue<n::load_environment, const FSPath *> load_environment;
+ NamedValue<n::loadsaveenv_dir, FSPath> loadsaveenv_dir;
NamedValue<n::replaced_by, std::shared_ptr<const PackageID> > replaced_by;
NamedValue<n::unmerge_only, bool> unmerge_only;
};
@@ -249,7 +248,7 @@ namespace paludis
*/
struct EbuildConfigCommandParams
{
- NamedValue<n::load_environment, const FSEntry *> load_environment;
+ NamedValue<n::load_environment, const FSPath *> load_environment;
};
/**
@@ -263,9 +262,9 @@ namespace paludis
{
NamedValue<n::expand_vars, std::shared_ptr<const Map<std::string, std::string> > > expand_vars;
NamedValue<n::info_vars, std::shared_ptr<const Set<std::string> > > info_vars;
- NamedValue<n::load_environment, const FSEntry *> load_environment;
- NamedValue<n::profiles, std::shared_ptr<const FSEntrySequence> > profiles;
- NamedValue<n::profiles_with_parents, std::shared_ptr<const FSEntrySequence> > profiles_with_parents;
+ NamedValue<n::load_environment, const FSPath *> load_environment;
+ NamedValue<n::profiles, std::shared_ptr<const FSPathSequence> > profiles;
+ NamedValue<n::profiles_with_parents, std::shared_ptr<const FSPathSequence> > profiles_with_parents;
NamedValue<n::use, std::string> use;
NamedValue<n::use_ebuild_file, bool> use_ebuild_file;
NamedValue<n::use_expand, std::string> use_expand;
@@ -282,9 +281,9 @@ namespace paludis
struct WriteVDBEntryParams
{
NamedValue<n::environment, const Environment *> environment;
- NamedValue<n::environment_file, FSEntry> environment_file;
+ NamedValue<n::environment_file, FSPath> environment_file;
NamedValue<n::maybe_output_manager, std::shared_ptr<OutputManager> > maybe_output_manager;
- NamedValue<n::output_directory, FSEntry> output_directory;
+ NamedValue<n::output_directory, FSPath> output_directory;
NamedValue<n::package_id, std::shared_ptr<const erepository::ERepositoryID> > package_id;
};
@@ -298,14 +297,14 @@ namespace paludis
struct WriteBinaryEbuildCommandParams
{
NamedValue<n::binary_dist_base, std::string> binary_dist_base;
- NamedValue<n::binary_distdir, FSEntry> binary_distdir;
- NamedValue<n::binary_ebuild_location, FSEntry> binary_ebuild_location;
+ NamedValue<n::binary_distdir, FSPath> binary_distdir;
+ NamedValue<n::binary_ebuild_location, FSPath> binary_ebuild_location;
NamedValue<n::binary_keywords, std::string> binary_keywords;
- NamedValue<n::builddir, FSEntry> builddir;
+ NamedValue<n::builddir, FSPath> builddir;
NamedValue<n::destination_repository, const ERepository *> destination_repository;
NamedValue<n::environment, const Environment *> environment;
- NamedValue<n::environment_file, FSEntry> environment_file;
- NamedValue<n::image, FSEntry> image;
+ NamedValue<n::environment_file, FSPath> environment_file;
+ NamedValue<n::image, FSPath> image;
NamedValue<n::maybe_output_manager, std::shared_ptr<OutputManager> > maybe_output_manager;
NamedValue<n::merger_options, MergerOptions> merger_options;
NamedValue<n::package_id, std::shared_ptr<const erepository::ERepositoryID> > package_id;
@@ -320,7 +319,7 @@ namespace paludis
*/
struct VDBPostMergeUnmergeCommandParams
{
- NamedValue<n::root, FSEntry> root;
+ NamedValue<n::root, FSPath> root;
};
/**
diff --git a/paludis/repositories/e/ebuild_flat_metadata_cache.cc b/paludis/repositories/e/ebuild_flat_metadata_cache.cc
index eab91c3..a57d806 100644
--- a/paludis/repositories/e/ebuild_flat_metadata_cache.cc
+++ b/paludis/repositories/e/ebuild_flat_metadata_cache.cc
@@ -28,6 +28,8 @@
#include <paludis/util/safe_ofstream.hh>
#include <paludis/util/safe_ifstream.hh>
#include <paludis/util/timestamp.hh>
+#include <paludis/util/fs_stat.hh>
+#include <paludis/util/fs_error.hh>
#include <paludis/repositories/e/dep_spec_pretty_printer.hh>
#include <paludis/repositories/e/dep_parser.hh>
#include <paludis/repositories/e/dependencies_rewriter.hh>
@@ -54,17 +56,21 @@ namespace paludis
struct Imp<EbuildFlatMetadataCache>
{
const Environment * const env;
- FSEntry & filename;
- const FSEntry & ebuild;
+ const FSPath filename;
+ const FSStat filename_stat;
+ const FSPath ebuild;
+ const FSStat ebuild_stat;
std::time_t master_mtime;
std::shared_ptr<const EclassMtimes> eclass_mtimes;
bool silent;
- Imp(const Environment * const e, FSEntry & f, const FSEntry & eb,
+ Imp(const Environment * const e, const FSPath & f, const FSPath & eb,
std::time_t m, const std::shared_ptr<const EclassMtimes> em, bool s) :
env(e),
filename(f),
+ filename_stat(filename.stat()),
ebuild(eb),
+ ebuild_stat(ebuild.stat()),
master_mtime(m),
eclass_mtimes(em),
silent(s)
@@ -107,11 +113,11 @@ namespace
}
{
- std::time_t cache_time(std::max(_imp->master_mtime, _imp->filename.mtim().seconds()));
- bool ok(_imp->ebuild.mtim().seconds() <= cache_time);
+ std::time_t cache_time(std::max(_imp->master_mtime, _imp->filename.stat().mtim().seconds()));
+ bool ok(_imp->ebuild_stat.mtim().seconds() <= cache_time);
if (! ok)
Log::get_instance()->message("e.cache.flat_list.mtime", ll_debug, lc_context)
- << "ebuild has mtime " << _imp->ebuild.mtim().seconds() << ", but expected at most " << cache_time;
+ << "ebuild has mtime " << _imp->ebuild_stat.mtim().seconds() << ", but expected at most " << cache_time;
if (ok && "0" != id->guessed_eapi_name())
{
@@ -124,14 +130,14 @@ namespace
{
std::set<std::string> tokens;
tokenise_whitespace(lines[m.inherited()->flat_list_index()], std::inserter(tokens, tokens.begin()));
- FSEntry eclassdir((id->repository()->location_key()->value() / "eclass").realpath_if_exists());
+ FSPath eclassdir((id->repository()->location_key()->value() / "eclass").realpath_if_exists());
for (std::set<std::string>::const_iterator it(tokens.begin()),
it_end(tokens.end()); it_end != it; ++it)
{
- const FSEntry * eclass(_imp->eclass_mtimes->eclass(*it));
+ const std::pair<FSPath, FSStat> * eclass(_imp->eclass_mtimes->eclass(*it));
if (eclass)
Log::get_instance()->message("e.cache.flat_list.eclass.path", ll_debug, lc_context)
- << "Cache-requested eclass '" << *it << "' maps to '" << *eclass << "'";
+ << "Cache-requested eclass '" << *it << "' maps to '" << eclass->first << "'";
if (! eclass)
{
@@ -140,19 +146,19 @@ namespace
ok = false;
}
- else if (eclass->dirname() != eclassdir)
+ else if (eclass->first.dirname() != eclassdir)
{
Log::get_instance()->message("e.cache.flat_list.eclass.wrong_location", ll_debug, lc_context)
<< "Cache-requested eclass '" << *it << "' was found at '"
- << eclass->dirname() << "', but expected '" << eclassdir << "'";
+ << eclass->first.dirname() << "', but expected '" << eclassdir << "'";
ok = false;
}
- else if (eclass->mtim().seconds() > cache_time)
+ else if (eclass->second.mtim().seconds() > cache_time)
{
Log::get_instance()->message("e.cache.flat_list.eclass.wrong_mtime", ll_debug, lc_context)
<< "Cache-requested eclass '" << *it << "' has mtime "
- << eclass->mtim().seconds() << ", but expected at most " << cache_time;
+ << eclass->second.mtim().seconds() << ", but expected at most " << cache_time;
ok = false;
}
@@ -295,8 +301,8 @@ namespace
}
}
-EbuildFlatMetadataCache::EbuildFlatMetadataCache(const Environment * const v, FSEntry & f,
- const FSEntry & e, std::time_t t, const std::shared_ptr<const EclassMtimes> & m, bool s) :
+EbuildFlatMetadataCache::EbuildFlatMetadataCache(const Environment * const v, const FSPath & f,
+ const FSPath & e, std::time_t t, const std::shared_ptr<const EclassMtimes> & m, bool s) :
Pimp<EbuildFlatMetadataCache>(v, f, e, t, m, s)
{
}
@@ -312,7 +318,7 @@ EbuildFlatMetadataCache::load(const std::shared_ptr<const EbuildID> & id, const
Context context("When loading version metadata from '" + stringify(_imp->filename) + "':");
- if (! _imp->filename.exists())
+ if (! _imp->filename_stat.exists())
{
Log::get_instance()->message("e.cache.failure", _imp->silent ? ll_debug : ll_warning, lc_no_context)
<< "Couldn't use the cache file at '" << _imp->filename << "': " << std::strerror(errno);
@@ -370,11 +376,11 @@ EbuildFlatMetadataCache::load(const std::shared_ptr<const EbuildID> & id, const
{
std::map<std::string, std::string>::const_iterator mtime_it(keys.find("_mtime_"));
- std::time_t cache_time(keys.end() == mtime_it ? _imp->filename.mtim().seconds() : destringify<std::time_t>(mtime_it->second));
- bool ok(_imp->ebuild.mtim().seconds() == cache_time);
+ std::time_t cache_time(keys.end() == mtime_it ? _imp->filename_stat.mtim().seconds() : destringify<std::time_t>(mtime_it->second));
+ bool ok(_imp->ebuild_stat.mtim().seconds() == cache_time);
if (! ok)
Log::get_instance()->message("e.cache.flat_hash.mtime", ll_debug, lc_context)
- << "ebuild has mtime " << _imp->ebuild.mtim().seconds() << ", but expected " << cache_time;
+ << "ebuild has mtime " << _imp->ebuild_stat.mtim().seconds() << ", but expected " << cache_time;
if (ok) {
std::string cache_guessed(keys["_guessed_eapi_"]);
@@ -392,7 +398,7 @@ EbuildFlatMetadataCache::load(const std::shared_ptr<const EbuildID> & id, const
{
std::vector<std::string> eclasses;
tokenise<delim_kind::AnyOfTag, delim_mode::DelimiterTag>(keys["_eclasses_"], "\t", "", std::back_inserter(eclasses));
- FSEntry eclassdir((id->repository()->location_key()->value() / "eclass").realpath_if_exists());
+ FSPath eclassdir((id->repository()->location_key()->value() / "eclass").realpath_if_exists());
for (std::vector<std::string>::const_iterator it(eclasses.begin()),
it_end(eclasses.end()); it_end != it; ++it)
{
@@ -404,7 +410,7 @@ EbuildFlatMetadataCache::load(const std::shared_ptr<const EbuildID> & id, const
<< "_eclasses_ entry is incomplete";
return false;
}
- FSEntry eclass_dir(std::string::npos != it->find('/') ? *(it++) : eclassdir);
+ FSPath eclass_dir(std::string::npos != it->find('/') ? FSPath(*it++) : eclassdir);
if (eclasses.end() == it)
{
Log::get_instance()->message("e.cache.flat_hash.eclass.truncated", ll_warning, lc_context)
@@ -413,10 +419,10 @@ EbuildFlatMetadataCache::load(const std::shared_ptr<const EbuildID> & id, const
}
std::time_t eclass_mtime(destringify<std::time_t>(*it));
- const FSEntry * eclass(_imp->eclass_mtimes->eclass(eclass_name));
+ auto eclass(_imp->eclass_mtimes->eclass(eclass_name));
if (eclass)
Log::get_instance()->message("e.cache.flat_hash.eclass.path", ll_debug, lc_context)
- << "Cache-requested eclass '" << eclass_name << "' maps to '" << *eclass << "'";
+ << "Cache-requested eclass '" << eclass_name << "' maps to '" << eclass->first << "'";
if (! eclass)
{
@@ -425,19 +431,19 @@ EbuildFlatMetadataCache::load(const std::shared_ptr<const EbuildID> & id, const
ok = false;
}
- else if (eclass->dirname() != eclass_dir)
+ else if (eclass->first.dirname() != eclass_dir)
{
Log::get_instance()->message("e.cache.flat_hash.eclass.wrong_location", ll_debug, lc_context)
<< "Cache-requested eclass '" << eclass_name << "' was found at '"
- << eclass->dirname() << "', but expected '" << eclass_dir << "'";
+ << eclass->first.dirname() << "', but expected '" << eclass_dir << "'";
ok = false;
}
- else if (eclass->mtim().seconds() != eclass_mtime)
+ else if (eclass->second.mtim().seconds() != eclass_mtime)
{
Log::get_instance()->message("e.cache.flat_hash.eclass.wrong_mtime", ll_debug, lc_context)
<< "Cache-requested eclass '" << eclass_name << "' has mtime "
- << eclass->mtim().seconds() << ", but expected " << eclass_mtime;
+ << eclass->second.mtim().seconds() << ", but expected " << eclass_mtime;
ok = false;
}
@@ -461,7 +467,7 @@ EbuildFlatMetadataCache::load(const std::shared_ptr<const EbuildID> & id, const
<< "_exlibs_ entry is incomplete";
return false;
}
- FSEntry exlib_dir(*it);
+ FSPath exlib_dir(*it);
if (exlibs.end() == ++it)
{
Log::get_instance()->message("e.cache.flat_hash.exlibs.truncated", ll_warning, lc_context)
@@ -470,10 +476,10 @@ EbuildFlatMetadataCache::load(const std::shared_ptr<const EbuildID> & id, const
}
std::time_t exlib_mtime(destringify<std::time_t>(*it));
- const FSEntry * exlib(_imp->eclass_mtimes->exlib(exlib_name, id->name()));
+ auto exlib(_imp->eclass_mtimes->exlib(exlib_name, id->name()));
if (exlib)
Log::get_instance()->message("e.cache.flat_hash.exlib.path", ll_debug, lc_context)
- << "Cache-requested exlib '" << exlib_name << "' maps to '" << *exlib << "'";
+ << "Cache-requested exlib '" << exlib_name << "' maps to '" << exlib->first << "'";
if (! exlib)
{
@@ -482,19 +488,19 @@ EbuildFlatMetadataCache::load(const std::shared_ptr<const EbuildID> & id, const
ok = false;
}
- else if (exlib->dirname() != exlib_dir)
+ else if (exlib->first.dirname() != exlib_dir)
{
Log::get_instance()->message("e.cache.flat_hash.exlib.wrong_location", ll_debug, lc_context)
<< "Cache-requested exlib '" << exlib_name << "' was found at '"
- << exlib->dirname() << "', but expected '" << exlib_dir << "'";
+ << exlib->first.dirname() << "', but expected '" << exlib_dir << "'";
ok = false;
}
- else if (exlib->mtim().seconds() != exlib_mtime)
+ else if (exlib->second.mtim().seconds() != exlib_mtime)
{
Log::get_instance()->message("e.cache.flat_hash.exlib.wrong_mtime", ll_debug, lc_context)
<< "Cache-requested exlib '" << exlib_name << "' has mtime "
- << exlib->mtim().seconds() << ", but expected " << exlib_mtime;
+ << exlib->second.mtim().seconds() << ", but expected " << exlib_mtime;
ok = false;
}
@@ -682,11 +688,12 @@ EbuildFlatMetadataCache::save(const std::shared_ptr<const EbuildID> & id)
try
{
- FSEntry cat_dir(_imp->filename.dirname());
- FSEntry repo_dir(cat_dir.dirname());
- FSEntry main_dir(repo_dir.dirname());
+ FSPath cat_dir(_imp->filename.dirname());
+ FSPath repo_dir(cat_dir.dirname());
+ FSPath main_dir(repo_dir.dirname());
+ FSStat main_dir_stat(main_dir);
- if (! main_dir.exists())
+ if (! main_dir_stat.exists())
{
Log::get_instance()->message("e.cache.save.no_dir", ll_warning, lc_no_context) << "Directory '"
<< main_dir << "' does not exist, so cannot save cache file '" << _imp->filename << "' "
@@ -694,11 +701,11 @@ EbuildFlatMetadataCache::save(const std::shared_ptr<const EbuildID> & id)
return;
}
- if (repo_dir.mkdir(main_dir.permissions()))
- repo_dir.chmod(main_dir.permissions());
+ if (repo_dir.mkdir(main_dir_stat.permissions(), { fspmkdo_ok_if_exists }))
+ repo_dir.chmod(main_dir_stat.permissions());
- if (cat_dir.mkdir(main_dir.permissions()))
- cat_dir.chmod(main_dir.permissions());
+ if (cat_dir.mkdir(main_dir_stat.permissions(), { fspmkdo_ok_if_exists }))
+ cat_dir.chmod(main_dir_stat.permissions());
}
catch (const FSError & e)
{
@@ -714,7 +721,7 @@ EbuildFlatMetadataCache::save(const std::shared_ptr<const EbuildID> & id)
}
std::ostringstream cache;
- write_kv(cache, "_mtime_", _imp->ebuild.mtim().seconds());
+ write_kv(cache, "_mtime_", _imp->ebuild_stat.mtim().seconds());
write_kv(cache, "_guessed_eapi_", id->guessed_eapi_name());
if (id->eapi()->supported()->ebuild_options()->support_eclasses() && id->inherited_key())
@@ -723,12 +730,12 @@ EbuildFlatMetadataCache::save(const std::shared_ptr<const EbuildID> & id)
for (Set<std::string>::ConstIterator it(id->inherited_key()->value()->begin()),
it_end(id->inherited_key()->value()->end()); it_end != it; ++it)
{
- const FSEntry * eclass(_imp->eclass_mtimes->eclass(*it));
+ auto eclass(_imp->eclass_mtimes->eclass(*it));
if (! eclass)
throw InternalError(PALUDIS_HERE, "eclass '" + *it + "' disappeared?");
eclasses.push_back(*it);
- eclasses.push_back(stringify(eclass->dirname()));
- eclasses.push_back(stringify(eclass->mtim().seconds()));
+ eclasses.push_back(stringify(eclass->first.dirname()));
+ eclasses.push_back(stringify(eclass->second.mtim().seconds()));
}
write_kv(cache, "_eclasses_", join(eclasses.begin(), eclasses.end(), "\t"));
}
@@ -739,12 +746,12 @@ EbuildFlatMetadataCache::save(const std::shared_ptr<const EbuildID> & id)
for (Set<std::string>::ConstIterator it(id->inherited_key()->value()->begin()),
it_end(id->inherited_key()->value()->end()); it_end != it; ++it)
{
- const FSEntry * exlib(_imp->eclass_mtimes->exlib(*it, id->name()));
+ auto exlib(_imp->eclass_mtimes->exlib(*it, id->name()));
if (! exlib)
throw InternalError(PALUDIS_HERE, "exlib '" + *it + "' for '" + stringify(id->name()) + "' disappeared?");
exlibs.push_back(*it);
- exlibs.push_back(stringify(exlib->dirname()));
- exlibs.push_back(stringify(exlib->mtim().seconds()));
+ exlibs.push_back(stringify(exlib->first.dirname()));
+ exlibs.push_back(stringify(exlib->second.mtim().seconds()));
}
write_kv(cache, "_exlibs_", join(exlibs.begin(), exlibs.end(), "\t"));
}
@@ -868,7 +875,7 @@ EbuildFlatMetadataCache::save(const std::shared_ptr<const EbuildID> & id)
SafeOFStream cache_file(_imp->filename);
cache_file << cache.str();
}
- _imp->filename.utime(Timestamp(_imp->ebuild.mtim().seconds(), 0));
+ _imp->filename.utime(Timestamp(_imp->ebuild_stat.mtim().seconds(), 0));
}
catch (const SafeOFStreamError & e)
{
diff --git a/paludis/repositories/e/ebuild_flat_metadata_cache.hh b/paludis/repositories/e/ebuild_flat_metadata_cache.hh
index 6f5c561..e8bdb72 100644
--- a/paludis/repositories/e/ebuild_flat_metadata_cache.hh
+++ b/paludis/repositories/e/ebuild_flat_metadata_cache.hh
@@ -22,7 +22,6 @@
#include <paludis/repositories/e/ebuild.hh>
#include <paludis/repositories/e/ebuild_id.hh>
-#include <paludis/util/fs_entry.hh>
#include <paludis/repositories/e/eclass_mtimes.hh>
#include <paludis/util/pimp.hh>
@@ -46,7 +45,7 @@ namespace paludis
///\name Basic operations
///\{
- EbuildFlatMetadataCache(const Environment * const, FSEntry & filename, const FSEntry & ebuild,
+ EbuildFlatMetadataCache(const Environment * const, const FSPath & filename, const FSPath & ebuild,
time_t master_mtime, const std::shared_ptr<const EclassMtimes> & eclass_mtimes, bool silent);
~EbuildFlatMetadataCache();
diff --git a/paludis/repositories/e/ebuild_flat_metadata_cache_TEST.cc b/paludis/repositories/e/ebuild_flat_metadata_cache_TEST.cc
index 993ecf2..8dd8ab6 100644
--- a/paludis/repositories/e/ebuild_flat_metadata_cache_TEST.cc
+++ b/paludis/repositories/e/ebuild_flat_metadata_cache_TEST.cc
@@ -32,8 +32,8 @@
#include <paludis/util/simple_visitor_cast.hh>
#include <paludis/util/wrapped_forward_iterator.hh>
#include <paludis/util/safe_ifstream.hh>
-#include <paludis/util/fs_entry.hh>
#include <paludis/util/timestamp.hh>
+#include <paludis/util/fs_stat.hh>
#include <test/test_framework.hh>
#include <test/test_runner.hh>
#include <iterator>
@@ -67,10 +67,10 @@ namespace test_cases
std::shared_ptr<Map<std::string, std::string> > keys(std::make_shared<Map<std::string, std::string>>());
keys->insert("format", "e");
keys->insert("names_cache", "/var/empty");
- keys->insert("location", stringify(FSEntry::cwd() / "ebuild_flat_metadata_cache_TEST_dir/repo"));
- keys->insert("profiles", stringify(FSEntry::cwd() / "ebuild_flat_metadata_cache_TEST_dir/repo/profiles/profile"));
+ keys->insert("location", stringify(FSPath::cwd() / "ebuild_flat_metadata_cache_TEST_dir/repo"));
+ keys->insert("profiles", stringify(FSPath::cwd() / "ebuild_flat_metadata_cache_TEST_dir/repo/profiles/profile"));
keys->insert("eclassdirs", "ebuild_flat_metadata_cache_TEST_dir/repo/eclass ebuild_flat_metadata_cache_TEST_dir/extra_eclasses");
- keys->insert("builddir", stringify(FSEntry::cwd() / "ebuild_flat_metadata_cache_TEST_dir" / "build"));
+ keys->insert("builddir", stringify(FSPath::cwd() / "ebuild_flat_metadata_cache_TEST_dir" / "build"));
std::shared_ptr<Repository> repo(ERepository::repository_factory_create(&env,
std::bind(from_keys, keys, std::placeholders::_1)));
env.package_database()->add_repository(1, repo);
@@ -95,10 +95,10 @@ namespace test_cases
std::shared_ptr<Map<std::string, std::string> > keys(std::make_shared<Map<std::string, std::string>>());
keys->insert("format", "e");
keys->insert("names_cache", "/var/empty");
- keys->insert("location", stringify(FSEntry::cwd() / "ebuild_flat_metadata_cache_TEST_dir/repo"));
- keys->insert("profiles", stringify(FSEntry::cwd() / "ebuild_flat_metadata_cache_TEST_dir/repo/profiles/profile"));
+ keys->insert("location", stringify(FSPath::cwd() / "ebuild_flat_metadata_cache_TEST_dir/repo"));
+ keys->insert("profiles", stringify(FSPath::cwd() / "ebuild_flat_metadata_cache_TEST_dir/repo/profiles/profile"));
keys->insert("eclassdirs", "ebuild_flat_metadata_cache_TEST_dir/repo/eclass ebuild_flat_metadata_cache_TEST_dir/extra_eclasses");
- keys->insert("builddir", stringify(FSEntry::cwd() / "ebuild_flat_metadata_cache_TEST_dir" / "build"));
+ keys->insert("builddir", stringify(FSPath::cwd() / "ebuild_flat_metadata_cache_TEST_dir" / "build"));
std::shared_ptr<Repository> repo(ERepository::repository_factory_create(&env,
std::bind(from_keys, keys, std::placeholders::_1)));
env.package_database()->add_repository(1, repo);
@@ -123,10 +123,10 @@ namespace test_cases
std::shared_ptr<Map<std::string, std::string> > keys(std::make_shared<Map<std::string, std::string>>());
keys->insert("format", "e");
keys->insert("names_cache", "/var/empty");
- keys->insert("location", stringify(FSEntry::cwd() / "ebuild_flat_metadata_cache_TEST_dir/repo"));
- keys->insert("profiles", stringify(FSEntry::cwd() / "ebuild_flat_metadata_cache_TEST_dir/repo/profiles/profile"));
+ keys->insert("location", stringify(FSPath::cwd() / "ebuild_flat_metadata_cache_TEST_dir/repo"));
+ keys->insert("profiles", stringify(FSPath::cwd() / "ebuild_flat_metadata_cache_TEST_dir/repo/profiles/profile"));
keys->insert("eclassdirs", "ebuild_flat_metadata_cache_TEST_dir/repo/eclass ebuild_flat_metadata_cache_TEST_dir/extra_eclasses");
- keys->insert("builddir", stringify(FSEntry::cwd() / "ebuild_flat_metadata_cache_TEST_dir" / "build"));
+ keys->insert("builddir", stringify(FSPath::cwd() / "ebuild_flat_metadata_cache_TEST_dir" / "build"));
keys->insert("eapi_when_unknown", "1");
std::shared_ptr<Repository> repo(ERepository::repository_factory_create(&env,
std::bind(from_keys, keys, std::placeholders::_1)));
@@ -152,10 +152,10 @@ namespace test_cases
std::shared_ptr<Map<std::string, std::string> > keys(std::make_shared<Map<std::string, std::string>>());
keys->insert("format", "e");
keys->insert("names_cache", "/var/empty");
- keys->insert("location", stringify(FSEntry::cwd() / "ebuild_flat_metadata_cache_TEST_dir/repo"));
- keys->insert("profiles", stringify(FSEntry::cwd() / "ebuild_flat_metadata_cache_TEST_dir/repo/profiles/profile"));
+ keys->insert("location", stringify(FSPath::cwd() / "ebuild_flat_metadata_cache_TEST_dir/repo"));
+ keys->insert("profiles", stringify(FSPath::cwd() / "ebuild_flat_metadata_cache_TEST_dir/repo/profiles/profile"));
keys->insert("eclassdirs", "ebuild_flat_metadata_cache_TEST_dir/repo/eclass ebuild_flat_metadata_cache_TEST_dir/extra_eclasses");
- keys->insert("builddir", stringify(FSEntry::cwd() / "ebuild_flat_metadata_cache_TEST_dir" / "build"));
+ keys->insert("builddir", stringify(FSPath::cwd() / "ebuild_flat_metadata_cache_TEST_dir" / "build"));
std::shared_ptr<Repository> repo(ERepository::repository_factory_create(&env,
std::bind(from_keys, keys, std::placeholders::_1)));
env.package_database()->add_repository(1, repo);
@@ -183,10 +183,10 @@ namespace test_cases
std::shared_ptr<Map<std::string, std::string> > keys(std::make_shared<Map<std::string, std::string>>());
keys->insert("format", "e");
keys->insert("names_cache", "/var/empty");
- keys->insert("location", stringify(FSEntry::cwd() / "ebuild_flat_metadata_cache_TEST_dir/repo"));
- keys->insert("profiles", stringify(FSEntry::cwd() / "ebuild_flat_metadata_cache_TEST_dir/repo/profiles/profile"));
+ keys->insert("location", stringify(FSPath::cwd() / "ebuild_flat_metadata_cache_TEST_dir/repo"));
+ keys->insert("profiles", stringify(FSPath::cwd() / "ebuild_flat_metadata_cache_TEST_dir/repo/profiles/profile"));
keys->insert("eclassdirs", "ebuild_flat_metadata_cache_TEST_dir/repo/eclass ebuild_flat_metadata_cache_TEST_dir/extra_eclasses");
- keys->insert("builddir", stringify(FSEntry::cwd() / "ebuild_flat_metadata_cache_TEST_dir" / "build"));
+ keys->insert("builddir", stringify(FSPath::cwd() / "ebuild_flat_metadata_cache_TEST_dir" / "build"));
std::shared_ptr<Repository> repo(ERepository::repository_factory_create(&env,
std::bind(from_keys, keys, std::placeholders::_1)));
env.package_database()->add_repository(1, repo);
@@ -211,10 +211,10 @@ namespace test_cases
std::shared_ptr<Map<std::string, std::string> > keys(std::make_shared<Map<std::string, std::string>>());
keys->insert("format", "e");
keys->insert("names_cache", "/var/empty");
- keys->insert("location", stringify(FSEntry::cwd() / "ebuild_flat_metadata_cache_TEST_dir/repo"));
- keys->insert("profiles", stringify(FSEntry::cwd() / "ebuild_flat_metadata_cache_TEST_dir/repo/profiles/profile"));
+ keys->insert("location", stringify(FSPath::cwd() / "ebuild_flat_metadata_cache_TEST_dir/repo"));
+ keys->insert("profiles", stringify(FSPath::cwd() / "ebuild_flat_metadata_cache_TEST_dir/repo/profiles/profile"));
keys->insert("eclassdirs", "ebuild_flat_metadata_cache_TEST_dir/repo/eclass ebuild_flat_metadata_cache_TEST_dir/extra_eclasses");
- keys->insert("builddir", stringify(FSEntry::cwd() / "ebuild_flat_metadata_cache_TEST_dir" / "build"));
+ keys->insert("builddir", stringify(FSPath::cwd() / "ebuild_flat_metadata_cache_TEST_dir" / "build"));
std::shared_ptr<Repository> repo(ERepository::repository_factory_create(&env,
std::bind(from_keys, keys, std::placeholders::_1)));
env.package_database()->add_repository(1, repo);
@@ -239,10 +239,10 @@ namespace test_cases
std::shared_ptr<Map<std::string, std::string> > keys(std::make_shared<Map<std::string, std::string>>());
keys->insert("format", "e");
keys->insert("names_cache", "/var/empty");
- keys->insert("location", stringify(FSEntry::cwd() / "ebuild_flat_metadata_cache_TEST_dir/repo"));
- keys->insert("profiles", stringify(FSEntry::cwd() / "ebuild_flat_metadata_cache_TEST_dir/repo/profiles/profile"));
+ keys->insert("location", stringify(FSPath::cwd() / "ebuild_flat_metadata_cache_TEST_dir/repo"));
+ keys->insert("profiles", stringify(FSPath::cwd() / "ebuild_flat_metadata_cache_TEST_dir/repo/profiles/profile"));
keys->insert("eclassdirs", "ebuild_flat_metadata_cache_TEST_dir/repo/eclass ebuild_flat_metadata_cache_TEST_dir/extra_eclasses");
- keys->insert("builddir", stringify(FSEntry::cwd() / "ebuild_flat_metadata_cache_TEST_dir" / "build"));
+ keys->insert("builddir", stringify(FSPath::cwd() / "ebuild_flat_metadata_cache_TEST_dir" / "build"));
std::shared_ptr<Repository> repo(ERepository::repository_factory_create(&env,
std::bind(from_keys, keys, std::placeholders::_1)));
env.package_database()->add_repository(1, repo);
@@ -267,10 +267,10 @@ namespace test_cases
std::shared_ptr<Map<std::string, std::string> > keys(std::make_shared<Map<std::string, std::string>>());
keys->insert("format", "e");
keys->insert("names_cache", "/var/empty");
- keys->insert("location", stringify(FSEntry::cwd() / "ebuild_flat_metadata_cache_TEST_dir/repo"));
- keys->insert("profiles", stringify(FSEntry::cwd() / "ebuild_flat_metadata_cache_TEST_dir/repo/profiles/profile"));
+ keys->insert("location", stringify(FSPath::cwd() / "ebuild_flat_metadata_cache_TEST_dir/repo"));
+ keys->insert("profiles", stringify(FSPath::cwd() / "ebuild_flat_metadata_cache_TEST_dir/repo/profiles/profile"));
keys->insert("eclassdirs", "ebuild_flat_metadata_cache_TEST_dir/repo/eclass ebuild_flat_metadata_cache_TEST_dir/extra_eclasses");
- keys->insert("builddir", stringify(FSEntry::cwd() / "ebuild_flat_metadata_cache_TEST_dir" / "build"));
+ keys->insert("builddir", stringify(FSPath::cwd() / "ebuild_flat_metadata_cache_TEST_dir" / "build"));
std::shared_ptr<Repository> repo(ERepository::repository_factory_create(&env,
std::bind(from_keys, keys, std::placeholders::_1)));
env.package_database()->add_repository(1, repo);
@@ -295,10 +295,10 @@ namespace test_cases
std::shared_ptr<Map<std::string, std::string> > keys(std::make_shared<Map<std::string, std::string>>());
keys->insert("format", "e");
keys->insert("names_cache", "/var/empty");
- keys->insert("location", stringify(FSEntry::cwd() / "ebuild_flat_metadata_cache_TEST_dir/repo"));
- keys->insert("profiles", stringify(FSEntry::cwd() / "ebuild_flat_metadata_cache_TEST_dir/repo/profiles/profile"));
+ keys->insert("location", stringify(FSPath::cwd() / "ebuild_flat_metadata_cache_TEST_dir/repo"));
+ keys->insert("profiles", stringify(FSPath::cwd() / "ebuild_flat_metadata_cache_TEST_dir/repo/profiles/profile"));
keys->insert("eclassdirs", "ebuild_flat_metadata_cache_TEST_dir/repo/eclass ebuild_flat_metadata_cache_TEST_dir/extra_eclasses");
- keys->insert("builddir", stringify(FSEntry::cwd() / "ebuild_flat_metadata_cache_TEST_dir" / "build"));
+ keys->insert("builddir", stringify(FSPath::cwd() / "ebuild_flat_metadata_cache_TEST_dir" / "build"));
std::shared_ptr<Repository> repo(ERepository::repository_factory_create(&env,
std::bind(from_keys, keys, std::placeholders::_1)));
env.package_database()->add_repository(1, repo);
@@ -323,10 +323,10 @@ namespace test_cases
std::shared_ptr<Map<std::string, std::string> > keys(std::make_shared<Map<std::string, std::string>>());
keys->insert("format", "e");
keys->insert("names_cache", "/var/empty");
- keys->insert("location", stringify(FSEntry::cwd() / "ebuild_flat_metadata_cache_TEST_dir/repo"));
- keys->insert("profiles", stringify(FSEntry::cwd() / "ebuild_flat_metadata_cache_TEST_dir/repo/profiles/profile"));
+ keys->insert("location", stringify(FSPath::cwd() / "ebuild_flat_metadata_cache_TEST_dir/repo"));
+ keys->insert("profiles", stringify(FSPath::cwd() / "ebuild_flat_metadata_cache_TEST_dir/repo/profiles/profile"));
keys->insert("eclassdirs", "ebuild_flat_metadata_cache_TEST_dir/repo/eclass ebuild_flat_metadata_cache_TEST_dir/extra_eclasses");
- keys->insert("builddir", stringify(FSEntry::cwd() / "ebuild_flat_metadata_cache_TEST_dir" / "build"));
+ keys->insert("builddir", stringify(FSPath::cwd() / "ebuild_flat_metadata_cache_TEST_dir" / "build"));
keys->insert("eapi_when_unknown", "1");
std::shared_ptr<Repository> repo(ERepository::repository_factory_create(&env,
std::bind(from_keys, keys, std::placeholders::_1)));
@@ -352,10 +352,10 @@ namespace test_cases
std::shared_ptr<Map<std::string, std::string> > keys(std::make_shared<Map<std::string, std::string>>());
keys->insert("format", "e");
keys->insert("names_cache", "/var/empty");
- keys->insert("location", stringify(FSEntry::cwd() / "ebuild_flat_metadata_cache_TEST_dir/repo"));
- keys->insert("profiles", stringify(FSEntry::cwd() / "ebuild_flat_metadata_cache_TEST_dir/repo/profiles/profile"));
+ keys->insert("location", stringify(FSPath::cwd() / "ebuild_flat_metadata_cache_TEST_dir/repo"));
+ keys->insert("profiles", stringify(FSPath::cwd() / "ebuild_flat_metadata_cache_TEST_dir/repo/profiles/profile"));
keys->insert("eclassdirs", "ebuild_flat_metadata_cache_TEST_dir/repo/eclass ebuild_flat_metadata_cache_TEST_dir/extra_eclasses");
- keys->insert("builddir", stringify(FSEntry::cwd() / "ebuild_flat_metadata_cache_TEST_dir" / "build"));
+ keys->insert("builddir", stringify(FSPath::cwd() / "ebuild_flat_metadata_cache_TEST_dir" / "build"));
std::shared_ptr<Repository> repo(ERepository::repository_factory_create(&env,
std::bind(from_keys, keys, std::placeholders::_1)));
env.package_database()->add_repository(1, repo);
@@ -380,10 +380,10 @@ namespace test_cases
std::shared_ptr<Map<std::string, std::string> > keys(std::make_shared<Map<std::string, std::string>>());
keys->insert("format", "e");
keys->insert("names_cache", "/var/empty");
- keys->insert("location", stringify(FSEntry::cwd() / "ebuild_flat_metadata_cache_TEST_dir/repo"));
- keys->insert("profiles", stringify(FSEntry::cwd() / "ebuild_flat_metadata_cache_TEST_dir/repo/profiles/profile"));
+ keys->insert("location", stringify(FSPath::cwd() / "ebuild_flat_metadata_cache_TEST_dir/repo"));
+ keys->insert("profiles", stringify(FSPath::cwd() / "ebuild_flat_metadata_cache_TEST_dir/repo/profiles/profile"));
keys->insert("eclassdirs", "ebuild_flat_metadata_cache_TEST_dir/repo/eclass ebuild_flat_metadata_cache_TEST_dir/extra_eclasses");
- keys->insert("builddir", stringify(FSEntry::cwd() / "ebuild_flat_metadata_cache_TEST_dir" / "build"));
+ keys->insert("builddir", stringify(FSPath::cwd() / "ebuild_flat_metadata_cache_TEST_dir" / "build"));
std::shared_ptr<Repository> repo(ERepository::repository_factory_create(&env,
std::bind(from_keys, keys, std::placeholders::_1)));
env.package_database()->add_repository(1, repo);
@@ -408,10 +408,10 @@ namespace test_cases
std::shared_ptr<Map<std::string, std::string> > keys(std::make_shared<Map<std::string, std::string>>());
keys->insert("format", "e");
keys->insert("names_cache", "/var/empty");
- keys->insert("location", stringify(FSEntry::cwd() / "ebuild_flat_metadata_cache_TEST_dir/repo"));
- keys->insert("profiles", stringify(FSEntry::cwd() / "ebuild_flat_metadata_cache_TEST_dir/repo/profiles/profile"));
+ keys->insert("location", stringify(FSPath::cwd() / "ebuild_flat_metadata_cache_TEST_dir/repo"));
+ keys->insert("profiles", stringify(FSPath::cwd() / "ebuild_flat_metadata_cache_TEST_dir/repo/profiles/profile"));
keys->insert("eclassdirs", "ebuild_flat_metadata_cache_TEST_dir/repo/eclass ebuild_flat_metadata_cache_TEST_dir/extra_eclasses");
- keys->insert("builddir", stringify(FSEntry::cwd() / "ebuild_flat_metadata_cache_TEST_dir" / "build"));
+ keys->insert("builddir", stringify(FSPath::cwd() / "ebuild_flat_metadata_cache_TEST_dir" / "build"));
std::shared_ptr<Repository> repo(ERepository::repository_factory_create(&env,
std::bind(from_keys, keys, std::placeholders::_1)));
env.package_database()->add_repository(1, repo);
@@ -437,10 +437,10 @@ namespace test_cases
std::shared_ptr<Map<std::string, std::string> > keys(std::make_shared<Map<std::string, std::string>>());
keys->insert("format", "e");
keys->insert("names_cache", "/var/empty");
- keys->insert("location", stringify(FSEntry::cwd() / "ebuild_flat_metadata_cache_TEST_dir/repo"));
- keys->insert("profiles", stringify(FSEntry::cwd() / "ebuild_flat_metadata_cache_TEST_dir/repo/profiles/profile"));
+ keys->insert("location", stringify(FSPath::cwd() / "ebuild_flat_metadata_cache_TEST_dir/repo"));
+ keys->insert("profiles", stringify(FSPath::cwd() / "ebuild_flat_metadata_cache_TEST_dir/repo/profiles/profile"));
keys->insert("eclassdirs", "ebuild_flat_metadata_cache_TEST_dir/repo/eclass ebuild_flat_metadata_cache_TEST_dir/extra_eclasses");
- keys->insert("builddir", stringify(FSEntry::cwd() / "ebuild_flat_metadata_cache_TEST_dir" / "build"));
+ keys->insert("builddir", stringify(FSPath::cwd() / "ebuild_flat_metadata_cache_TEST_dir" / "build"));
std::shared_ptr<Repository> repo(ERepository::repository_factory_create(&env,
std::bind(from_keys, keys, std::placeholders::_1)));
env.package_database()->add_repository(1, repo);
@@ -465,10 +465,10 @@ namespace test_cases
std::shared_ptr<Map<std::string, std::string> > keys(std::make_shared<Map<std::string, std::string>>());
keys->insert("format", "e");
keys->insert("names_cache", "/var/empty");
- keys->insert("location", stringify(FSEntry::cwd() / "ebuild_flat_metadata_cache_TEST_dir/repo"));
- keys->insert("profiles", stringify(FSEntry::cwd() / "ebuild_flat_metadata_cache_TEST_dir/repo/profiles/profile"));
+ keys->insert("location", stringify(FSPath::cwd() / "ebuild_flat_metadata_cache_TEST_dir/repo"));
+ keys->insert("profiles", stringify(FSPath::cwd() / "ebuild_flat_metadata_cache_TEST_dir/repo/profiles/profile"));
keys->insert("eclassdirs", "ebuild_flat_metadata_cache_TEST_dir/repo/eclass ebuild_flat_metadata_cache_TEST_dir/extra_eclasses");
- keys->insert("builddir", stringify(FSEntry::cwd() / "ebuild_flat_metadata_cache_TEST_dir" / "build"));
+ keys->insert("builddir", stringify(FSPath::cwd() / "ebuild_flat_metadata_cache_TEST_dir" / "build"));
std::shared_ptr<Repository> repo(ERepository::repository_factory_create(&env,
std::bind(from_keys, keys, std::placeholders::_1)));
env.package_database()->add_repository(1, repo);
@@ -493,10 +493,10 @@ namespace test_cases
std::shared_ptr<Map<std::string, std::string> > keys(std::make_shared<Map<std::string, std::string>>());
keys->insert("format", "e");
keys->insert("names_cache", "/var/empty");
- keys->insert("location", stringify(FSEntry::cwd() / "ebuild_flat_metadata_cache_TEST_dir/repo"));
- keys->insert("profiles", stringify(FSEntry::cwd() / "ebuild_flat_metadata_cache_TEST_dir/repo/profiles/profile"));
+ keys->insert("location", stringify(FSPath::cwd() / "ebuild_flat_metadata_cache_TEST_dir/repo"));
+ keys->insert("profiles", stringify(FSPath::cwd() / "ebuild_flat_metadata_cache_TEST_dir/repo/profiles/profile"));
keys->insert("eclassdirs", "ebuild_flat_metadata_cache_TEST_dir/repo/eclass ebuild_flat_metadata_cache_TEST_dir/extra_eclasses");
- keys->insert("builddir", stringify(FSEntry::cwd() / "ebuild_flat_metadata_cache_TEST_dir" / "build"));
+ keys->insert("builddir", stringify(FSPath::cwd() / "ebuild_flat_metadata_cache_TEST_dir" / "build"));
std::shared_ptr<Repository> repo(ERepository::repository_factory_create(&env,
std::bind(from_keys, keys, std::placeholders::_1)));
env.package_database()->add_repository(1, repo);
@@ -521,10 +521,10 @@ namespace test_cases
std::shared_ptr<Map<std::string, std::string> > keys(std::make_shared<Map<std::string, std::string>>());
keys->insert("format", "e");
keys->insert("names_cache", "/var/empty");
- keys->insert("location", stringify(FSEntry::cwd() / "ebuild_flat_metadata_cache_TEST_dir/repo"));
- keys->insert("profiles", stringify(FSEntry::cwd() / "ebuild_flat_metadata_cache_TEST_dir/repo/profiles/profile"));
+ keys->insert("location", stringify(FSPath::cwd() / "ebuild_flat_metadata_cache_TEST_dir/repo"));
+ keys->insert("profiles", stringify(FSPath::cwd() / "ebuild_flat_metadata_cache_TEST_dir/repo/profiles/profile"));
keys->insert("eclassdirs", "ebuild_flat_metadata_cache_TEST_dir/repo/eclass ebuild_flat_metadata_cache_TEST_dir/extra_eclasses");
- keys->insert("builddir", stringify(FSEntry::cwd() / "ebuild_flat_metadata_cache_TEST_dir" / "build"));
+ keys->insert("builddir", stringify(FSPath::cwd() / "ebuild_flat_metadata_cache_TEST_dir" / "build"));
std::shared_ptr<Repository> repo(ERepository::repository_factory_create(&env,
std::bind(from_keys, keys, std::placeholders::_1)));
env.package_database()->add_repository(1, repo);
@@ -549,10 +549,10 @@ namespace test_cases
std::shared_ptr<Map<std::string, std::string> > keys(std::make_shared<Map<std::string, std::string>>());
keys->insert("format", "e");
keys->insert("names_cache", "/var/empty");
- keys->insert("location", stringify(FSEntry::cwd() / "ebuild_flat_metadata_cache_TEST_dir/repo"));
- keys->insert("profiles", stringify(FSEntry::cwd() / "ebuild_flat_metadata_cache_TEST_dir/repo/profiles/profile"));
+ keys->insert("location", stringify(FSPath::cwd() / "ebuild_flat_metadata_cache_TEST_dir/repo"));
+ keys->insert("profiles", stringify(FSPath::cwd() / "ebuild_flat_metadata_cache_TEST_dir/repo/profiles/profile"));
keys->insert("eclassdirs", "ebuild_flat_metadata_cache_TEST_dir/repo/eclass ebuild_flat_metadata_cache_TEST_dir/extra_eclasses");
- keys->insert("builddir", stringify(FSEntry::cwd() / "ebuild_flat_metadata_cache_TEST_dir" / "build"));
+ keys->insert("builddir", stringify(FSPath::cwd() / "ebuild_flat_metadata_cache_TEST_dir" / "build"));
std::shared_ptr<Repository> repo(ERepository::repository_factory_create(&env,
std::bind(from_keys, keys, std::placeholders::_1)));
env.package_database()->add_repository(1, repo);
@@ -577,10 +577,10 @@ namespace test_cases
std::shared_ptr<Map<std::string, std::string> > keys(std::make_shared<Map<std::string, std::string>>());
keys->insert("format", "e");
keys->insert("names_cache", "/var/empty");
- keys->insert("location", stringify(FSEntry::cwd() / "ebuild_flat_metadata_cache_TEST_dir/repo"));
- keys->insert("profiles", stringify(FSEntry::cwd() / "ebuild_flat_metadata_cache_TEST_dir/repo/profiles/profile"));
+ keys->insert("location", stringify(FSPath::cwd() / "ebuild_flat_metadata_cache_TEST_dir/repo"));
+ keys->insert("profiles", stringify(FSPath::cwd() / "ebuild_flat_metadata_cache_TEST_dir/repo/profiles/profile"));
keys->insert("eclassdirs", "ebuild_flat_metadata_cache_TEST_dir/repo/eclass ebuild_flat_metadata_cache_TEST_dir/extra_eclasses");
- keys->insert("builddir", stringify(FSEntry::cwd() / "ebuild_flat_metadata_cache_TEST_dir" / "build"));
+ keys->insert("builddir", stringify(FSPath::cwd() / "ebuild_flat_metadata_cache_TEST_dir" / "build"));
std::shared_ptr<Repository> repo(ERepository::repository_factory_create(&env,
std::bind(from_keys, keys, std::placeholders::_1)));
env.package_database()->add_repository(1, repo);
@@ -605,10 +605,10 @@ namespace test_cases
std::shared_ptr<Map<std::string, std::string> > keys(std::make_shared<Map<std::string, std::string>>());
keys->insert("format", "e");
keys->insert("names_cache", "/var/empty");
- keys->insert("location", stringify(FSEntry::cwd() / "ebuild_flat_metadata_cache_TEST_dir/repo"));
- keys->insert("profiles", stringify(FSEntry::cwd() / "ebuild_flat_metadata_cache_TEST_dir/repo/profiles/profile"));
+ keys->insert("location", stringify(FSPath::cwd() / "ebuild_flat_metadata_cache_TEST_dir/repo"));
+ keys->insert("profiles", stringify(FSPath::cwd() / "ebuild_flat_metadata_cache_TEST_dir/repo/profiles/profile"));
keys->insert("eclassdirs", "ebuild_flat_metadata_cache_TEST_dir/repo/eclass ebuild_flat_metadata_cache_TEST_dir/extra_eclasses");
- keys->insert("builddir", stringify(FSEntry::cwd() / "ebuild_flat_metadata_cache_TEST_dir" / "build"));
+ keys->insert("builddir", stringify(FSPath::cwd() / "ebuild_flat_metadata_cache_TEST_dir" / "build"));
std::shared_ptr<Repository> repo(ERepository::repository_factory_create(&env,
std::bind(from_keys, keys, std::placeholders::_1)));
env.package_database()->add_repository(1, repo);
@@ -636,10 +636,10 @@ namespace test_cases
std::shared_ptr<Map<std::string, std::string> > keys(std::make_shared<Map<std::string, std::string>>());
keys->insert("format", "e");
keys->insert("names_cache", "/var/empty");
- keys->insert("location", stringify(FSEntry::cwd() / "ebuild_flat_metadata_cache_TEST_dir/repo"));
- keys->insert("profiles", stringify(FSEntry::cwd() / "ebuild_flat_metadata_cache_TEST_dir/repo/profiles/profile"));
+ keys->insert("location", stringify(FSPath::cwd() / "ebuild_flat_metadata_cache_TEST_dir/repo"));
+ keys->insert("profiles", stringify(FSPath::cwd() / "ebuild_flat_metadata_cache_TEST_dir/repo/profiles/profile"));
keys->insert("eclassdirs", "ebuild_flat_metadata_cache_TEST_dir/repo/eclass ebuild_flat_metadata_cache_TEST_dir/extra_eclasses");
- keys->insert("builddir", stringify(FSEntry::cwd() / "ebuild_flat_metadata_cache_TEST_dir" / "build"));
+ keys->insert("builddir", stringify(FSPath::cwd() / "ebuild_flat_metadata_cache_TEST_dir" / "build"));
std::shared_ptr<Repository> repo(ERepository::repository_factory_create(&env,
std::bind(from_keys, keys, std::placeholders::_1)));
env.package_database()->add_repository(1, repo);
@@ -664,10 +664,10 @@ namespace test_cases
std::shared_ptr<Map<std::string, std::string> > keys(std::make_shared<Map<std::string, std::string>>());
keys->insert("format", "e");
keys->insert("names_cache", "/var/empty");
- keys->insert("location", stringify(FSEntry::cwd() / "ebuild_flat_metadata_cache_TEST_dir/repo"));
- keys->insert("profiles", stringify(FSEntry::cwd() / "ebuild_flat_metadata_cache_TEST_dir/repo/profiles/profile"));
+ keys->insert("location", stringify(FSPath::cwd() / "ebuild_flat_metadata_cache_TEST_dir/repo"));
+ keys->insert("profiles", stringify(FSPath::cwd() / "ebuild_flat_metadata_cache_TEST_dir/repo/profiles/profile"));
keys->insert("eclassdirs", "ebuild_flat_metadata_cache_TEST_dir/repo/eclass ebuild_flat_metadata_cache_TEST_dir/extra_eclasses");
- keys->insert("builddir", stringify(FSEntry::cwd() / "ebuild_flat_metadata_cache_TEST_dir" / "build"));
+ keys->insert("builddir", stringify(FSPath::cwd() / "ebuild_flat_metadata_cache_TEST_dir" / "build"));
std::shared_ptr<Repository> repo(ERepository::repository_factory_create(&env,
std::bind(from_keys, keys, std::placeholders::_1)));
env.package_database()->add_repository(1, repo);
@@ -692,8 +692,8 @@ namespace test_cases
std::shared_ptr<Map<std::string, std::string> > keys(std::make_shared<Map<std::string, std::string>>());
keys->insert("format", "e");
keys->insert("names_cache", "/var/empty");
- keys->insert("location", stringify(FSEntry::cwd() / "ebuild_flat_metadata_cache_TEST_dir/repo"));
- keys->insert("profiles", stringify(FSEntry::cwd() / "ebuild_flat_metadata_cache_TEST_dir/repo/profiles/profile"));
+ keys->insert("location", stringify(FSPath::cwd() / "ebuild_flat_metadata_cache_TEST_dir/repo"));
+ keys->insert("profiles", stringify(FSPath::cwd() / "ebuild_flat_metadata_cache_TEST_dir/repo/profiles/profile"));
keys->insert("eclassdirs", "ebuild_flat_metadata_cache_TEST_dir/repo/eclass ebuild_flat_metadata_cache_TEST_dir/extra_eclasses");
std::shared_ptr<Repository> repo(ERepository::repository_factory_create(&env,
std::bind(from_keys, keys, std::placeholders::_1)));
@@ -719,10 +719,10 @@ namespace test_cases
std::shared_ptr<Map<std::string, std::string> > keys(std::make_shared<Map<std::string, std::string>>());
keys->insert("format", "e");
keys->insert("names_cache", "/var/empty");
- keys->insert("location", stringify(FSEntry::cwd() / "ebuild_flat_metadata_cache_TEST_dir/repo"));
- keys->insert("profiles", stringify(FSEntry::cwd() / "ebuild_flat_metadata_cache_TEST_dir/repo/profiles/profile"));
+ keys->insert("location", stringify(FSPath::cwd() / "ebuild_flat_metadata_cache_TEST_dir/repo"));
+ keys->insert("profiles", stringify(FSPath::cwd() / "ebuild_flat_metadata_cache_TEST_dir/repo/profiles/profile"));
keys->insert("eclassdirs", "ebuild_flat_metadata_cache_TEST_dir/repo/eclass ebuild_flat_metadata_cache_TEST_dir/extra_eclasses");
- keys->insert("builddir", stringify(FSEntry::cwd() / "ebuild_flat_metadata_cache_TEST_dir" / "build"));
+ keys->insert("builddir", stringify(FSPath::cwd() / "ebuild_flat_metadata_cache_TEST_dir" / "build"));
std::shared_ptr<Repository> repo(ERepository::repository_factory_create(&env,
std::bind(from_keys, keys, std::placeholders::_1)));
env.package_database()->add_repository(1, repo);
@@ -750,10 +750,10 @@ namespace test_cases
std::shared_ptr<Map<std::string, std::string> > keys(std::make_shared<Map<std::string, std::string>>());
keys->insert("format", "e");
keys->insert("names_cache", "/var/empty");
- keys->insert("location", stringify(FSEntry::cwd() / "ebuild_flat_metadata_cache_TEST_dir/repo"));
- keys->insert("profiles", stringify(FSEntry::cwd() / "ebuild_flat_metadata_cache_TEST_dir/repo/profiles/profile"));
+ keys->insert("location", stringify(FSPath::cwd() / "ebuild_flat_metadata_cache_TEST_dir/repo"));
+ keys->insert("profiles", stringify(FSPath::cwd() / "ebuild_flat_metadata_cache_TEST_dir/repo/profiles/profile"));
keys->insert("eclassdirs", "ebuild_flat_metadata_cache_TEST_dir/repo/eclass ebuild_flat_metadata_cache_TEST_dir/extra_eclasses");
- keys->insert("builddir", stringify(FSEntry::cwd() / "ebuild_flat_metadata_cache_TEST_dir" / "build"));
+ keys->insert("builddir", stringify(FSPath::cwd() / "ebuild_flat_metadata_cache_TEST_dir" / "build"));
std::shared_ptr<Repository> repo(ERepository::repository_factory_create(&env,
std::bind(from_keys, keys, std::placeholders::_1)));
env.package_database()->add_repository(1, repo);
@@ -781,10 +781,10 @@ namespace test_cases
std::shared_ptr<Map<std::string, std::string> > keys(std::make_shared<Map<std::string, std::string>>());
keys->insert("format", "e");
keys->insert("names_cache", "/var/empty");
- keys->insert("location", stringify(FSEntry::cwd() / "ebuild_flat_metadata_cache_TEST_dir/repo"));
- keys->insert("profiles", stringify(FSEntry::cwd() / "ebuild_flat_metadata_cache_TEST_dir/repo/profiles/profile"));
+ keys->insert("location", stringify(FSPath::cwd() / "ebuild_flat_metadata_cache_TEST_dir/repo"));
+ keys->insert("profiles", stringify(FSPath::cwd() / "ebuild_flat_metadata_cache_TEST_dir/repo/profiles/profile"));
keys->insert("eclassdirs", "ebuild_flat_metadata_cache_TEST_dir/repo/eclass ebuild_flat_metadata_cache_TEST_dir/extra_eclasses");
- keys->insert("builddir", stringify(FSEntry::cwd() / "ebuild_flat_metadata_cache_TEST_dir" / "build"));
+ keys->insert("builddir", stringify(FSPath::cwd() / "ebuild_flat_metadata_cache_TEST_dir" / "build"));
std::shared_ptr<Repository> repo(ERepository::repository_factory_create(&env,
std::bind(from_keys, keys, std::placeholders::_1)));
env.package_database()->add_repository(1, repo);
@@ -809,10 +809,10 @@ namespace test_cases
std::shared_ptr<Map<std::string, std::string> > keys(std::make_shared<Map<std::string, std::string>>());
keys->insert("format", "e");
keys->insert("names_cache", "/var/empty");
- keys->insert("location", stringify(FSEntry::cwd() / "ebuild_flat_metadata_cache_TEST_dir/repo"));
- keys->insert("profiles", stringify(FSEntry::cwd() / "ebuild_flat_metadata_cache_TEST_dir/repo/profiles/profile"));
+ keys->insert("location", stringify(FSPath::cwd() / "ebuild_flat_metadata_cache_TEST_dir/repo"));
+ keys->insert("profiles", stringify(FSPath::cwd() / "ebuild_flat_metadata_cache_TEST_dir/repo/profiles/profile"));
keys->insert("eclassdirs", "ebuild_flat_metadata_cache_TEST_dir/repo/eclass ebuild_flat_metadata_cache_TEST_dir/extra_eclasses");
- keys->insert("builddir", stringify(FSEntry::cwd() / "ebuild_flat_metadata_cache_TEST_dir" / "build"));
+ keys->insert("builddir", stringify(FSPath::cwd() / "ebuild_flat_metadata_cache_TEST_dir" / "build"));
std::shared_ptr<Repository> repo(ERepository::repository_factory_create(&env,
std::bind(from_keys, keys, std::placeholders::_1)));
env.package_database()->add_repository(1, repo);
@@ -837,10 +837,10 @@ namespace test_cases
std::shared_ptr<Map<std::string, std::string> > keys(std::make_shared<Map<std::string, std::string>>());
keys->insert("format", "e");
keys->insert("names_cache", "/var/empty");
- keys->insert("location", stringify(FSEntry::cwd() / "ebuild_flat_metadata_cache_TEST_dir/repo"));
- keys->insert("profiles", stringify(FSEntry::cwd() / "ebuild_flat_metadata_cache_TEST_dir/repo/profiles/profile"));
+ keys->insert("location", stringify(FSPath::cwd() / "ebuild_flat_metadata_cache_TEST_dir/repo"));
+ keys->insert("profiles", stringify(FSPath::cwd() / "ebuild_flat_metadata_cache_TEST_dir/repo/profiles/profile"));
keys->insert("eclassdirs", "ebuild_flat_metadata_cache_TEST_dir/repo/eclass ebuild_flat_metadata_cache_TEST_dir/extra_eclasses");
- keys->insert("builddir", stringify(FSEntry::cwd() / "ebuild_flat_metadata_cache_TEST_dir" / "build"));
+ keys->insert("builddir", stringify(FSPath::cwd() / "ebuild_flat_metadata_cache_TEST_dir" / "build"));
std::shared_ptr<Repository> repo(ERepository::repository_factory_create(&env,
std::bind(from_keys, keys, std::placeholders::_1)));
env.package_database()->add_repository(1, repo);
@@ -865,10 +865,10 @@ namespace test_cases
std::shared_ptr<Map<std::string, std::string> > keys(std::make_shared<Map<std::string, std::string>>());
keys->insert("format", "e");
keys->insert("names_cache", "/var/empty");
- keys->insert("location", stringify(FSEntry::cwd() / "ebuild_flat_metadata_cache_TEST_dir/repo"));
- keys->insert("profiles", stringify(FSEntry::cwd() / "ebuild_flat_metadata_cache_TEST_dir/repo/profiles/profile"));
+ keys->insert("location", stringify(FSPath::cwd() / "ebuild_flat_metadata_cache_TEST_dir/repo"));
+ keys->insert("profiles", stringify(FSPath::cwd() / "ebuild_flat_metadata_cache_TEST_dir/repo/profiles/profile"));
keys->insert("eclassdirs", "ebuild_flat_metadata_cache_TEST_dir/repo/eclass ebuild_flat_metadata_cache_TEST_dir/extra_eclasses");
- keys->insert("builddir", stringify(FSEntry::cwd() / "ebuild_flat_metadata_cache_TEST_dir" / "build"));
+ keys->insert("builddir", stringify(FSPath::cwd() / "ebuild_flat_metadata_cache_TEST_dir" / "build"));
std::shared_ptr<Repository> repo(ERepository::repository_factory_create(&env,
std::bind(from_keys, keys, std::placeholders::_1)));
env.package_database()->add_repository(1, repo);
@@ -900,10 +900,10 @@ namespace test_cases
std::shared_ptr<Map<std::string, std::string> > keys(std::make_shared<Map<std::string, std::string>>());
keys->insert("format", "e");
keys->insert("names_cache", "/var/empty");
- keys->insert("location", stringify(FSEntry::cwd() / "ebuild_flat_metadata_cache_TEST_dir/repo"));
- keys->insert("profiles", stringify(FSEntry::cwd() / "ebuild_flat_metadata_cache_TEST_dir/repo/profiles/profile"));
+ keys->insert("location", stringify(FSPath::cwd() / "ebuild_flat_metadata_cache_TEST_dir/repo"));
+ keys->insert("profiles", stringify(FSPath::cwd() / "ebuild_flat_metadata_cache_TEST_dir/repo/profiles/profile"));
keys->insert("eclassdirs", "ebuild_flat_metadata_cache_TEST_dir/repo/eclass ebuild_flat_metadata_cache_TEST_dir/extra_eclasses");
- keys->insert("builddir", stringify(FSEntry::cwd() / "ebuild_flat_metadata_cache_TEST_dir" / "build"));
+ keys->insert("builddir", stringify(FSPath::cwd() / "ebuild_flat_metadata_cache_TEST_dir" / "build"));
std::shared_ptr<Repository> repo(ERepository::repository_factory_create(&env,
std::bind(from_keys, keys, std::placeholders::_1)));
env.package_database()->add_repository(1, repo);
@@ -928,10 +928,10 @@ namespace test_cases
std::shared_ptr<Map<std::string, std::string> > keys(std::make_shared<Map<std::string, std::string>>());
keys->insert("format", "e");
keys->insert("names_cache", "/var/empty");
- keys->insert("location", stringify(FSEntry::cwd() / "ebuild_flat_metadata_cache_TEST_dir/repo"));
- keys->insert("profiles", stringify(FSEntry::cwd() / "ebuild_flat_metadata_cache_TEST_dir/repo/profiles/profile"));
+ keys->insert("location", stringify(FSPath::cwd() / "ebuild_flat_metadata_cache_TEST_dir/repo"));
+ keys->insert("profiles", stringify(FSPath::cwd() / "ebuild_flat_metadata_cache_TEST_dir/repo/profiles/profile"));
keys->insert("eclassdirs", "ebuild_flat_metadata_cache_TEST_dir/repo/eclass ebuild_flat_metadata_cache_TEST_dir/extra_eclasses");
- keys->insert("builddir", stringify(FSEntry::cwd() / "ebuild_flat_metadata_cache_TEST_dir" / "build"));
+ keys->insert("builddir", stringify(FSPath::cwd() / "ebuild_flat_metadata_cache_TEST_dir" / "build"));
std::shared_ptr<Repository> repo(ERepository::repository_factory_create(&env,
std::bind(from_keys, keys, std::placeholders::_1)));
env.package_database()->add_repository(1, repo);
@@ -956,11 +956,11 @@ namespace test_cases
std::shared_ptr<Map<std::string, std::string> > keys(std::make_shared<Map<std::string, std::string>>());
keys->insert("format", "e");
keys->insert("names_cache", "/var/empty");
- keys->insert("location", stringify(FSEntry::cwd() / "ebuild_flat_metadata_cache_TEST_dir/repo"));
- keys->insert("profiles", stringify(FSEntry::cwd() / "ebuild_flat_metadata_cache_TEST_dir/repo/profiles/profile"));
+ keys->insert("location", stringify(FSPath::cwd() / "ebuild_flat_metadata_cache_TEST_dir/repo"));
+ keys->insert("profiles", stringify(FSPath::cwd() / "ebuild_flat_metadata_cache_TEST_dir/repo/profiles/profile"));
keys->insert("eapi_when_unknown", "exheres-0");
keys->insert("eapi_when_unspecified", "exheres-0");
- keys->insert("builddir", stringify(FSEntry::cwd() / "ebuild_flat_metadata_cache_TEST_dir" / "build"));
+ keys->insert("builddir", stringify(FSPath::cwd() / "ebuild_flat_metadata_cache_TEST_dir" / "build"));
std::shared_ptr<Repository> repo(ERepository::repository_factory_create(&env,
std::bind(from_keys, keys, std::placeholders::_1)));
env.package_database()->add_repository(1, repo);
@@ -988,11 +988,11 @@ namespace test_cases
std::shared_ptr<Map<std::string, std::string> > keys(std::make_shared<Map<std::string, std::string>>());
keys->insert("format", "e");
keys->insert("names_cache", "/var/empty");
- keys->insert("location", stringify(FSEntry::cwd() / "ebuild_flat_metadata_cache_TEST_dir/repo"));
- keys->insert("profiles", stringify(FSEntry::cwd() / "ebuild_flat_metadata_cache_TEST_dir/repo/profiles/profile"));
+ keys->insert("location", stringify(FSPath::cwd() / "ebuild_flat_metadata_cache_TEST_dir/repo"));
+ keys->insert("profiles", stringify(FSPath::cwd() / "ebuild_flat_metadata_cache_TEST_dir/repo/profiles/profile"));
keys->insert("eapi_when_unknown", "exheres-0");
keys->insert("eapi_when_unspecified", "exheres-0");
- keys->insert("builddir", stringify(FSEntry::cwd() / "ebuild_flat_metadata_cache_TEST_dir" / "build"));
+ keys->insert("builddir", stringify(FSPath::cwd() / "ebuild_flat_metadata_cache_TEST_dir" / "build"));
std::shared_ptr<Repository> repo(ERepository::repository_factory_create(&env,
std::bind(from_keys, keys, std::placeholders::_1)));
env.package_database()->add_repository(1, repo);
@@ -1020,11 +1020,11 @@ namespace test_cases
std::shared_ptr<Map<std::string, std::string> > keys(std::make_shared<Map<std::string, std::string>>());
keys->insert("format", "e");
keys->insert("names_cache", "/var/empty");
- keys->insert("location", stringify(FSEntry::cwd() / "ebuild_flat_metadata_cache_TEST_dir/repo"));
- keys->insert("profiles", stringify(FSEntry::cwd() / "ebuild_flat_metadata_cache_TEST_dir/repo/profiles/profile"));
+ keys->insert("location", stringify(FSPath::cwd() / "ebuild_flat_metadata_cache_TEST_dir/repo"));
+ keys->insert("profiles", stringify(FSPath::cwd() / "ebuild_flat_metadata_cache_TEST_dir/repo/profiles/profile"));
keys->insert("eapi_when_unknown", "exheres-0");
keys->insert("eapi_when_unspecified", "exheres-0");
- keys->insert("builddir", stringify(FSEntry::cwd() / "ebuild_flat_metadata_cache_TEST_dir" / "build"));
+ keys->insert("builddir", stringify(FSPath::cwd() / "ebuild_flat_metadata_cache_TEST_dir" / "build"));
std::shared_ptr<Repository> repo(ERepository::repository_factory_create(&env,
std::bind(from_keys, keys, std::placeholders::_1)));
env.package_database()->add_repository(1, repo);
@@ -1049,11 +1049,11 @@ namespace test_cases
std::shared_ptr<Map<std::string, std::string> > keys(std::make_shared<Map<std::string, std::string>>());
keys->insert("format", "e");
keys->insert("names_cache", "/var/empty");
- keys->insert("location", stringify(FSEntry::cwd() / "ebuild_flat_metadata_cache_TEST_dir/repo"));
- keys->insert("profiles", stringify(FSEntry::cwd() / "ebuild_flat_metadata_cache_TEST_dir/repo/profiles/profile"));
+ keys->insert("location", stringify(FSPath::cwd() / "ebuild_flat_metadata_cache_TEST_dir/repo"));
+ keys->insert("profiles", stringify(FSPath::cwd() / "ebuild_flat_metadata_cache_TEST_dir/repo/profiles/profile"));
keys->insert("eapi_when_unknown", "exheres-0");
keys->insert("eapi_when_unspecified", "exheres-0");
- keys->insert("builddir", stringify(FSEntry::cwd() / "ebuild_flat_metadata_cache_TEST_dir" / "build"));
+ keys->insert("builddir", stringify(FSPath::cwd() / "ebuild_flat_metadata_cache_TEST_dir" / "build"));
std::shared_ptr<Repository> repo(ERepository::repository_factory_create(&env,
std::bind(from_keys, keys, std::placeholders::_1)));
env.package_database()->add_repository(1, repo);
@@ -1078,11 +1078,11 @@ namespace test_cases
std::shared_ptr<Map<std::string, std::string> > keys(std::make_shared<Map<std::string, std::string>>());
keys->insert("format", "e");
keys->insert("names_cache", "/var/empty");
- keys->insert("location", stringify(FSEntry::cwd() / "ebuild_flat_metadata_cache_TEST_dir/repo"));
- keys->insert("profiles", stringify(FSEntry::cwd() / "ebuild_flat_metadata_cache_TEST_dir/repo/profiles/profile"));
+ keys->insert("location", stringify(FSPath::cwd() / "ebuild_flat_metadata_cache_TEST_dir/repo"));
+ keys->insert("profiles", stringify(FSPath::cwd() / "ebuild_flat_metadata_cache_TEST_dir/repo/profiles/profile"));
keys->insert("eapi_when_unknown", "exheres-0");
keys->insert("eapi_when_unspecified", "exheres-0");
- keys->insert("builddir", stringify(FSEntry::cwd() / "ebuild_flat_metadata_cache_TEST_dir" / "build"));
+ keys->insert("builddir", stringify(FSPath::cwd() / "ebuild_flat_metadata_cache_TEST_dir" / "build"));
std::shared_ptr<Repository> repo(ERepository::repository_factory_create(&env,
std::bind(from_keys, keys, std::placeholders::_1)));
env.package_database()->add_repository(1, repo);
@@ -1107,11 +1107,11 @@ namespace test_cases
std::shared_ptr<Map<std::string, std::string> > keys(std::make_shared<Map<std::string, std::string>>());
keys->insert("format", "e");
keys->insert("names_cache", "/var/empty");
- keys->insert("location", stringify(FSEntry::cwd() / "ebuild_flat_metadata_cache_TEST_dir/repo"));
- keys->insert("profiles", stringify(FSEntry::cwd() / "ebuild_flat_metadata_cache_TEST_dir/repo/profiles/profile"));
+ keys->insert("location", stringify(FSPath::cwd() / "ebuild_flat_metadata_cache_TEST_dir/repo"));
+ keys->insert("profiles", stringify(FSPath::cwd() / "ebuild_flat_metadata_cache_TEST_dir/repo/profiles/profile"));
keys->insert("eapi_when_unknown", "exheres-0");
keys->insert("eapi_when_unspecified", "exheres-0");
- keys->insert("builddir", stringify(FSEntry::cwd() / "ebuild_flat_metadata_cache_TEST_dir" / "build"));
+ keys->insert("builddir", stringify(FSPath::cwd() / "ebuild_flat_metadata_cache_TEST_dir" / "build"));
std::shared_ptr<Repository> repo(ERepository::repository_factory_create(&env,
std::bind(from_keys, keys, std::placeholders::_1)));
env.package_database()->add_repository(1, repo);
@@ -1143,11 +1143,11 @@ namespace test_cases
std::shared_ptr<Map<std::string, std::string> > keys(std::make_shared<Map<std::string, std::string>>());
keys->insert("format", "e");
keys->insert("names_cache", "/var/empty");
- keys->insert("location", stringify(FSEntry::cwd() / "ebuild_flat_metadata_cache_TEST_dir/repo"));
- keys->insert("profiles", stringify(FSEntry::cwd() / "ebuild_flat_metadata_cache_TEST_dir/repo/profiles/profile"));
+ keys->insert("location", stringify(FSPath::cwd() / "ebuild_flat_metadata_cache_TEST_dir/repo"));
+ keys->insert("profiles", stringify(FSPath::cwd() / "ebuild_flat_metadata_cache_TEST_dir/repo/profiles/profile"));
keys->insert("eapi_when_unknown", "exheres-0");
keys->insert("eapi_when_unspecified", "exheres-0");
- keys->insert("builddir", stringify(FSEntry::cwd() / "ebuild_flat_metadata_cache_TEST_dir" / "build"));
+ keys->insert("builddir", stringify(FSPath::cwd() / "ebuild_flat_metadata_cache_TEST_dir" / "build"));
std::shared_ptr<Repository> repo(ERepository::repository_factory_create(&env,
std::bind(from_keys, keys, std::placeholders::_1)));
env.package_database()->add_repository(1, repo);
@@ -1172,11 +1172,11 @@ namespace test_cases
std::shared_ptr<Map<std::string, std::string> > keys(std::make_shared<Map<std::string, std::string>>());
keys->insert("format", "e");
keys->insert("names_cache", "/var/empty");
- keys->insert("location", stringify(FSEntry::cwd() / "ebuild_flat_metadata_cache_TEST_dir/repo"));
- keys->insert("profiles", stringify(FSEntry::cwd() / "ebuild_flat_metadata_cache_TEST_dir/repo/profiles/profile"));
+ keys->insert("location", stringify(FSPath::cwd() / "ebuild_flat_metadata_cache_TEST_dir/repo"));
+ keys->insert("profiles", stringify(FSPath::cwd() / "ebuild_flat_metadata_cache_TEST_dir/repo/profiles/profile"));
keys->insert("eapi_when_unknown", "exheres-0");
keys->insert("eapi_when_unspecified", "exheres-0");
- keys->insert("builddir", stringify(FSEntry::cwd() / "ebuild_flat_metadata_cache_TEST_dir" / "build"));
+ keys->insert("builddir", stringify(FSPath::cwd() / "ebuild_flat_metadata_cache_TEST_dir" / "build"));
std::shared_ptr<Repository> repo(ERepository::repository_factory_create(&env,
std::bind(from_keys, keys, std::placeholders::_1)));
env.package_database()->add_repository(1, repo);
@@ -1196,7 +1196,7 @@ namespace test_cases
std::string contents(const std::string & filename)
{
- SafeIFStream s(FSEntry(filename).realpath());
+ SafeIFStream s(FSPath(filename).realpath());
return std::string((std::istreambuf_iterator<char>(s)), std::istreambuf_iterator<char>());
}
@@ -1207,11 +1207,11 @@ namespace test_cases
std::shared_ptr<Map<std::string, std::string> > keys(std::make_shared<Map<std::string, std::string>>());
keys->insert("format", "e");
keys->insert("names_cache", "/var/empty");
- keys->insert("location", stringify(FSEntry::cwd() / "ebuild_flat_metadata_cache_TEST_dir/repo"));
- keys->insert("profiles", stringify(FSEntry::cwd() / "ebuild_flat_metadata_cache_TEST_dir/repo/profiles/profile"));
+ keys->insert("location", stringify(FSPath::cwd() / "ebuild_flat_metadata_cache_TEST_dir/repo"));
+ keys->insert("profiles", stringify(FSPath::cwd() / "ebuild_flat_metadata_cache_TEST_dir/repo/profiles/profile"));
keys->insert("eclassdirs", "ebuild_flat_metadata_cache_TEST_dir/repo/eclass ebuild_flat_metadata_cache_TEST_dir/extra_eclasses");
keys->insert("write_cache", "ebuild_flat_metadata_cache_TEST_dir/cache");
- keys->insert("builddir", stringify(FSEntry::cwd() / "ebuild_flat_metadata_cache_TEST_dir" / "build"));
+ keys->insert("builddir", stringify(FSPath::cwd() / "ebuild_flat_metadata_cache_TEST_dir" / "build"));
std::shared_ptr<Repository> repo(ERepository::repository_factory_create(&env,
std::bind(from_keys, keys, std::placeholders::_1)));
env.package_database()->add_repository(1, repo);
@@ -1222,7 +1222,7 @@ namespace test_cases
TEST_CHECK(bool(id->short_description_key()));
TEST_CHECK_EQUAL(contents("ebuild_flat_metadata_cache_TEST_dir/cache/test-repo/cat/write-1"), contents("ebuild_flat_metadata_cache_TEST_dir/cache/expected/cat/write-1"));
- TEST_CHECK_EQUAL(FSEntry("ebuild_flat_metadata_cache_TEST_dir/cache/test-repo/cat/write-1").mtim().seconds(), 60);
+ TEST_CHECK_EQUAL(FSPath("ebuild_flat_metadata_cache_TEST_dir/cache/test-repo/cat/write-1").stat().mtim().seconds(), 60);
}
} test_metadata_write;
@@ -1232,7 +1232,7 @@ namespace test_cases
std::string contents(const std::string & filename)
{
- SafeIFStream s(FSEntry(filename).realpath());
+ SafeIFStream s(FSPath(filename).realpath());
return std::string((std::istreambuf_iterator<char>(s)), std::istreambuf_iterator<char>());
}
@@ -1243,11 +1243,11 @@ namespace test_cases
std::shared_ptr<Map<std::string, std::string> > keys(std::make_shared<Map<std::string, std::string>>());
keys->insert("format", "e");
keys->insert("names_cache", "/var/empty");
- keys->insert("location", stringify(FSEntry::cwd() / "ebuild_flat_metadata_cache_TEST_dir/repo"));
- keys->insert("profiles", stringify(FSEntry::cwd() / "ebuild_flat_metadata_cache_TEST_dir/repo/profiles/profile"));
+ keys->insert("location", stringify(FSPath::cwd() / "ebuild_flat_metadata_cache_TEST_dir/repo"));
+ keys->insert("profiles", stringify(FSPath::cwd() / "ebuild_flat_metadata_cache_TEST_dir/repo/profiles/profile"));
keys->insert("eclassdirs", "ebuild_flat_metadata_cache_TEST_dir/repo/eclass ebuild_flat_metadata_cache_TEST_dir/extra_eclasses");
keys->insert("write_cache", "ebuild_flat_metadata_cache_TEST_dir/cache");
- keys->insert("builddir", stringify(FSEntry::cwd() / "ebuild_flat_metadata_cache_TEST_dir" / "build"));
+ keys->insert("builddir", stringify(FSPath::cwd() / "ebuild_flat_metadata_cache_TEST_dir" / "build"));
std::shared_ptr<Repository> repo(ERepository::repository_factory_create(&env,
std::bind(from_keys, keys, std::placeholders::_1)));
env.package_database()->add_repository(1, repo);
@@ -1258,7 +1258,7 @@ namespace test_cases
TEST_CHECK(bool(id->short_description_key()));
TEST_CHECK_EQUAL(contents("ebuild_flat_metadata_cache_TEST_dir/cache/test-repo/cat/write-eapi1-1"), contents("ebuild_flat_metadata_cache_TEST_dir/cache/expected/cat/write-eapi1-1"));
- TEST_CHECK_EQUAL(FSEntry("ebuild_flat_metadata_cache_TEST_dir/cache/test-repo/cat/write-eapi1-1").mtim().seconds(), 60);
+ TEST_CHECK_EQUAL(FSPath("ebuild_flat_metadata_cache_TEST_dir/cache/test-repo/cat/write-eapi1-1").stat().mtim().seconds(), 60);
}
} test_metadata_write_eapi1;
@@ -1268,7 +1268,7 @@ namespace test_cases
std::string contents(const std::string & filename)
{
- SafeIFStream s(FSEntry(filename).realpath());
+ SafeIFStream s(FSPath(filename).realpath());
return std::string((std::istreambuf_iterator<char>(s)), std::istreambuf_iterator<char>());
}
@@ -1279,13 +1279,13 @@ namespace test_cases
std::shared_ptr<Map<std::string, std::string> > keys(std::make_shared<Map<std::string, std::string>>());
keys->insert("format", "e");
keys->insert("names_cache", "/var/empty");
- keys->insert("location", stringify(FSEntry::cwd() / "ebuild_flat_metadata_cache_TEST_dir/repo"));
- keys->insert("profiles", stringify(FSEntry::cwd() / "ebuild_flat_metadata_cache_TEST_dir/repo/profiles/profile"));
+ keys->insert("location", stringify(FSPath::cwd() / "ebuild_flat_metadata_cache_TEST_dir/repo"));
+ keys->insert("profiles", stringify(FSPath::cwd() / "ebuild_flat_metadata_cache_TEST_dir/repo/profiles/profile"));
keys->insert("eclassdirs",
- stringify((FSEntry::cwd() / "ebuild_flat_metadata_cache_TEST_dir/repo/eclass").realpath())
- + " " + stringify((FSEntry::cwd() / "ebuild_flat_metadata_cache_TEST_dir/extra_eclasses").realpath()));
+ stringify((FSPath::cwd() / "ebuild_flat_metadata_cache_TEST_dir/repo/eclass").realpath())
+ + " " + stringify((FSPath::cwd() / "ebuild_flat_metadata_cache_TEST_dir/extra_eclasses").realpath()));
keys->insert("write_cache", "ebuild_flat_metadata_cache_TEST_dir/cache");
- keys->insert("builddir", stringify(FSEntry::cwd() / "ebuild_flat_metadata_cache_TEST_dir" / "build"));
+ keys->insert("builddir", stringify(FSPath::cwd() / "ebuild_flat_metadata_cache_TEST_dir" / "build"));
std::shared_ptr<Repository> repo(ERepository::repository_factory_create(&env,
std::bind(from_keys, keys, std::placeholders::_1)));
env.package_database()->add_repository(1, repo);
@@ -1296,7 +1296,7 @@ namespace test_cases
TEST_CHECK(bool(id->short_description_key()));
TEST_CHECK_EQUAL(contents("ebuild_flat_metadata_cache_TEST_dir/cache/test-repo/cat/write-eclasses-1"), contents("ebuild_flat_metadata_cache_TEST_dir/cache/expected/cat/write-eclasses-1"));
- TEST_CHECK_EQUAL(FSEntry("ebuild_flat_metadata_cache_TEST_dir/cache/test-repo/cat/write-eclasses-1").mtim().seconds(), 60);
+ TEST_CHECK_EQUAL(FSPath("ebuild_flat_metadata_cache_TEST_dir/cache/test-repo/cat/write-eclasses-1").stat().mtim().seconds(), 60);
}
} test_metadata_write_eclasses;
@@ -1306,7 +1306,7 @@ namespace test_cases
std::string contents(const std::string & filename)
{
- SafeIFStream s(FSEntry(filename).realpath());
+ SafeIFStream s(FSPath(filename).realpath());
return std::string((std::istreambuf_iterator<char>(s)), std::istreambuf_iterator<char>());
}
@@ -1317,12 +1317,12 @@ namespace test_cases
std::shared_ptr<Map<std::string, std::string> > keys(std::make_shared<Map<std::string, std::string>>());
keys->insert("format", "e");
keys->insert("names_cache", "/var/empty");
- keys->insert("location", stringify(FSEntry::cwd() / "ebuild_flat_metadata_cache_TEST_dir/repo"));
- keys->insert("profiles", stringify(FSEntry::cwd() / "ebuild_flat_metadata_cache_TEST_dir/repo/profiles/profile"));
+ keys->insert("location", stringify(FSPath::cwd() / "ebuild_flat_metadata_cache_TEST_dir/repo"));
+ keys->insert("profiles", stringify(FSPath::cwd() / "ebuild_flat_metadata_cache_TEST_dir/repo/profiles/profile"));
keys->insert("eapi_when_unknown", "exheres-0");
keys->insert("eapi_when_unspecified", "exheres-0");
keys->insert("write_cache", "ebuild_flat_metadata_cache_TEST_dir/cache");
- keys->insert("builddir", stringify(FSEntry::cwd() / "ebuild_flat_metadata_cache_TEST_dir" / "build"));
+ keys->insert("builddir", stringify(FSPath::cwd() / "ebuild_flat_metadata_cache_TEST_dir" / "build"));
std::shared_ptr<Repository> repo(ERepository::repository_factory_create(&env,
std::bind(from_keys, keys, std::placeholders::_1)));
env.package_database()->add_repository(1, repo);
@@ -1333,7 +1333,7 @@ namespace test_cases
TEST_CHECK(bool(id->short_description_key()));
TEST_CHECK_EQUAL(contents("ebuild_flat_metadata_cache_TEST_dir/cache/test-repo/cat/write-exlibs-1"), contents("ebuild_flat_metadata_cache_TEST_dir/cache/expected/cat/write-exlibs-1"));
- TEST_CHECK_EQUAL(FSEntry("ebuild_flat_metadata_cache_TEST_dir/cache/test-repo/cat/write-exlibs-1").mtim().seconds(), 60);
+ TEST_CHECK_EQUAL(FSPath("ebuild_flat_metadata_cache_TEST_dir/cache/test-repo/cat/write-exlibs-1").stat().mtim().seconds(), 60);
}
} test_metadata_write_exlibs;
}
diff --git a/paludis/repositories/e/ebuild_id.cc b/paludis/repositories/e/ebuild_id.cc
index 6528c20..22273c3 100644
--- a/paludis/repositories/e/ebuild_id.cc
+++ b/paludis/repositories/e/ebuild_id.cc
@@ -41,7 +41,7 @@
#include <paludis/user_dep_spec.hh>
#include <paludis/notifier_callback.hh>
-#include <paludis/util/fs_entry.hh>
+#include <paludis/util/fs_error.hh>
#include <paludis/util/stringify.hh>
#include <paludis/util/log.hh>
#include <paludis/util/mutex.hh>
@@ -57,10 +57,12 @@
#include <paludis/util/destringify.hh>
#include <paludis/util/singleton-impl.hh>
#include <paludis/util/accept_visitor.hh>
+#include <paludis/util/fs_stat.hh>
#include <set>
#include <iterator>
#include <algorithm>
+#include <ctime>
using namespace paludis;
using namespace paludis::erepository;
@@ -76,7 +78,7 @@ namespace paludis
const VersionSpec version;
const Environment * const environment;
const std::shared_ptr<const ERepository> repository;
- const FSEntry ebuild;
+ const FSPath ebuild;
mutable std::shared_ptr<const EAPI> eapi;
const std::string guessed_eapi;
const time_t master_mtime;
@@ -85,7 +87,7 @@ namespace paludis
mutable bool has_masks;
mutable std::shared_ptr<const ESlotKey> slot;
- mutable std::shared_ptr<const LiteralMetadataValueKey<FSEntry> > fs_location;
+ mutable std::shared_ptr<const LiteralMetadataValueKey<FSPath> > fs_location;
mutable std::shared_ptr<const LiteralMetadataValueKey<std::string> > short_description;
mutable std::shared_ptr<const LiteralMetadataValueKey<std::string> > long_description;
mutable std::shared_ptr<const LiteralMetadataValueKey<std::string> > captured_stdout_key;
@@ -129,7 +131,7 @@ namespace paludis
Imp(const QualifiedPackageName & q, const VersionSpec & v,
const Environment * const e,
- const std::shared_ptr<const ERepository> r, const FSEntry & f, const std::string & g,
+ const std::shared_ptr<const ERepository> r, const FSPath & f, const std::string & g,
const time_t t, const std::shared_ptr<const EclassMtimes> & m) :
name(q),
version(v),
@@ -164,7 +166,7 @@ namespace paludis
EbuildID::EbuildID(const QualifiedPackageName & q, const VersionSpec & v,
const Environment * const e,
const std::shared_ptr<const ERepository> & r,
- const FSEntry & f,
+ const FSPath & f,
const std::string & g,
const time_t t,
const std::shared_ptr<const EclassMtimes> & m) :
@@ -207,18 +209,18 @@ EbuildID::need_keys_added() const
// fs_location key could have been loaded by the ::fs_location_key() already.
if (! _imp->fs_location)
{
- _imp->fs_location = std::make_shared<LiteralMetadataValueKey<FSEntry> >("EBUILD", "Ebuild Location",
+ _imp->fs_location = std::make_shared<LiteralMetadataValueKey<FSPath> >("EBUILD", "Ebuild Location",
mkt_internal, _imp->ebuild);
add_metadata_key(_imp->fs_location);
}
Context context("When generating metadata for ID '" + canonical_form(idcf_full) + "':");
- FSEntry cache_file(_imp->repository->params().cache());
+ FSPath cache_file(_imp->repository->params().cache());
cache_file /= stringify(name().category());
cache_file /= stringify(name().package()) + "-" + stringify(version());
- FSEntry write_cache_file(_imp->repository->params().write_cache());
+ FSPath write_cache_file(_imp->repository->params().write_cache());
if (_imp->repository->params().append_repository_name_to_write_cache())
write_cache_file /= stringify(repository()->name());
write_cache_file /= stringify(name().category());
@@ -238,7 +240,7 @@ EbuildID::need_keys_added() const
write_cache_file, _imp->ebuild, _imp->master_mtime, _imp->eclass_mtimes, true);
if (write_metadata_cache.load(shared_from_this(), false))
ok = true;
- else if (write_cache_file.exists())
+ else if (write_cache_file.stat().exists())
{
try
{
@@ -863,7 +865,7 @@ EbuildID::defined_phases_key() const
return _imp->defined_phases;
}
-const std::shared_ptr<const MetadataValueKey<FSEntry> >
+const std::shared_ptr<const MetadataValueKey<FSPath> >
EbuildID::fs_location_key() const
{
Lock l(_imp->mutex);
@@ -871,7 +873,7 @@ EbuildID::fs_location_key() const
// Avoid loading whole metadata
if (! _imp->fs_location)
{
- _imp->fs_location = std::make_shared<LiteralMetadataValueKey<FSEntry> >("EBUILD", "Ebuild Location", mkt_internal, _imp->ebuild);
+ _imp->fs_location = std::make_shared<LiteralMetadataValueKey<FSPath> >("EBUILD", "Ebuild Location", mkt_internal, _imp->ebuild);
add_metadata_key(_imp->fs_location);
}
@@ -1557,13 +1559,13 @@ EbuildID::add_build_options(const std::shared_ptr<Choices> & choices) const
void
EbuildID::purge_invalid_cache() const
{
- FSEntry write_cache_file(_imp->repository->params().write_cache());
+ FSPath write_cache_file(_imp->repository->params().write_cache());
if (_imp->repository->params().append_repository_name_to_write_cache())
write_cache_file /= stringify(repository()->name());
write_cache_file /= stringify(name().category());
write_cache_file /= stringify(name().package()) + "-" + stringify(version());
- if (write_cache_file.exists())
+ if (write_cache_file.stat().exists())
{
if (_imp->repository->params().write_cache().basename() != "empty")
{
diff --git a/paludis/repositories/e/ebuild_id.hh b/paludis/repositories/e/ebuild_id.hh
index abc5ab2..52c8292 100644
--- a/paludis/repositories/e/ebuild_id.hh
+++ b/paludis/repositories/e/ebuild_id.hh
@@ -22,7 +22,6 @@
#include <paludis/package_id.hh>
#include <paludis/metadata_key.hh>
-#include <paludis/util/fs_entry-fwd.hh>
#include <paludis/repositories/e/eapi-fwd.hh>
#include <paludis/repositories/e/e_repository_id.hh>
@@ -51,7 +50,7 @@ namespace paludis
EbuildID(const QualifiedPackageName &, const VersionSpec &,
const Environment * const e,
const std::shared_ptr<const ERepository> &,
- const FSEntry & file,
+ const FSPath & file,
const std::string & guessed_eapi,
const time_t master_mtime,
const std::shared_ptr<const EclassMtimes> & eclass_mtimes);
@@ -82,7 +81,7 @@ namespace paludis
virtual const std::shared_ptr<const MetadataTimeKey> installed_time_key() const;
virtual const std::shared_ptr<const MetadataCollectionKey<PackageIDSequence> > contains_key() const;
virtual const std::shared_ptr<const MetadataValueKey<std::shared_ptr<const PackageID> > > contained_in_key() const;
- virtual const std::shared_ptr<const MetadataValueKey<FSEntry> > fs_location_key() const;
+ virtual const std::shared_ptr<const MetadataValueKey<FSPath> > fs_location_key() const;
virtual const std::shared_ptr<const MetadataValueKey<std::shared_ptr<const Choices> > > choices_key() const;
const std::shared_ptr<const MetadataCollectionKey<Set<std::string> > > from_repositories_key() const;
diff --git a/paludis/repositories/e/eclass_mtimes.cc b/paludis/repositories/e/eclass_mtimes.cc
index 059b992..9058642 100644
--- a/paludis/repositories/e/eclass_mtimes.cc
+++ b/paludis/repositories/e/eclass_mtimes.cc
@@ -24,10 +24,10 @@
#include <paludis/name.hh>
#include <paludis/util/pimp-impl.hh>
#include <paludis/util/sequence.hh>
-#include <paludis/util/fs_entry.hh>
#include <paludis/util/mutex.hh>
#include <paludis/util/wrapped_forward_iterator.hh>
#include <paludis/util/hashes.hh>
+#include <paludis/util/fs_stat.hh>
#include <unordered_map>
using namespace paludis;
@@ -36,28 +36,28 @@ namespace
{
struct Cache
{
- std::shared_ptr<const FSEntrySequence> dirs;
- std::unordered_map<std::string, FSEntry, Hash<std::string> > files;
+ std::shared_ptr<const FSPathSequence> dirs;
+ std::unordered_map<std::string, std::pair<FSPath, FSStat>, Hash<std::string> > files;
- Cache(const std::shared_ptr<const FSEntrySequence> & d) :
+ Cache(const std::shared_ptr<const FSPathSequence> & d) :
dirs(d)
{
}
};
- const FSEntry *
+ const std::pair<FSPath, FSStat> *
lookup(const std::string & e, Cache & c)
{
- std::unordered_map<std::string, FSEntry, Hash<std::string> >::const_iterator i(c.files.find(e));
+ auto i(c.files.find(e));
if (i != c.files.end())
return & i->second;
- for (FSEntrySequence::ReverseConstIterator d(c.dirs->rbegin()),
+ for (FSPathSequence::ReverseConstIterator d(c.dirs->rbegin()),
d_end(c.dirs->rend()) ; d != d_end ; ++d)
{
- FSEntry f(*d / e);
- if (f.exists())
- return & c.files.insert(std::make_pair(e, f.realpath())).first->second;
+ FSPath f(*d / e);
+ if (f.stat().exists())
+ return & c.files.insert(std::make_pair(e, std::make_pair(f.realpath(), f.stat()))).first->second;
}
return 0;
@@ -74,7 +74,7 @@ namespace paludis
mutable std::unordered_map<QualifiedPackageName, Cache, Hash<QualifiedPackageName> > exlibs;
mutable Mutex mutex;
- Imp(const ERepository * r, const std::shared_ptr<const FSEntrySequence> & d) :
+ Imp(const ERepository * r, const std::shared_ptr<const FSPathSequence> & d) :
repo(r),
eclasses(d)
{
@@ -82,7 +82,7 @@ namespace paludis
};
}
-EclassMtimes::EclassMtimes(const ERepository * r, const std::shared_ptr<const FSEntrySequence> & d) :
+EclassMtimes::EclassMtimes(const ERepository * r, const std::shared_ptr<const FSPathSequence> & d) :
Pimp<EclassMtimes>(r, d)
{
}
@@ -91,14 +91,14 @@ EclassMtimes::~EclassMtimes()
{
}
-const FSEntry *
+const std::pair<FSPath, FSStat> *
EclassMtimes::eclass(const std::string & e) const
{
Lock l(_imp->mutex);
return lookup(e + ".eclass", _imp->eclasses);
}
-const FSEntry *
+const std::pair<FSPath, FSStat> *
EclassMtimes::exlib(const std::string & e, const QualifiedPackageName & qpn) const
{
Lock l(_imp->mutex);
diff --git a/paludis/repositories/e/eclass_mtimes.hh b/paludis/repositories/e/eclass_mtimes.hh
index 74d9387..116f08f 100644
--- a/paludis/repositories/e/eclass_mtimes.hh
+++ b/paludis/repositories/e/eclass_mtimes.hh
@@ -1,7 +1,7 @@
/* vim: set sw=4 sts=4 et foldmethod=syntax : */
/*
- * Copyright (c) 2006, 2007, 2008 Ciaran McCreesh
+ * Copyright (c) 2006, 2007, 2008, 2010 Ciaran McCreesh
*
* This file is part of the Paludis package manager. Paludis is free software;
* you can redistribute it and/or modify it under the terms of the GNU General
@@ -22,8 +22,10 @@
#include <paludis/name-fwd.hh>
#include <paludis/util/pimp.hh>
-#include <paludis/util/fs_entry-fwd.hh>
+#include <paludis/util/fs_path-fwd.hh>
+#include <paludis/util/fs_stat-fwd.hh>
#include <memory>
+#include <utility>
namespace paludis
{
@@ -43,7 +45,7 @@ namespace paludis
///\name Basic operations
///\{
- EclassMtimes(const ERepository *, const std::shared_ptr<const FSEntrySequence> &);
+ EclassMtimes(const ERepository *, const std::shared_ptr<const FSPathSequence> &);
~EclassMtimes();
///\}
@@ -51,12 +53,12 @@ namespace paludis
/**
* Fetch the full path of a given eclass.
*/
- const FSEntry * eclass(const std::string &) const;
+ const std::pair<FSPath, FSStat> * eclass(const std::string &) const;
/**
* Fetch the full path of a given exlib, on the path of a given package.
*/
- const FSEntry * exlib(const std::string &, const QualifiedPackageName &) const;
+ const std::pair<FSPath, FSStat> * exlib(const std::string &, const QualifiedPackageName &) const;
};
}
diff --git a/paludis/repositories/e/exheres_layout.cc b/paludis/repositories/e/exheres_layout.cc
index d7f36b9..9332677 100644
--- a/paludis/repositories/e/exheres_layout.cc
+++ b/paludis/repositories/e/exheres_layout.cc
@@ -23,8 +23,6 @@
#include <paludis/util/config_file.hh>
#include <paludis/package_id.hh>
#include <paludis/package_database.hh>
-#include <paludis/util/dir_iterator.hh>
-#include <paludis/util/fs_entry.hh>
#include <paludis/util/pimp-impl.hh>
#include <paludis/util/indirect_iterator-impl.hh>
#include <paludis/util/log.hh>
@@ -39,6 +37,8 @@
#include <paludis/util/wrapped_forward_iterator.hh>
#include <paludis/util/hashes.hh>
#include <paludis/util/make_null_shared_ptr.hh>
+#include <paludis/util/fs_iterator.hh>
+#include <paludis/util/fs_stat.hh>
#include <paludis/choice.hh>
#include <paludis/literal_metadata_key.hh>
#include <unordered_map>
@@ -59,7 +59,7 @@ namespace paludis
struct Imp<ExheresLayout>
{
const ERepository * const repository;
- const FSEntry tree_root;
+ const FSPath tree_root;
mutable Mutex big_nasty_mutex;
@@ -70,38 +70,38 @@ namespace paludis
mutable std::shared_ptr<CategoryNamePartSet> category_names_collection;
- std::shared_ptr<FSEntrySequence> arch_list_files;
- std::shared_ptr<FSEntrySequence> repository_mask_files;
- std::shared_ptr<FSEntrySequence> profiles_desc_files;
- std::shared_ptr<FSEntrySequence> mirror_files;
- std::shared_ptr<FSEntrySequence> info_variables_files;
- std::shared_ptr<FSEntrySequence> info_packages_files;
+ std::shared_ptr<FSPathSequence> arch_list_files;
+ std::shared_ptr<FSPathSequence> repository_mask_files;
+ std::shared_ptr<FSPathSequence> profiles_desc_files;
+ std::shared_ptr<FSPathSequence> mirror_files;
+ std::shared_ptr<FSPathSequence> info_variables_files;
+ std::shared_ptr<FSPathSequence> info_packages_files;
std::shared_ptr<UseDescFileInfoSequence> use_desc_files;
- Imp(const ERepository * const n, const FSEntry & t) :
+ Imp(const ERepository * const n, const FSPath & t) :
repository(n),
tree_root(t),
has_category_names(false),
- arch_list_files(std::make_shared<FSEntrySequence>()),
- repository_mask_files(std::make_shared<FSEntrySequence>()),
- profiles_desc_files(std::make_shared<FSEntrySequence>()),
- mirror_files(std::make_shared<FSEntrySequence>()),
- info_variables_files(std::make_shared<FSEntrySequence>()),
- info_packages_files(std::make_shared<FSEntrySequence>()),
+ arch_list_files(std::make_shared<FSPathSequence>()),
+ repository_mask_files(std::make_shared<FSPathSequence>()),
+ profiles_desc_files(std::make_shared<FSPathSequence>()),
+ mirror_files(std::make_shared<FSPathSequence>()),
+ info_variables_files(std::make_shared<FSPathSequence>()),
+ info_packages_files(std::make_shared<FSPathSequence>()),
use_desc_files(std::make_shared<UseDescFileInfoSequence>())
{
}
};
}
-ExheresLayout::ExheresLayout(const ERepository * const r, const FSEntry & tree_root,
- const std::shared_ptr<const FSEntrySequence> & f) :
+ExheresLayout::ExheresLayout(const ERepository * const r, const FSPath & tree_root,
+ const std::shared_ptr<const FSPathSequence> & f) :
Layout(f),
Pimp<ExheresLayout>(r, tree_root)
{
if (master_repositories_locations())
{
- for (FSEntrySequence::ConstIterator l(master_repositories_locations()->begin()), l_end(master_repositories_locations()->end()) ;
+ for (FSPathSequence::ConstIterator l(master_repositories_locations()->begin()), l_end(master_repositories_locations()->end()) ;
l != l_end ; ++l)
{
/* don't also follow our masters' masters. Otherwise things like masters = arbor x11 will
@@ -112,10 +112,10 @@ ExheresLayout::ExheresLayout(const ERepository * const r, const FSEntry & tree_r
_imp->mirror_files->push_back(*l / "metadata" / "mirrors.conf");
_imp->info_variables_files->push_back(*l / "metadata" / "info" / "variables.conf");
- FSEntry descs(*l / "metadata" / "options" / "descriptions");
- if (descs.is_directory_or_symlink_to_directory())
+ FSPath descs(*l / "metadata" / "options" / "descriptions");
+ if (descs.stat().is_directory_or_symlink_to_directory())
{
- for (DirIterator d(descs), d_end ; d != d_end ; ++d)
+ for (FSIterator d(descs, { }), d_end ; d != d_end ; ++d)
{
if (! is_file_with_extension(*d, ".conf", { }))
continue;
@@ -137,10 +137,10 @@ ExheresLayout::ExheresLayout(const ERepository * const r, const FSEntry & tree_r
_imp->info_variables_files->push_back(_imp->tree_root / "metadata" / "info" / "variables.conf");
_imp->info_packages_files->push_back(_imp->tree_root / "metadata" / "info" / "packages.conf");
- FSEntry descs(_imp->tree_root / "metadata" / "options" / "descriptions");
- if (descs.is_directory_or_symlink_to_directory())
+ FSPath descs(_imp->tree_root / "metadata" / "options" / "descriptions");
+ if (descs.stat().is_directory_or_symlink_to_directory())
{
- for (DirIterator d(descs), d_end ; d != d_end ; ++d)
+ for (FSIterator d(descs, { }), d_end ; d != d_end ; ++d)
{
if (! is_file_with_extension(*d, ".conf", { }))
continue;
@@ -158,7 +158,7 @@ ExheresLayout::~ExheresLayout()
{
}
-FSEntry
+FSPath
ExheresLayout::categories_file() const
{
return _imp->tree_root / "metadata" / "categories.conf";
@@ -178,17 +178,17 @@ ExheresLayout::need_category_names() const
bool found_one(false);
- std::list<FSEntry> cats_list;
+ std::list<FSPath> cats_list;
if (_imp->repository->params().master_repositories())
for (ERepositorySequence::ConstIterator e(_imp->repository->params().master_repositories()->begin()),
e_end(_imp->repository->params().master_repositories()->end()) ; e != e_end ; ++e)
cats_list.push_back((*e)->layout()->categories_file());
cats_list.push_back(categories_file());
- for (std::list<FSEntry>::const_iterator i(cats_list.begin()), i_end(cats_list.end()) ;
+ for (std::list<FSPath>::const_iterator i(cats_list.begin()), i_end(cats_list.end()) ;
i != i_end ; ++i)
{
- if (! i->exists())
+ if (! i->stat().exists())
continue;
LineConfigFile cats(*i, { });
@@ -233,9 +233,9 @@ ExheresLayout::need_package_ids(const QualifiedPackageName & n) const
std::shared_ptr<PackageIDSequence> v(std::make_shared<PackageIDSequence>());
- FSEntry path(_imp->tree_root / "packages" / stringify(n.category()) / stringify(n.package()));
+ FSPath path(_imp->tree_root / "packages" / stringify(n.category()) / stringify(n.package()));
- for (DirIterator e(path), e_end ; e != e_end ; ++e)
+ for (FSIterator e(path, { }), e_end ; e != e_end ; ++e)
{
if (! _imp->repository->is_package_file(n, *e))
continue;
@@ -304,11 +304,11 @@ ExheresLayout::has_package_named(const QualifiedPackageName & q) const
if (_imp->package_names.find(q) != _imp->package_names.end())
return true;
- FSEntry fs(_imp->tree_root);
+ FSPath fs(_imp->tree_root);
fs /= "packages";
fs /= stringify(q.category());
fs /= stringify(q.package());
- if (! fs.is_directory_or_symlink_to_directory())
+ if (! fs.stat().is_directory_or_symlink_to_directory())
return false;
_imp->package_names.insert(std::make_pair(q, false));
return true;
@@ -361,12 +361,12 @@ ExheresLayout::package_names(const CategoryNamePart & c) const
if (_imp->category_names.end() == _imp->category_names.find(c))
return std::make_shared<QualifiedPackageNameSet>();
- if ((_imp->tree_root / "packages" / stringify(c)).is_directory_or_symlink_to_directory())
- for (DirIterator d(_imp->tree_root / "packages" / stringify(c)), d_end ; d != d_end ; ++d)
+ if ((_imp->tree_root / "packages" / stringify(c)).stat().is_directory_or_symlink_to_directory())
+ for (FSIterator d(_imp->tree_root / "packages" / stringify(c), { }), d_end ; d != d_end ; ++d)
{
try
{
- if (! d->is_directory_or_symlink_to_directory())
+ if (! d->stat().is_directory_or_symlink_to_directory())
continue;
if (d->basename() == "CVS")
@@ -410,49 +410,49 @@ ExheresLayout::package_ids(const QualifiedPackageName & n) const
return std::make_shared<PackageIDSequence>();
}
-const std::shared_ptr<const FSEntrySequence>
+const std::shared_ptr<const FSPathSequence>
ExheresLayout::info_packages_files() const
{
return _imp->info_packages_files;
}
-const std::shared_ptr<const FSEntrySequence>
+const std::shared_ptr<const FSPathSequence>
ExheresLayout::info_variables_files() const
{
return _imp->info_variables_files;
}
-FSEntry
+FSPath
ExheresLayout::package_directory(const QualifiedPackageName & qpn) const
{
return _imp->tree_root / "packages" / stringify(qpn.category()) / stringify(qpn.package());
}
-FSEntry
+FSPath
ExheresLayout::category_directory(const CategoryNamePart & cat) const
{
return _imp->tree_root / "packages" / stringify(cat);
}
-std::shared_ptr<const FSEntrySequence>
+std::shared_ptr<const FSPathSequence>
ExheresLayout::arch_list_files() const
{
return _imp->arch_list_files;
}
-std::shared_ptr<const FSEntrySequence>
+std::shared_ptr<const FSPathSequence>
ExheresLayout::repository_mask_files() const
{
return _imp->repository_mask_files;
}
-std::shared_ptr<const FSEntrySequence>
+std::shared_ptr<const FSPathSequence>
ExheresLayout::profiles_desc_files() const
{
return _imp->profiles_desc_files;
}
-std::shared_ptr<const FSEntrySequence>
+std::shared_ptr<const FSPathSequence>
ExheresLayout::mirror_files() const
{
return _imp->mirror_files;
@@ -464,7 +464,7 @@ ExheresLayout::use_desc_files() const
return _imp->use_desc_files;
}
-FSEntry
+FSPath
ExheresLayout::profiles_base_dir() const
{
if (master_repositories_locations() && ! master_repositories_locations()->empty())
@@ -473,34 +473,34 @@ ExheresLayout::profiles_base_dir() const
return _imp->tree_root / "profiles";
}
-std::shared_ptr<const FSEntrySequence>
+std::shared_ptr<const FSPathSequence>
ExheresLayout::exlibsdirs(const QualifiedPackageName & q) const
{
- std::shared_ptr<FSEntrySequence> result(std::make_shared<FSEntrySequence>());
+ std::shared_ptr<FSPathSequence> result(std::make_shared<FSPathSequence>());
- std::shared_ptr<const FSEntrySequence> global(exlibsdirs_global());
+ std::shared_ptr<const FSPathSequence> global(exlibsdirs_global());
std::copy(global->begin(), global->end(), result->back_inserter());
- std::shared_ptr<const FSEntrySequence> category(exlibsdirs_category(q.category()));
+ std::shared_ptr<const FSPathSequence> category(exlibsdirs_category(q.category()));
std::copy(category->begin(), category->end(), result->back_inserter());
- std::shared_ptr<const FSEntrySequence> package(exlibsdirs_package(q));
+ std::shared_ptr<const FSPathSequence> package(exlibsdirs_package(q));
std::copy(package->begin(), package->end(), result->back_inserter());
return result;
}
-std::shared_ptr<const FSEntrySequence>
+std::shared_ptr<const FSPathSequence>
ExheresLayout::exlibsdirs_global() const
{
- std::shared_ptr<FSEntrySequence> result(std::make_shared<FSEntrySequence>());
+ std::shared_ptr<FSPathSequence> result(std::make_shared<FSPathSequence>());
if (_imp->repository->params().master_repositories())
{
for (ERepositorySequence::ConstIterator e(_imp->repository->params().master_repositories()->begin()),
e_end(_imp->repository->params().master_repositories()->end()) ; e != e_end ; ++e)
{
- std::shared_ptr<const FSEntrySequence> master((*e)->layout()->exlibsdirs_global());
+ std::shared_ptr<const FSPathSequence> master((*e)->layout()->exlibsdirs_global());
std::copy(master->begin(), master->end(), result->back_inserter());
}
}
@@ -509,17 +509,17 @@ ExheresLayout::exlibsdirs_global() const
return result;
}
-std::shared_ptr<const FSEntrySequence>
+std::shared_ptr<const FSPathSequence>
ExheresLayout::exlibsdirs_category(const CategoryNamePart & c) const
{
- std::shared_ptr<FSEntrySequence> result(std::make_shared<FSEntrySequence>());
+ std::shared_ptr<FSPathSequence> result(std::make_shared<FSPathSequence>());
if (_imp->repository->params().master_repositories())
{
for (ERepositorySequence::ConstIterator e(_imp->repository->params().master_repositories()->begin()),
e_end(_imp->repository->params().master_repositories()->end()) ; e != e_end ; ++e)
{
- std::shared_ptr<const FSEntrySequence> master((*e)->layout()->exlibsdirs_category(c));
+ std::shared_ptr<const FSPathSequence> master((*e)->layout()->exlibsdirs_category(c));
std::copy(master->begin(), master->end(), result->back_inserter());
}
}
@@ -528,17 +528,17 @@ ExheresLayout::exlibsdirs_category(const CategoryNamePart & c) const
return result;
}
-std::shared_ptr<const FSEntrySequence>
+std::shared_ptr<const FSPathSequence>
ExheresLayout::exlibsdirs_package(const QualifiedPackageName & q) const
{
- std::shared_ptr<FSEntrySequence> result(std::make_shared<FSEntrySequence>());
+ std::shared_ptr<FSPathSequence> result(std::make_shared<FSPathSequence>());
if (_imp->repository->params().master_repositories())
{
for (ERepositorySequence::ConstIterator e(_imp->repository->params().master_repositories()->begin()),
e_end(_imp->repository->params().master_repositories()->end()) ; e != e_end ; ++e)
{
- std::shared_ptr<const FSEntrySequence> master((*e)->layout()->exlibsdirs_package(q));
+ std::shared_ptr<const FSPathSequence> master((*e)->layout()->exlibsdirs_package(q));
std::copy(master->begin(), master->end(), result->back_inserter());
}
}
@@ -547,17 +547,17 @@ ExheresLayout::exlibsdirs_package(const QualifiedPackageName & q) const
return result;
}
-std::shared_ptr<const FSEntrySequence>
+std::shared_ptr<const FSPathSequence>
ExheresLayout::licenses_dirs() const
{
- std::shared_ptr<FSEntrySequence> result(std::make_shared<FSEntrySequence>());
+ std::shared_ptr<FSPathSequence> result(std::make_shared<FSPathSequence>());
if (_imp->repository->params().master_repositories())
{
for (ERepositorySequence::ConstIterator e(_imp->repository->params().master_repositories()->begin()),
e_end(_imp->repository->params().master_repositories()->end()) ; e != e_end ; ++e)
{
- std::shared_ptr<const FSEntrySequence> master((*e)->layout()->licenses_dirs());
+ std::shared_ptr<const FSPathSequence> master((*e)->layout()->licenses_dirs());
std::copy(master->begin(), master->end(), result->back_inserter());
}
}
@@ -568,26 +568,26 @@ ExheresLayout::licenses_dirs() const
namespace
{
- void aux_files_helper(const FSEntry & d,
- std::shared_ptr<Map<FSEntry, std::string> > & m,
+ void aux_files_helper(const FSPath & d,
+ std::shared_ptr<Map<FSPath, std::string, FSPathComparator> > & m,
const QualifiedPackageName & qpn)
{
- if (! d.exists())
+ if (! d.stat().exists())
return;
- std::list<FSEntry> files((DirIterator(d)),
- DirIterator());
- for (std::list<FSEntry>::iterator f(files.begin()) ;
+ std::list<FSPath> files((FSIterator(d, { })), FSIterator());
+ for (std::list<FSPath>::iterator f(files.begin()) ;
f != files.end() ; ++f)
{
- if (f->is_directory())
+ FSStat f_stat(f->stat());
+ if (f_stat.is_directory())
{
if ("CVS" != f->basename())
aux_files_helper((*f), m, qpn);
}
else
{
- if (! f->is_regular_file())
+ if (! f_stat.is_regular_file())
continue;
if (is_file_with_prefix_extension((*f),
("digest-"+stringify(qpn.package())), "",
@@ -599,18 +599,18 @@ namespace
}
}
-std::shared_ptr<Map<FSEntry, std::string> >
+std::shared_ptr<Map<FSPath, std::string, FSPathComparator> >
ExheresLayout::manifest_files(const QualifiedPackageName & qpn) const
{
- std::shared_ptr<Map<FSEntry, std::string> > result(std::make_shared<Map<FSEntry, std::string>>());
- FSEntry package_dir = _imp->repository->layout()->package_directory(qpn);
+ auto result(std::make_shared<Map<FSPath, std::string, FSPathComparator>>());
+ FSPath package_dir = _imp->repository->layout()->package_directory(qpn);
- std::list<FSEntry> package_files((DirIterator(package_dir)),
- DirIterator());
- for (std::list<FSEntry>::iterator f(package_files.begin()) ;
+ std::list<FSPath> package_files((FSIterator(package_dir, { })), FSIterator());
+ for (std::list<FSPath>::iterator f(package_files.begin()) ;
f != package_files.end() ; ++f)
{
- if (! (*f).is_regular_file() || ((*f).basename() == "Manifest") )
+ FSStat f_stat(f->stat());
+ if (! f_stat.is_regular_file() || ((*f).basename() == "Manifest") )
continue;
std::string file_type("MISC");
@@ -636,24 +636,24 @@ ExheresLayout::invalidate_masks()
(*it2)->invalidate_masks();
}
-FSEntry
+FSPath
ExheresLayout::binary_ebuild_location(const QualifiedPackageName & q, const VersionSpec & v,
const std::string & eapi) const
{
return package_directory(q) / _imp->repository->binary_ebuild_name(q, v, eapi);
}
-std::shared_ptr<MetadataValueKey<FSEntry> >
+std::shared_ptr<MetadataValueKey<FSPath> >
ExheresLayout::accounts_repository_data_location_key() const
{
- if ((_imp->tree_root / "metadata" / "accounts").exists())
- return std::make_shared<LiteralMetadataValueKey<FSEntry>>("accounts_repository_data_location",
+ if ((_imp->tree_root / "metadata" / "accounts").stat().exists())
+ return std::make_shared<LiteralMetadataValueKey<FSPath>>("accounts_repository_data_location",
"AccountsRepository data location", mkt_internal, _imp->tree_root / "metadata" / "accounts");
else
return make_null_shared_ptr();
}
-std::shared_ptr<MetadataValueKey<FSEntry> >
+std::shared_ptr<MetadataValueKey<FSPath> >
ExheresLayout::e_updates_location_key() const
{
return make_null_shared_ptr();
diff --git a/paludis/repositories/e/exheres_layout.hh b/paludis/repositories/e/exheres_layout.hh
index 27c1c42..bf5b326 100644
--- a/paludis/repositories/e/exheres_layout.hh
+++ b/paludis/repositories/e/exheres_layout.hh
@@ -1,7 +1,7 @@
/* vim: set sw=4 sts=4 et foldmethod=syntax : */
/*
- * Copyright (c) 2007, 2008, 2009 Ciaran McCreesh
+ * Copyright (c) 2007, 2008, 2009, 2010 Ciaran McCreesh
*
* This file is part of the Paludis package manager. Paludis is free software;
* you can redistribute it and/or modify it under the terms of the GNU General
@@ -46,8 +46,8 @@ namespace paludis
///\name Basic operations
///\{
- ExheresLayout(const ERepository * const, const FSEntry &,
- const std::shared_ptr<const FSEntrySequence> &);
+ ExheresLayout(const ERepository * const, const FSPath &,
+ const std::shared_ptr<const FSPathSequence> &);
virtual ~ExheresLayout();
@@ -59,7 +59,7 @@ namespace paludis
virtual bool has_package_named(const QualifiedPackageName &) const
PALUDIS_ATTRIBUTE((warn_unused_result));
- virtual FSEntry categories_file() const
+ virtual FSPath categories_file() const
PALUDIS_ATTRIBUTE((warn_unused_result));
virtual std::shared_ptr<const CategoryNamePartSet> category_names() const
@@ -73,61 +73,61 @@ namespace paludis
const QualifiedPackageName &) const
PALUDIS_ATTRIBUTE((warn_unused_result));
- virtual const std::shared_ptr<const FSEntrySequence> info_packages_files() const
+ virtual const std::shared_ptr<const FSPathSequence> info_packages_files() const
PALUDIS_ATTRIBUTE((warn_unused_result));
- virtual const std::shared_ptr<const FSEntrySequence> info_variables_files() const
+ virtual const std::shared_ptr<const FSPathSequence> info_variables_files() const
PALUDIS_ATTRIBUTE((warn_unused_result));
- virtual FSEntry package_directory(const QualifiedPackageName &) const
+ virtual FSPath package_directory(const QualifiedPackageName &) const
PALUDIS_ATTRIBUTE((warn_unused_result));
- virtual FSEntry category_directory(const CategoryNamePart &) const
+ virtual FSPath category_directory(const CategoryNamePart &) const
PALUDIS_ATTRIBUTE((warn_unused_result));
- virtual FSEntry binary_ebuild_location(const QualifiedPackageName &, const VersionSpec &,
+ virtual FSPath binary_ebuild_location(const QualifiedPackageName &, const VersionSpec &,
const std::string & eapi) const
PALUDIS_ATTRIBUTE((warn_unused_result));
- virtual std::shared_ptr<const FSEntrySequence> arch_list_files() const
+ virtual std::shared_ptr<const FSPathSequence> arch_list_files() const
PALUDIS_ATTRIBUTE((warn_unused_result));
- virtual std::shared_ptr<const FSEntrySequence> repository_mask_files() const
+ virtual std::shared_ptr<const FSPathSequence> repository_mask_files() const
PALUDIS_ATTRIBUTE((warn_unused_result));
- virtual std::shared_ptr<const FSEntrySequence> profiles_desc_files() const
+ virtual std::shared_ptr<const FSPathSequence> profiles_desc_files() const
PALUDIS_ATTRIBUTE((warn_unused_result));
- virtual std::shared_ptr<const FSEntrySequence> mirror_files() const
+ virtual std::shared_ptr<const FSPathSequence> mirror_files() const
PALUDIS_ATTRIBUTE((warn_unused_result));
virtual std::shared_ptr<const UseDescFileInfoSequence> use_desc_files() const
PALUDIS_ATTRIBUTE((warn_unused_result));
- virtual FSEntry profiles_base_dir() const
+ virtual FSPath profiles_base_dir() const
PALUDIS_ATTRIBUTE((warn_unused_result));
- virtual std::shared_ptr<const FSEntrySequence> exlibsdirs(const QualifiedPackageName &) const;
+ virtual std::shared_ptr<const FSPathSequence> exlibsdirs(const QualifiedPackageName &) const;
- virtual std::shared_ptr<const FSEntrySequence> exlibsdirs_global() const
+ virtual std::shared_ptr<const FSPathSequence> exlibsdirs_global() const
PALUDIS_ATTRIBUTE((warn_unused_result));
- virtual std::shared_ptr<const FSEntrySequence> exlibsdirs_category(const CategoryNamePart &) const
+ virtual std::shared_ptr<const FSPathSequence> exlibsdirs_category(const CategoryNamePart &) const
PALUDIS_ATTRIBUTE((warn_unused_result));
- virtual std::shared_ptr<const FSEntrySequence> exlibsdirs_package(const QualifiedPackageName &) const
+ virtual std::shared_ptr<const FSPathSequence> exlibsdirs_package(const QualifiedPackageName &) const
PALUDIS_ATTRIBUTE((warn_unused_result));
- virtual std::shared_ptr<const FSEntrySequence> licenses_dirs() const
+ virtual std::shared_ptr<const FSPathSequence> licenses_dirs() const
PALUDIS_ATTRIBUTE((warn_unused_result));
- virtual std::shared_ptr<Map<FSEntry, std::string> > manifest_files(const QualifiedPackageName &) const
+ virtual std::shared_ptr<Map<FSPath, std::string, FSPathComparator> > manifest_files(const QualifiedPackageName &) const
PALUDIS_ATTRIBUTE((warn_unused_result));
- virtual std::shared_ptr<MetadataValueKey<FSEntry> > accounts_repository_data_location_key() const
+ virtual std::shared_ptr<MetadataValueKey<FSPath> > accounts_repository_data_location_key() const
PALUDIS_ATTRIBUTE((warn_unused_result));
- virtual std::shared_ptr<MetadataValueKey<FSEntry> > e_updates_location_key() const
+ virtual std::shared_ptr<MetadataValueKey<FSPath> > e_updates_location_key() const
PALUDIS_ATTRIBUTE((warn_unused_result));
virtual void invalidate_masks();
diff --git a/paludis/repositories/e/exheres_profile.cc b/paludis/repositories/e/exheres_profile.cc
index 4c6e637..75eb671 100644
--- a/paludis/repositories/e/exheres_profile.cc
+++ b/paludis/repositories/e/exheres_profile.cc
@@ -37,6 +37,8 @@
#include <paludis/util/hashes.hh>
#include <paludis/util/system.hh>
#include <paludis/util/make_null_shared_ptr.hh>
+#include <paludis/util/fs_stat.hh>
+
#include <paludis/choice.hh>
#include <paludis/dep_tag.hh>
#include <paludis/environment.hh>
@@ -54,7 +56,7 @@ using namespace paludis::erepository;
namespace
{
const std::shared_ptr<const LineConfigFile> make_config_file(
- const FSEntry & f,
+ const FSPath & f,
const LineConfigFileOptions & o)
{
return std::make_shared<LineConfigFile>(f, o);
@@ -74,7 +76,7 @@ namespace paludis
const Environment * const env;
const ERepository * const repository;
- std::shared_ptr<FSEntrySequence> profiles_with_parents;
+ std::shared_ptr<FSPathSequence> profiles_with_parents;
PaludisLikeOptionsConf options_conf;
EnvironmentVariablesMap environment_variables;
@@ -94,11 +96,11 @@ namespace paludis
const std::shared_ptr<GeneralSetDepTag> system_tag;
Imp(const Environment * const e, const ERepository * const p,
- const RepositoryName & name, const FSEntrySequence &,
+ const RepositoryName & name, const FSPathSequence &,
const std::string &, const bool) :
env(e),
repository(p),
- profiles_with_parents(std::make_shared<FSEntrySequence>()),
+ profiles_with_parents(std::make_shared<FSPathSequence>()),
options_conf(make_named_values<PaludisLikeOptionsConfParams>(
n::allow_locking() = true,
n::environment() = e,
@@ -123,11 +125,11 @@ namespace paludis
ExheresProfile::ExheresProfile(
const Environment * const env, const ERepository * const p, const RepositoryName & name,
- const FSEntrySequence & location,
+ const FSPathSequence & location,
const std::string & arch_var_if_special, const bool x) :
Pimp<ExheresProfile>(env, p, name, location, arch_var_if_special, x)
{
- for (FSEntrySequence::ConstIterator l(location.begin()), l_end(location.end()) ;
+ for (FSPathSequence::ConstIterator l(location.begin()), l_end(location.end()) ;
l != l_end ; ++l)
_load_dir(*l);
@@ -204,16 +206,16 @@ ExheresProfile::~ExheresProfile()
}
void
-ExheresProfile::_load_dir(const FSEntry & f)
+ExheresProfile::_load_dir(const FSPath & f)
{
- if (! f.is_directory_or_symlink_to_directory())
+ if (! f.stat().is_directory_or_symlink_to_directory())
{
Log::get_instance()->message("e.exheres_profile.not_a_directory", ll_warning, lc_context) <<
"Profile component '" << f << "' is not a directory";
return;
}
- if ((f / "parents.conf").exists())
+ if ((f / "parents.conf").stat().exists())
{
LineConfigFile file(f / "parents.conf", { });
for (LineConfigFile::ConstIterator line(file.begin()), line_end(file.end()) ;
@@ -221,16 +223,16 @@ ExheresProfile::_load_dir(const FSEntry & f)
_load_dir((f / *line).realpath());
}
- if ((f / "options.conf").exists())
+ if ((f / "options.conf").stat().exists())
_imp->options_conf.add_file(f / "options.conf");
- if ((f / "package_mask.conf").exists())
+ if ((f / "package_mask.conf").stat().exists())
_imp->package_mask_file.add_file(f / "package_mask.conf");
- if ((f / "packages").exists())
+ if ((f / "packages").stat().exists())
_imp->packages_file.add_file(f / "packages");
- if ((f / "make.defaults").exists())
+ if ((f / "make.defaults").stat().exists())
{
const std::shared_ptr<const EAPI> eapi(EAPIData::get_instance()->eapi_from_string(
_imp->repository->eapi_for_file(f / "make.defaults")));
@@ -250,7 +252,7 @@ ExheresProfile::_load_dir(const FSEntry & f)
_imp->profiles_with_parents->push_back(f);
}
-std::shared_ptr<const FSEntrySequence>
+std::shared_ptr<const FSPathSequence>
ExheresProfile::profiles_with_parents() const
{
return _imp->profiles_with_parents;
diff --git a/paludis/repositories/e/exheres_profile.hh b/paludis/repositories/e/exheres_profile.hh
index 9aff0e2..9b015c7 100644
--- a/paludis/repositories/e/exheres_profile.hh
+++ b/paludis/repositories/e/exheres_profile.hh
@@ -1,7 +1,7 @@
/* vim: set sw=4 sts=4 et foldmethod=syntax : */
/*
- * Copyright (c) 2005, 2006, 2007, 2008, 2009 Ciaran McCreesh
+ * Copyright (c) 2005, 2006, 2007, 2008, 2009, 2010 Ciaran McCreesh
*
* This file is part of the Paludis package manager. Paludis is free software;
* you can redistribute it and/or modify it under the terms of the GNU General
@@ -33,19 +33,19 @@ namespace paludis
public Profile
{
private:
- void _load_dir(const FSEntry &);
+ void _load_dir(const FSPath &);
public:
ExheresProfile(
const Environment * const, const ERepository * const, const RepositoryName &,
- const FSEntrySequence &,
+ const FSPathSequence &,
const std::string & arch_var_if_special,
const bool x
);
virtual ~ExheresProfile();
- virtual std::shared_ptr<const FSEntrySequence> profiles_with_parents() const
+ virtual std::shared_ptr<const FSPathSequence> profiles_with_parents() const
PALUDIS_ATTRIBUTE((warn_unused_result));
virtual bool use_masked(
diff --git a/paludis/repositories/e/exndbam_id.cc b/paludis/repositories/e/exndbam_id.cc
index be5f6bd..6cfca56 100644
--- a/paludis/repositories/e/exndbam_id.cc
+++ b/paludis/repositories/e/exndbam_id.cc
@@ -89,7 +89,7 @@ namespace
ExndbamID::ExndbamID(const QualifiedPackageName & q, const VersionSpec & v,
const Environment * const e,
const std::shared_ptr<const Repository> & r,
- const FSEntry & f, const NDBAM * const n) :
+ const FSPath & f, const NDBAM * const n) :
EInstalledRepositoryID(q, v, e, r, f),
_ndbam(n)
{
diff --git a/paludis/repositories/e/exndbam_id.hh b/paludis/repositories/e/exndbam_id.hh
index 19eddfc..54d1cfd 100644
--- a/paludis/repositories/e/exndbam_id.hh
+++ b/paludis/repositories/e/exndbam_id.hh
@@ -1,7 +1,7 @@
/* vim: set sw=4 sts=4 et foldmethod=syntax : */
/*
- * Copyright (c) 2008 Ciaran McCreesh
+ * Copyright (c) 2008, 2010 Ciaran McCreesh
*
* This file is part of the Paludis package manager. Paludis is free software;
* you can redistribute it and/or modify it under the terms of the GNU General
@@ -37,7 +37,7 @@ namespace paludis
ExndbamID(const QualifiedPackageName &, const VersionSpec &,
const Environment * const,
const std::shared_ptr<const Repository> &,
- const FSEntry & file,
+ const FSPath & file,
const NDBAM * const);
virtual std::string fs_location_raw_name() const;
diff --git a/paludis/repositories/e/exndbam_repository.cc b/paludis/repositories/e/exndbam_repository.cc
index 29b822f..68fbccd 100644
--- a/paludis/repositories/e/exndbam_repository.cc
+++ b/paludis/repositories/e/exndbam_repository.cc
@@ -31,11 +31,12 @@
#include <paludis/util/wrapped_forward_iterator.hh>
#include <paludis/util/cookie.hh>
#include <paludis/util/set.hh>
-#include <paludis/util/dir_iterator.hh>
#include <paludis/util/system.hh>
#include <paludis/util/make_named_values.hh>
#include <paludis/util/safe_ifstream.hh>
#include <paludis/util/make_null_shared_ptr.hh>
+#include <paludis/util/fs_stat.hh>
+#include <paludis/util/fs_iterator.hh>
#include <paludis/output_manager.hh>
#include <paludis/distribution.hh>
#include <paludis/environment.hh>
@@ -67,10 +68,10 @@ namespace paludis
ExndbamRepositoryParams params;
mutable NDBAM ndbam;
- std::shared_ptr<const MetadataValueKey<FSEntry> > location_key;
- std::shared_ptr<const MetadataValueKey<FSEntry> > root_key;
+ std::shared_ptr<const MetadataValueKey<FSPath> > location_key;
+ std::shared_ptr<const MetadataValueKey<FSPath> > root_key;
std::shared_ptr<const MetadataValueKey<std::string> > format_key;
- std::shared_ptr<const MetadataValueKey<FSEntry> > builddir_key;
+ std::shared_ptr<const MetadataValueKey<FSPath> > builddir_key;
std::shared_ptr<const MetadataValueKey<std::string> > eapi_when_unknown_key;
Imp(const ExndbamRepositoryParams & p) :
@@ -78,13 +79,13 @@ namespace paludis
ndbam(params.location(), &supported_exndbam, "exndbam-1",
EAPIData::get_instance()->eapi_from_string(
params.eapi_when_unknown())->supported()->version_spec_options()),
- location_key(std::make_shared<LiteralMetadataValueKey<FSEntry> >("location", "location",
+ location_key(std::make_shared<LiteralMetadataValueKey<FSPath> >("location", "location",
mkt_significant, params.location())),
- root_key(std::make_shared<LiteralMetadataValueKey<FSEntry> >("root", "root",
+ root_key(std::make_shared<LiteralMetadataValueKey<FSPath> >("root", "root",
mkt_normal, params.root())),
format_key(std::make_shared<LiteralMetadataValueKey<std::string> >("format", "format",
mkt_significant, "vdb")),
- builddir_key(std::make_shared<LiteralMetadataValueKey<FSEntry> >("builddir", "builddir",
+ builddir_key(std::make_shared<LiteralMetadataValueKey<FSPath> >("builddir", "builddir",
mkt_normal, params.builddir())),
eapi_when_unknown_key(std::make_shared<LiteralMetadataValueKey<std::string> >(
"eapi_when_unknown", "eapi_when_unknown", mkt_normal, params.eapi_when_unknown()))
@@ -272,13 +273,13 @@ ExndbamRepository::format_key() const
return _imp->format_key;
}
-const std::shared_ptr<const MetadataValueKey<FSEntry> >
+const std::shared_ptr<const MetadataValueKey<FSPath> >
ExndbamRepository::location_key() const
{
return _imp->location_key;
}
-const std::shared_ptr<const MetadataValueKey<FSEntry> >
+const std::shared_ptr<const MetadataValueKey<FSPath> >
ExndbamRepository::installed_root_key() const
{
return _imp->root_key;
@@ -298,10 +299,11 @@ ExndbamRepository::need_keys_added() const
namespace
{
std::pair<uid_t, gid_t>
- get_new_ids_or_minus_one(const Environment * const env, const FSEntry & f)
+ get_new_ids_or_minus_one(const Environment * const env, const FSPath & f)
{
- uid_t uid = (f.owner() == env->reduced_uid()) ? 0 : -1;
- gid_t gid = (f.group() == env->reduced_gid()) ? 0 : -1;
+ FSStat f_stat(f);
+ uid_t uid = (f_stat.owner() == env->reduced_uid()) ? 0 : -1;
+ gid_t gid = (f_stat.group() == env->reduced_gid()) ? 0 : -1;
return std::make_pair(uid, gid);
}
@@ -320,8 +322,8 @@ namespace
return o;
}
- bool ignore_merged(const std::shared_ptr<const FSEntrySet> & s,
- const FSEntry & f)
+ bool ignore_merged(const std::shared_ptr<const FSPathSet> & s,
+ const FSPath & f)
{
return s->end() != s->find(f);
}
@@ -351,25 +353,25 @@ ExndbamRepository::merge(const MergeParams & m)
}
}
- FSEntry uid_dir(_imp->params.location());
+ FSPath uid_dir(_imp->params.location());
if (if_same_name_id)
uid_dir = if_same_name_id->fs_location_key()->value().dirname();
else
{
std::string uid(stringify(m.package_id()->name().category()) + "---" + stringify(m.package_id()->name().package()));
uid_dir /= "data";
- uid_dir.mkdir();
+ uid_dir.mkdir(0755, { fspmkdo_ok_if_exists });
uid_dir /= uid;
- uid_dir.mkdir();
+ uid_dir.mkdir(0755, { fspmkdo_ok_if_exists });
}
- FSEntry target_ver_dir(uid_dir);
+ FSPath target_ver_dir(uid_dir);
target_ver_dir /= (stringify(m.package_id()->version()) + ":" + stringify(m.package_id()->slot_key()->value()) + ":" + cookie());
- if (target_ver_dir.exists())
+ if (target_ver_dir.stat().exists())
throw ActionFailedError("Temporary merge directory '" + stringify(target_ver_dir) + "' already exists, probably "
"due to a previous failed install. If it is safe to do so, please remove this directory and try again.");
- target_ver_dir.mkdir();
+ target_ver_dir.mkdir(0755, { });
WriteVDBEntryCommand write_vdb_entry_command(
make_named_values<WriteVDBEntryParams>(
@@ -416,7 +418,7 @@ ExndbamRepository::merge(const MergeParams & m)
n::fix_mtimes_before() = fix_mtimes ? m.build_start_time() : Timestamp(0, 0),
n::get_new_ids_or_minus_one() = std::bind(&get_new_ids_or_minus_one, _imp->params.environment(), std::placeholders::_1),
n::image() = m.image_dir(),
- n::install_under() = FSEntry("/"),
+ n::install_under() = FSPath("/"),
n::merged_entries() = m.merged_entries(),
n::options() = m.options(),
n::output_manager() = m.output_manager(),
@@ -428,9 +430,8 @@ ExndbamRepository::merge(const MergeParams & m)
if (! merger.check())
{
- for (DirIterator d(target_ver_dir, { dio_include_dotfiles }), d_end
- ; d != d_end ; ++d)
- FSEntry(*d).unlink();
+ for (FSIterator d(target_ver_dir, { fsio_inode_sort, fsio_include_dotfiles }), d_end ; d != d_end ; ++d)
+ d->unlink();
target_ver_dir.rmdir();
throw ActionFailedError("Not proceeding with install due to merge sanity check failing");
}
@@ -489,16 +490,16 @@ ExndbamRepository::perform_uninstall(
{
Context context("When uninstalling '" + stringify(*id) + (a.options.is_overwrite() ? "' for an overwrite:" : "':"));
- if (! _imp->params.root().is_directory())
+ if (! _imp->params.root().stat().is_directory())
throw ActionFailedError("Couldn't uninstall '" + stringify(*id) +
"' because root ('" + stringify(_imp->params.root()) + "') is not a directory");
std::shared_ptr<OutputManager> output_manager(a.options.make_output_manager()(a));
- FSEntry ver_dir(id->fs_location_key()->value().realpath());
- std::shared_ptr<FSEntry> load_env(std::make_shared<FSEntry>(ver_dir / "environment.bz2"));
+ FSPath ver_dir(id->fs_location_key()->value().realpath());
+ std::shared_ptr<FSPath> load_env(std::make_shared<FSPath>(ver_dir / "environment.bz2"));
- std::shared_ptr<FSEntrySequence> eclassdirs(std::make_shared<FSEntrySequence>());
+ auto eclassdirs(std::make_shared<FSPathSequence>());
eclassdirs->push_back(ver_dir);
EAPIPhases phases(id->eapi()->supported()->ebuild_phases()->ebuild_uninstall());
@@ -563,7 +564,7 @@ ExndbamRepository::perform_uninstall(
}
else
{
- FSEntry package_builddir(_imp->params.builddir() / (stringify(id->name().category()) + "-" + stringify(id->name().package()) + "-" + stringify(id->version()) + "-uninstall"));
+ FSPath package_builddir(_imp->params.builddir() / (stringify(id->name().category()) + "-" + stringify(id->name().package()) + "-" + stringify(id->version()) + "-uninstall"));
EbuildCommandParams params(
make_named_values<EbuildCommandParams>(
n::builddir() = _imp->params.builddir(),
@@ -574,7 +575,7 @@ ExndbamRepository::perform_uninstall(
n::ebuild_file() = ver_dir / (stringify(id->name().package()) + "-" + stringify(id->version()) + ".ebuild"),
n::eclassdirs() = eclassdirs,
n::environment() = _imp->params.environment(),
- n::exlibsdirs() = std::make_shared<FSEntrySequence>(),
+ n::exlibsdirs() = std::make_shared<FSPathSequence>(),
n::files_dir() = ver_dir,
n::maybe_output_manager() = output_manager,
n::package_builddir() = package_builddir,
@@ -599,14 +600,14 @@ ExndbamRepository::perform_uninstall(
}
}
- for (DirIterator d(ver_dir, { dio_include_dotfiles }), d_end ; d != d_end ; ++d)
- FSEntry(*d).unlink();
+ for (FSIterator d(ver_dir, { fsio_inode_sort, fsio_include_dotfiles }), d_end ; d != d_end ; ++d)
+ d->unlink();
ver_dir.rmdir();
_imp->ndbam.remove_entry(id->name(), ver_dir);
- FSEntry pkg_dir(ver_dir.dirname());
- if (DirIterator() == DirIterator(pkg_dir, { dio_include_dotfiles, dio_inode_sort, dio_first_only }))
+ FSPath pkg_dir(ver_dir.dirname());
+ if (FSIterator() == FSIterator(pkg_dir, { fsio_include_dotfiles, fsio_inode_sort, fsio_first_only }))
{
pkg_dir.rmdir();
diff --git a/paludis/repositories/e/exndbam_repository.hh b/paludis/repositories/e/exndbam_repository.hh
index d250cff..8937379 100644
--- a/paludis/repositories/e/exndbam_repository.hh
+++ b/paludis/repositories/e/exndbam_repository.hh
@@ -44,11 +44,11 @@ namespace paludis
struct ExndbamRepositoryParams
{
- NamedValue<n::builddir, FSEntry> builddir;
+ NamedValue<n::builddir, FSPath> builddir;
NamedValue<n::eapi_when_unknown, std::string> eapi_when_unknown;
NamedValue<n::environment, Environment *> environment;
- NamedValue<n::location, FSEntry> location;
- NamedValue<n::root, FSEntry> root;
+ NamedValue<n::location, FSPath> location;
+ NamedValue<n::root, FSPath> root;
};
}
@@ -113,8 +113,8 @@ namespace paludis
/* Keys */
virtual const std::shared_ptr<const MetadataValueKey<std::string> > format_key() const;
- virtual const std::shared_ptr<const MetadataValueKey<FSEntry> > location_key() const;
- virtual const std::shared_ptr<const MetadataValueKey<FSEntry> > installed_root_key() const;
+ virtual const std::shared_ptr<const MetadataValueKey<FSPath> > location_key() const;
+ virtual const std::shared_ptr<const MetadataValueKey<FSPath> > installed_root_key() const;
virtual const std::shared_ptr<const MetadataValueKey<std::string> > accept_keywords_key() const;
virtual const std::shared_ptr<const MetadataValueKey<std::string> > sync_host_key() const;
diff --git a/paludis/repositories/e/exndbam_repository_TEST.cc b/paludis/repositories/e/exndbam_repository_TEST.cc
index e4bf483..ed80468 100644
--- a/paludis/repositories/e/exndbam_repository_TEST.cc
+++ b/paludis/repositories/e/exndbam_repository_TEST.cc
@@ -25,6 +25,7 @@
#include <paludis/util/join.hh>
#include <paludis/util/make_named_values.hh>
#include <paludis/util/sequence.hh>
+#include <paludis/util/fs_path.hh>
#include <paludis/standard_output_manager.hh>
#include <paludis/action.hh>
#include <paludis/filtered_generator.hh>
@@ -77,8 +78,8 @@ namespace test_cases
TestEnvironment env;
std::shared_ptr<Map<std::string, std::string> > keys(std::make_shared<Map<std::string, std::string>>());
keys->insert("format", "exndbam");
- keys->insert("location", stringify(FSEntry::cwd() / "exndbam_repository_TEST_dir" / "repo1"));
- keys->insert("builddir", stringify(FSEntry::cwd() / "exndbam_repository_TEST_dir" / "build"));
+ keys->insert("location", stringify(FSPath::cwd() / "exndbam_repository_TEST_dir" / "repo1"));
+ keys->insert("builddir", stringify(FSPath::cwd() / "exndbam_repository_TEST_dir" / "build"));
std::shared_ptr<Repository> repo(ExndbamRepository::ExndbamRepository::repository_factory_create(&env,
std::bind(from_keys, keys, std::placeholders::_1)));
TEST_CHECK_STRINGIFY_EQUAL(repo->name(), "installed");
@@ -123,29 +124,29 @@ namespace test_cases
void run()
{
- TestEnvironment env(FSEntry("exndbam_repository_TEST_dir/root").realpath());
+ TestEnvironment env(FSPath("exndbam_repository_TEST_dir/root").realpath());
env.set_paludis_command("/bin/false");
std::shared_ptr<Map<std::string, std::string> > keys(std::make_shared<Map<std::string, std::string>>());
keys->insert("format", "e");
keys->insert("names_cache", "/var/empty");
- keys->insert("location", stringify(FSEntry::cwd() / "exndbam_repository_TEST_dir" / "postinsttest_src1"));
- keys->insert("profiles", stringify(FSEntry::cwd() / "exndbam_repository_TEST_dir" / "postinsttest_src1/profiles/profile"));
+ keys->insert("location", stringify(FSPath::cwd() / "exndbam_repository_TEST_dir" / "postinsttest_src1"));
+ keys->insert("profiles", stringify(FSPath::cwd() / "exndbam_repository_TEST_dir" / "postinsttest_src1/profiles/profile"));
keys->insert("layout", "traditional");
keys->insert("eapi_when_unknown", "0");
keys->insert("eapi_when_unspecified", "0");
keys->insert("profile_eapi", "0");
- keys->insert("distdir", stringify(FSEntry::cwd() / "exndbam_repository_TEST_dir" / "distdir"));
- keys->insert("builddir", stringify(FSEntry::cwd() / "exndbam_repository_TEST_dir" / "build"));
- keys->insert("root", stringify(FSEntry("exndbam_repository_TEST_dir/root").realpath()));
+ keys->insert("distdir", stringify(FSPath::cwd() / "exndbam_repository_TEST_dir" / "distdir"));
+ keys->insert("builddir", stringify(FSPath::cwd() / "exndbam_repository_TEST_dir" / "build"));
+ keys->insert("root", stringify(FSPath("exndbam_repository_TEST_dir/root").realpath()));
std::shared_ptr<Repository> repo1(ERepository::repository_factory_create(&env,
std::bind(from_keys, keys, std::placeholders::_1)));
env.package_database()->add_repository(1, repo1);
keys = std::make_shared<Map<std::string, std::string>>();
keys->insert("format", "exndbam");
- keys->insert("location", stringify(FSEntry::cwd() / "exndbam_repository_TEST_dir" / "postinsttest"));
- keys->insert("builddir", stringify(FSEntry::cwd() / "exndbam_repository_TEST_dir" / "build"));
- keys->insert("root", stringify(FSEntry("exndbam_repository_TEST_dir/root").realpath()));
+ keys->insert("location", stringify(FSPath::cwd() / "exndbam_repository_TEST_dir" / "postinsttest"));
+ keys->insert("builddir", stringify(FSPath::cwd() / "exndbam_repository_TEST_dir" / "build"));
+ keys->insert("root", stringify(FSPath("exndbam_repository_TEST_dir/root").realpath()));
std::shared_ptr<Repository> exndbam_repo(ExndbamRepository::ExndbamRepository::repository_factory_create(&env,
std::bind(from_keys, keys, std::placeholders::_1)));
env.package_database()->add_repository(0, exndbam_repo);
diff --git a/paludis/repositories/e/extra_distribution_data.cc b/paludis/repositories/e/extra_distribution_data.cc
index 4cfd6ec..d0a281b 100644
--- a/paludis/repositories/e/extra_distribution_data.cc
+++ b/paludis/repositories/e/extra_distribution_data.cc
@@ -60,7 +60,7 @@ namespace paludis
n::default_profile_layout() = k->get("default_profile_layout"),
n::default_provides_cache() = k->get("default_provides_cache"),
n::default_write_cache() = k->get("default_write_cache"),
- n::news_directory() = FSEntry(k->get("news_directory")),
+ n::news_directory() = FSPath(k->get("news_directory")),
n::qa_category_dir_checks() = make_set(k->get("qa_category_dir_checks")),
n::qa_eclass_file_contents_checks() = make_set(k->get("qa_eclass_file_contents_checks")),
n::qa_package_dir_checks() = make_set(k->get("qa_package_dir_checks")),
diff --git a/paludis/repositories/e/extra_distribution_data.hh b/paludis/repositories/e/extra_distribution_data.hh
index 906d397..7188635 100644
--- a/paludis/repositories/e/extra_distribution_data.hh
+++ b/paludis/repositories/e/extra_distribution_data.hh
@@ -21,7 +21,7 @@
#define PALUDIS_GUARD_PALUDIS_PALUDIS_REPOSITORIES_E_EXTRA_DISTRIBUTION_DATA_HH 1
#include <paludis/distribution-fwd.hh>
-#include <paludis/util/fs_entry.hh>
+#include <paludis/util/fs_path.hh>
#include <paludis/util/named_value.hh>
#include <paludis/util/set.hh>
#include <memory>
@@ -64,7 +64,7 @@ namespace paludis
NamedValue<n::default_profile_layout, std::string> default_profile_layout;
NamedValue<n::default_provides_cache, std::string> default_provides_cache;
NamedValue<n::default_write_cache, std::string> default_write_cache;
- NamedValue<n::news_directory, FSEntry> news_directory;
+ NamedValue<n::news_directory, FSPath> news_directory;
NamedValue<n::qa_category_dir_checks, std::shared_ptr<const Set<std::string> > > qa_category_dir_checks;
NamedValue<n::qa_eclass_file_contents_checks, std::shared_ptr<const Set<std::string> > > qa_eclass_file_contents_checks;
NamedValue<n::qa_package_dir_checks, std::shared_ptr<const Set<std::string> > > qa_package_dir_checks;
diff --git a/paludis/repositories/e/fetch_visitor.cc b/paludis/repositories/e/fetch_visitor.cc
index 833dde1..68031c1 100644
--- a/paludis/repositories/e/fetch_visitor.cc
+++ b/paludis/repositories/e/fetch_visitor.cc
@@ -31,12 +31,13 @@
#include <paludis/util/system.hh>
#include <paludis/util/process.hh>
#include <paludis/util/pimp-impl.hh>
-#include <paludis/util/fs_entry.hh>
#include <paludis/util/log.hh>
#include <paludis/util/join.hh>
#include <paludis/util/stringify.hh>
#include <paludis/util/indirect_iterator-impl.hh>
#include <paludis/util/accept_visitor.hh>
+#include <paludis/util/fs_path.hh>
+#include <paludis/util/fs_stat.hh>
#include <paludis/output_manager.hh>
#include <algorithm>
#include <list>
@@ -52,7 +53,7 @@ namespace paludis
const Environment * const env;
const std::shared_ptr<const PackageID> id;
const EAPI & eapi;
- const FSEntry distdir;
+ const FSPath distdir;
const bool fetch_unneeded;
const bool userpriv;
const std::string mirrors_name;
@@ -67,7 +68,7 @@ namespace paludis
const Environment * const e,
const std::shared_ptr<const PackageID> & i,
const EAPI & p,
- const FSEntry & d,
+ const FSPath & d,
const bool f,
const bool u,
const std::string & m,
@@ -96,7 +97,7 @@ FetchVisitor::FetchVisitor(
const Environment * const e,
const std::shared_ptr<const PackageID> & i,
const EAPI & p,
- const FSEntry & d,
+ const FSPath & d,
const bool f,
const bool u,
const std::string & m,
@@ -141,7 +142,7 @@ FetchVisitor::visit(const FetchableURISpecTree::NodeType<URILabelsDepSpec>::Type
namespace
{
- FSEntry make_fetcher(const FSEntry & d, const std::string & x)
+ FSPath make_fetcher(const FSPath & d, const std::string & x)
{
std::string lower_x;
std::transform(x.begin(), x.end(), std::back_inserter(lower_x), &::tolower);
@@ -165,11 +166,12 @@ FetchVisitor::visit(const FetchableURISpecTree::NodeType<FetchableURIDepSpec>::T
{
Context local_context("When fetching URI '" + stringify(i->first) + "' to '" + stringify(i->second) + ":");
- FSEntry destination(_imp->distdir / node.spec()->filename());
+ FSPath destination(_imp->distdir / node.spec()->filename());
- if (destination.exists())
+ FSStat destination_stat(destination);
+ if (destination_stat.exists())
{
- if (0 == destination.file_size())
+ if (0 == destination_stat.file_size())
destination.unlink();
else
return;
@@ -187,11 +189,11 @@ FetchVisitor::visit(const FetchableURISpecTree::NodeType<FetchableURIDepSpec>::T
continue;
}
- const std::shared_ptr<const FSEntrySequence> fetch_dirs(_imp->env->fetchers_dirs());
+ const std::shared_ptr<const FSPathSequence> fetch_dirs(_imp->env->fetchers_dirs());
bool found(false);
- for (FSEntrySequence::ConstIterator d(fetch_dirs->begin()), d_end(fetch_dirs->end()) ;
+ for (FSPathSequence::ConstIterator d(fetch_dirs->begin()), d_end(fetch_dirs->end()) ;
d != d_end ; ++d)
- if (make_fetcher(*d, protocol).exists())
+ if (make_fetcher(*d, protocol).stat().exists())
{
found = true;
@@ -200,10 +202,10 @@ FetchVisitor::visit(const FetchableURISpecTree::NodeType<FetchableURIDepSpec>::T
if (_imp->userpriv)
fetch_process.setuid_setgid(_imp->env->reduced_uid(), _imp->env->reduced_gid());
- std::shared_ptr<const FSEntrySequence> syncers_dirs(_imp->env->syncers_dirs());
- std::shared_ptr<const FSEntrySequence> bashrc_files(_imp->env->bashrc_files());
- std::shared_ptr<const FSEntrySequence> fetchers_dirs(_imp->env->fetchers_dirs());
- std::shared_ptr<const FSEntrySequence> hook_dirs(_imp->env->hook_dirs());
+ std::shared_ptr<const FSPathSequence> syncers_dirs(_imp->env->syncers_dirs());
+ std::shared_ptr<const FSPathSequence> bashrc_files(_imp->env->bashrc_files());
+ std::shared_ptr<const FSPathSequence> fetchers_dirs(_imp->env->fetchers_dirs());
+ std::shared_ptr<const FSPathSequence> hook_dirs(_imp->env->hook_dirs());
fetch_process
.setenv("P", stringify(_imp->id->name().package()) + "-" +
diff --git a/paludis/repositories/e/fetch_visitor.hh b/paludis/repositories/e/fetch_visitor.hh
index 81fcc19..9912ba0 100644
--- a/paludis/repositories/e/fetch_visitor.hh
+++ b/paludis/repositories/e/fetch_visitor.hh
@@ -1,7 +1,7 @@
/* vim: set sw=4 sts=4 et foldmethod=syntax : */
/*
- * Copyright (c) 2007, 2008, 2009 Ciaran McCreesh
+ * Copyright (c) 2007, 2008, 2009, 2010 Ciaran McCreesh
*
* This file is part of the Paludis package manager. Paludis is free software;
* you can redistribute it and/or modify it under the terms of the GNU General
@@ -23,7 +23,6 @@
#include <paludis/repositories/e/eapi-fwd.hh>
#include <paludis/util/attributes.hh>
#include <paludis/util/pimp.hh>
-#include <paludis/util/fs_entry-fwd.hh>
#include <paludis/output_manager-fwd.hh>
#include <paludis/dep_spec.hh>
#include <paludis/spec_tree-fwd.hh>
@@ -46,7 +45,7 @@ namespace paludis
const Environment * const,
const std::shared_ptr<const PackageID> &,
const EAPI & eapi,
- const FSEntry & distdir,
+ const FSPath & distdir,
const bool fetch_unneeded,
const bool userpriv,
const std::string & mirrors_name,
diff --git a/paludis/repositories/e/fetch_visitor_TEST.cc b/paludis/repositories/e/fetch_visitor_TEST.cc
index 13b359f..4c9d523 100644
--- a/paludis/repositories/e/fetch_visitor_TEST.cc
+++ b/paludis/repositories/e/fetch_visitor_TEST.cc
@@ -25,6 +25,7 @@
#include <paludis/environments/test/test_environment.hh>
#include <paludis/util/sequence.hh>
#include <paludis/util/make_named_values.hh>
+#include <paludis/util/fs_stat.hh>
#include <paludis/standard_output_manager.hh>
#include <paludis/util/safe_ifstream.hh>
#include <paludis/package_database.hh>
@@ -71,20 +72,20 @@ namespace test_cases
env.package_database()->add_repository(1, repo);
std::shared_ptr<const PackageID> id(repo->add_version("cat", "pkg", "1"));
- TEST_CHECK(FSEntry("fetch_visitor_TEST_dir/in/input1").exists());
- TEST_CHECK(! FSEntry("fetch_visitor_TEST_dir/out/input1").exists());
+ TEST_CHECK(FSPath("fetch_visitor_TEST_dir/in/input1").stat().exists());
+ TEST_CHECK(! FSPath("fetch_visitor_TEST_dir/out/input1").stat().exists());
const std::shared_ptr<const EAPI> eapi(EAPIData::get_instance()->eapi_from_string("exheres-0"));
FetchVisitor v(&env, *env[selection::RequireExactlyOne(
generator::Matches(parse_user_package_dep_spec("=cat/pkg-1",
&env, { }), { }))]->begin(),
- *eapi, FSEntry("fetch_visitor_TEST_dir/out"),
+ *eapi, FSPath("fetch_visitor_TEST_dir/out"),
false, false, "test", std::make_shared<URIListedThenMirrorsLabel>("listed-then-mirrors"), false,
std::make_shared<StandardOutputManager>(), get_mirrors_fn);
- parse_fetchable_uri("file:///" + stringify(FSEntry("fetch_visitor_TEST_dir/in/input1").realpath()), &env, id, *eapi)->top()->accept(v);
+ parse_fetchable_uri("file:///" + stringify(FSPath("fetch_visitor_TEST_dir/in/input1").realpath()), &env, id, *eapi)->top()->accept(v);
- TEST_CHECK(FSEntry("fetch_visitor_TEST_dir/out/input1").is_regular_file());
- SafeIFStream f(FSEntry("fetch_visitor_TEST_dir/out/input1"));
+ TEST_CHECK(FSPath("fetch_visitor_TEST_dir/out/input1").stat().is_regular_file());
+ SafeIFStream f(FSPath("fetch_visitor_TEST_dir/out/input1"));
TEST_CHECK(f);
std::string s((std::istreambuf_iterator<char>(f)), std::istreambuf_iterator<char>());
TEST_CHECK_EQUAL(s, "contents of one\n");
diff --git a/paludis/repositories/e/fix_locked_dependencies.cc b/paludis/repositories/e/fix_locked_dependencies.cc
index 072101f..f677ce9 100644
--- a/paludis/repositories/e/fix_locked_dependencies.cc
+++ b/paludis/repositories/e/fix_locked_dependencies.cc
@@ -22,7 +22,6 @@
#include <paludis/util/simple_visitor_cast.hh>
#include <paludis/util/exception.hh>
#include <paludis/util/stringify.hh>
-#include <paludis/util/fs_entry.hh>
#include <paludis/util/options.hh>
#include <paludis/util/indirect_iterator-impl.hh>
#include <paludis/util/accept_visitor.hh>
@@ -109,7 +108,7 @@ namespace
break;
std::shared_ptr<const PackageIDSequence> matches((*env)[selection::AllVersionsSorted(
- generator::Matches(*node.spec(), { }) | filter::InstalledAtRoot(FSEntry("/")))]);
+ generator::Matches(*node.spec(), { }) | filter::InstalledAtSlash())]);
if (matches->empty())
break;
diff --git a/paludis/repositories/e/info_metadata_key.cc b/paludis/repositories/e/info_metadata_key.cc
index 46984b1..1e78bc5 100644
--- a/paludis/repositories/e/info_metadata_key.cc
+++ b/paludis/repositories/e/info_metadata_key.cc
@@ -20,8 +20,8 @@
#include <paludis/repositories/e/info_metadata_key.hh>
#include <paludis/repositories/e/eapi.hh>
#include <paludis/repositories/e/e_repository.hh>
+
#include <paludis/util/pimp-impl.hh>
-#include <paludis/util/fs_entry.hh>
#include <paludis/util/mutex.hh>
#include <paludis/util/config_file.hh>
#include <paludis/util/stringify.hh>
@@ -31,6 +31,8 @@
#include <paludis/util/sequence.hh>
#include <paludis/util/indirect_iterator-impl.hh>
#include <paludis/util/join.hh>
+#include <paludis/util/fs_stat.hh>
+
#include <paludis/literal_metadata_key.hh>
#include <paludis/selection.hh>
#include <paludis/generator.hh>
@@ -40,6 +42,7 @@
#include <paludis/environment.hh>
#include <paludis/package_id.hh>
#include <paludis/formatter.hh>
+
#include <map>
#include <algorithm>
#include <functional>
@@ -52,12 +55,12 @@ namespace paludis
template <>
struct Imp<InfoVarsMetadataKey>
{
- const std::shared_ptr<const FSEntrySequence> locations;
+ const std::shared_ptr<const FSPathSequence> locations;
mutable Mutex mutex;
mutable std::shared_ptr<Set<std::string> > value;
- Imp(const std::shared_ptr<const FSEntrySequence> & l) :
+ Imp(const std::shared_ptr<const FSPathSequence> & l) :
locations(l)
{
}
@@ -67,13 +70,13 @@ namespace paludis
struct Imp<InfoPkgsMetadataKey>
{
const Environment * const env;
- const std::shared_ptr<const FSEntrySequence> locations;
+ const std::shared_ptr<const FSPathSequence> locations;
const ERepository * const e_repository;
mutable Mutex mutex;
mutable bool added;
- Imp(const Environment * const e, const std::shared_ptr<const FSEntrySequence> & l,
+ Imp(const Environment * const e, const std::shared_ptr<const FSPathSequence> & l,
const ERepository * const r) :
env(e),
locations(l),
@@ -84,7 +87,7 @@ namespace paludis
};
}
-InfoVarsMetadataKey::InfoVarsMetadataKey(const std::shared_ptr<const FSEntrySequence> & f) :
+InfoVarsMetadataKey::InfoVarsMetadataKey(const std::shared_ptr<const FSPathSequence> & f) :
Pimp<InfoVarsMetadataKey>(f)
{
}
@@ -102,12 +105,12 @@ InfoVarsMetadataKey::value() const
return _imp->value;
_imp->value = std::make_shared<Set<std::string>>();
- for (FSEntrySequence::ConstIterator location(_imp->locations->begin()), location_end(_imp->locations->end()) ;
+ for (FSPathSequence::ConstIterator location(_imp->locations->begin()), location_end(_imp->locations->end()) ;
location != location_end ; ++location)
{
Context context("When loading info variables file '" + stringify(*location) + "':");
- if (location->is_regular_file_or_symlink_to_regular_file())
+ if (location->stat().is_regular_file_or_symlink_to_regular_file())
{
LineConfigFile f(*location, { lcfo_disallow_continuations });
for (LineConfigFile::ConstIterator line(f.begin()), line_end(f.end()) ;
@@ -138,7 +141,7 @@ InfoVarsMetadataKey::type() const
}
InfoPkgsMetadataKey::InfoPkgsMetadataKey(const Environment * const e,
- const std::shared_ptr<const FSEntrySequence> & f,
+ const std::shared_ptr<const FSPathSequence> & f,
const ERepository * const r) :
Pimp<InfoPkgsMetadataKey>(e, f, r),
_imp(Pimp<InfoPkgsMetadataKey>::_imp)
@@ -157,13 +160,13 @@ InfoPkgsMetadataKey::need_keys_added() const
return;
std::map<std::string, std::string> info_pkgs;
- for (FSEntrySequence::ConstIterator location(_imp->locations->begin()), location_end(_imp->locations->end()) ;
+ for (FSPathSequence::ConstIterator location(_imp->locations->begin()), location_end(_imp->locations->end()) ;
location != location_end ; ++location)
{
Context context("When loading info packages file '" + stringify(*location) + "':");
_imp->added = true;
- if (location->is_regular_file_or_symlink_to_regular_file())
+ if (location->stat().is_regular_file_or_symlink_to_regular_file())
{
std::string eapi(_imp->e_repository->eapi_for_file(*location));
LineConfigFile p(*location, { lcfo_disallow_continuations });
diff --git a/paludis/repositories/e/info_metadata_key.hh b/paludis/repositories/e/info_metadata_key.hh
index 71b207c..e4db751 100644
--- a/paludis/repositories/e/info_metadata_key.hh
+++ b/paludis/repositories/e/info_metadata_key.hh
@@ -5,7 +5,6 @@
#include <paludis/metadata_key.hh>
#include <paludis/environment-fwd.hh>
-#include <paludis/util/fs_entry-fwd.hh>
#include <paludis/util/set.hh>
#include <paludis/util/pimp.hh>
@@ -27,7 +26,7 @@ namespace paludis
public:
InfoPkgsMetadataKey(const Environment * const e,
- const std::shared_ptr<const FSEntrySequence> & f,
+ const std::shared_ptr<const FSPathSequence> & f,
const ERepository * const);
~InfoPkgsMetadataKey();
@@ -41,7 +40,7 @@ namespace paludis
private Pimp<InfoVarsMetadataKey>
{
public:
- InfoVarsMetadataKey(const std::shared_ptr<const FSEntrySequence> &);
+ InfoVarsMetadataKey(const std::shared_ptr<const FSPathSequence> &);
~InfoVarsMetadataKey();
const std::shared_ptr<const Set<std::string> > value() const;
diff --git a/paludis/repositories/e/layout.cc b/paludis/repositories/e/layout.cc
index 539f540..0804893 100644
--- a/paludis/repositories/e/layout.cc
+++ b/paludis/repositories/e/layout.cc
@@ -21,17 +21,17 @@
#include <paludis/repositories/e/layout.hh>
#include <paludis/repositories/e/traditional_layout.hh>
#include <paludis/repositories/e/exheres_layout.hh>
-#include <paludis/util/fs_entry.hh>
#include <paludis/util/singleton-impl.hh>
#include <paludis/util/map-impl.hh>
#include <paludis/util/wrapped_forward_iterator-impl.hh>
+#include <paludis/util/fs_path.hh>
using namespace paludis;
using namespace paludis::erepository;
template class Singleton<LayoutFactory>;
-Layout::Layout(const std::shared_ptr<const FSEntrySequence> & l) :
+Layout::Layout(const std::shared_ptr<const FSPathSequence> & l) :
_master_repositories_locations(l)
{
}
@@ -40,24 +40,24 @@ Layout::~Layout()
{
}
-const std::shared_ptr<const FSEntrySequence>
+const std::shared_ptr<const FSPathSequence>
Layout::master_repositories_locations() const
{
return _master_repositories_locations;
}
-FSEntry
+FSPath
Layout::sync_filter_file() const
{
- return FSEntry("/dev/null");
+ return FSPath("/dev/null");
}
namespace
{
template <typename T_>
std::shared_ptr<Layout>
- make_layout(const ERepository * const n, const FSEntry & b,
- std::shared_ptr<const FSEntrySequence> f)
+ make_layout(const ERepository * const n, const FSPath & b,
+ std::shared_ptr<const FSPathSequence> f)
{
return std::make_shared<T_>(n, b, f);
}
@@ -71,8 +71,8 @@ const std::shared_ptr<Layout>
LayoutFactory::create(
const std::string & s,
const ERepository * const r,
- const FSEntry & f,
- const std::shared_ptr<const FSEntrySequence> & ff) const
+ const FSPath & f,
+ const std::shared_ptr<const FSPathSequence> & ff) const
{
if (s == "traditional")
return make_layout<TraditionalLayout>(r, f, ff);
@@ -81,6 +81,6 @@ LayoutFactory::create(
throw ConfigurationError("Unrecognised layout '" + s + "'");
}
-template class Map<FSEntry, std::string>;
-template class WrappedForwardIterator<Map<FSEntry, std::string>::ConstIteratorTag, const std::pair<const FSEntry, std::string> >;
+template class Map<FSPath, std::string, FSPathComparator>;
+template class WrappedForwardIterator<Map<FSPath, std::string, FSPathComparator>::ConstIteratorTag, const std::pair<const FSPath, std::string> >;
diff --git a/paludis/repositories/e/layout.hh b/paludis/repositories/e/layout.hh
index bcf4f05..54388c4 100644
--- a/paludis/repositories/e/layout.hh
+++ b/paludis/repositories/e/layout.hh
@@ -25,7 +25,7 @@
#include <paludis/version_spec-fwd.hh>
#include <paludis/package_id-fwd.hh>
#include <paludis/util/attributes.hh>
-#include <paludis/util/fs_entry-fwd.hh>
+#include <paludis/util/fs_path-fwd.hh>
#include <paludis/util/exception.hh>
#include <paludis/util/map-fwd.hh>
#include <paludis/util/singleton.hh>
@@ -48,13 +48,13 @@ namespace paludis
class PALUDIS_VISIBLE Layout
{
private:
- const std::shared_ptr<const FSEntrySequence> _master_repositories_locations;
+ const std::shared_ptr<const FSPathSequence> _master_repositories_locations;
protected:
///\name Basic operations
///\{
- Layout(const std::shared_ptr<const FSEntrySequence> & master_repositories_locations);
+ Layout(const std::shared_ptr<const FSPathSequence> & master_repositories_locations);
///\}
@@ -69,7 +69,7 @@ namespace paludis
///\name Configuration information
///\{
- const std::shared_ptr<const FSEntrySequence> master_repositories_locations() const;
+ const std::shared_ptr<const FSPathSequence> master_repositories_locations() const;
///\}
@@ -82,7 +82,7 @@ namespace paludis
virtual bool has_package_named(const QualifiedPackageName &) const
PALUDIS_ATTRIBUTE((warn_unused_result)) = 0;
- virtual FSEntry categories_file() const
+ virtual FSPath categories_file() const
PALUDIS_ATTRIBUTE((warn_unused_result)) = 0;
virtual std::shared_ptr<const CategoryNamePartSet> category_names() const
@@ -96,65 +96,65 @@ namespace paludis
const QualifiedPackageName &) const
PALUDIS_ATTRIBUTE((warn_unused_result)) = 0;
- virtual const std::shared_ptr<const FSEntrySequence> info_packages_files() const
+ virtual const std::shared_ptr<const FSPathSequence> info_packages_files() const
PALUDIS_ATTRIBUTE((warn_unused_result)) = 0;
- virtual const std::shared_ptr<const FSEntrySequence> info_variables_files() const
+ virtual const std::shared_ptr<const FSPathSequence> info_variables_files() const
PALUDIS_ATTRIBUTE((warn_unused_result)) = 0;
- virtual FSEntry package_directory(const QualifiedPackageName &) const
+ virtual FSPath package_directory(const QualifiedPackageName &) const
PALUDIS_ATTRIBUTE((warn_unused_result)) = 0;
- virtual FSEntry category_directory(const CategoryNamePart &) const
+ virtual FSPath category_directory(const CategoryNamePart &) const
PALUDIS_ATTRIBUTE((warn_unused_result)) = 0;
- virtual FSEntry binary_ebuild_location(const QualifiedPackageName &, const VersionSpec &,
+ virtual FSPath binary_ebuild_location(const QualifiedPackageName &, const VersionSpec &,
const std::string & eapi) const
PALUDIS_ATTRIBUTE((warn_unused_result)) = 0;
- virtual std::shared_ptr<const FSEntrySequence> arch_list_files() const
+ virtual std::shared_ptr<const FSPathSequence> arch_list_files() const
PALUDIS_ATTRIBUTE((warn_unused_result)) = 0;
- virtual std::shared_ptr<const FSEntrySequence> repository_mask_files() const
+ virtual std::shared_ptr<const FSPathSequence> repository_mask_files() const
PALUDIS_ATTRIBUTE((warn_unused_result)) = 0;
- virtual std::shared_ptr<const FSEntrySequence> profiles_desc_files() const
+ virtual std::shared_ptr<const FSPathSequence> profiles_desc_files() const
PALUDIS_ATTRIBUTE((warn_unused_result)) = 0;
- virtual std::shared_ptr<const FSEntrySequence> mirror_files() const
+ virtual std::shared_ptr<const FSPathSequence> mirror_files() const
PALUDIS_ATTRIBUTE((warn_unused_result)) = 0;
virtual std::shared_ptr<const UseDescFileInfoSequence> use_desc_files() const
PALUDIS_ATTRIBUTE((warn_unused_result)) = 0;
- virtual FSEntry profiles_base_dir() const
+ virtual FSPath profiles_base_dir() const
PALUDIS_ATTRIBUTE((warn_unused_result)) = 0;
- virtual std::shared_ptr<const FSEntrySequence> exlibsdirs(const QualifiedPackageName &) const
+ virtual std::shared_ptr<const FSPathSequence> exlibsdirs(const QualifiedPackageName &) const
PALUDIS_ATTRIBUTE((warn_unused_result)) = 0;
- virtual std::shared_ptr<const FSEntrySequence> exlibsdirs_global() const
+ virtual std::shared_ptr<const FSPathSequence> exlibsdirs_global() const
PALUDIS_ATTRIBUTE((warn_unused_result)) = 0;
- virtual std::shared_ptr<const FSEntrySequence> exlibsdirs_category(const CategoryNamePart &) const
+ virtual std::shared_ptr<const FSPathSequence> exlibsdirs_category(const CategoryNamePart &) const
PALUDIS_ATTRIBUTE((warn_unused_result)) = 0;
- virtual std::shared_ptr<const FSEntrySequence> exlibsdirs_package(const QualifiedPackageName &) const
+ virtual std::shared_ptr<const FSPathSequence> exlibsdirs_package(const QualifiedPackageName &) const
PALUDIS_ATTRIBUTE((warn_unused_result)) = 0;
- virtual std::shared_ptr<const FSEntrySequence> licenses_dirs() const
+ virtual std::shared_ptr<const FSPathSequence> licenses_dirs() const
PALUDIS_ATTRIBUTE((warn_unused_result)) = 0;
- virtual std::shared_ptr<Map<FSEntry, std::string> > manifest_files(const QualifiedPackageName &) const
+ virtual std::shared_ptr<Map<FSPath, std::string, FSPathComparator> > manifest_files(const QualifiedPackageName &) const
PALUDIS_ATTRIBUTE((warn_unused_result)) = 0;
- virtual std::shared_ptr<MetadataValueKey<FSEntry> > accounts_repository_data_location_key() const
+ virtual std::shared_ptr<MetadataValueKey<FSPath> > accounts_repository_data_location_key() const
PALUDIS_ATTRIBUTE((warn_unused_result)) = 0;
- virtual std::shared_ptr<MetadataValueKey<FSEntry> > e_updates_location_key() const
+ virtual std::shared_ptr<MetadataValueKey<FSPath> > e_updates_location_key() const
PALUDIS_ATTRIBUTE((warn_unused_result)) = 0;
- virtual FSEntry sync_filter_file() const;
+ virtual FSPath sync_filter_file() const;
virtual void invalidate_masks() = 0;
@@ -178,8 +178,8 @@ namespace paludis
const std::shared_ptr<Layout> create(
const std::string &,
const ERepository * const,
- const FSEntry &,
- const std::shared_ptr<const FSEntrySequence> &)
+ const FSPath &,
+ const std::shared_ptr<const FSPathSequence> &)
const PALUDIS_ATTRIBUTE((warn_unused_result));
};
}
diff --git a/paludis/repositories/e/manifest2_reader.cc b/paludis/repositories/e/manifest2_reader.cc
index 3041aa7..65f6d04 100644
--- a/paludis/repositories/e/manifest2_reader.cc
+++ b/paludis/repositories/e/manifest2_reader.cc
@@ -20,7 +20,6 @@
#include <paludis/repositories/e/manifest2_reader.hh>
#include <paludis/util/config_file.hh>
#include <paludis/util/destringify.hh>
-#include <paludis/util/fs_entry.hh>
#include <paludis/util/log.hh>
#include <paludis/util/options.hh>
#include <paludis/util/create_iterator-impl.hh>
@@ -29,6 +28,8 @@
#include <paludis/util/pimp-impl.hh>
#include <paludis/util/member_iterator-impl.hh>
#include <paludis/util/make_named_values.hh>
+#include <paludis/util/fs_path.hh>
+#include <paludis/util/fs_stat.hh>
#include <list>
#include <map>
@@ -43,10 +44,10 @@ namespace paludis
template <>
struct Imp<Manifest2Reader>
{
- FSEntry manifest;
+ FSPath manifest;
Entries entries;
- Imp(const FSEntry & f) :
+ Imp(const FSPath & f) :
manifest(f)
{
}
@@ -64,10 +65,10 @@ Manifest2Error::Manifest2Error(const std::string & msg) throw () :
{
}
-Manifest2Reader::Manifest2Reader(const FSEntry & f) :
+Manifest2Reader::Manifest2Reader(const FSPath & f) :
Pimp<Manifest2Reader>(f)
{
- if (! f.exists())
+ if (! f.stat().exists())
return;
LineConfigFile lines(_imp->manifest, { });
diff --git a/paludis/repositories/e/manifest2_reader.hh b/paludis/repositories/e/manifest2_reader.hh
index afd7d13..f228f14 100644
--- a/paludis/repositories/e/manifest2_reader.hh
+++ b/paludis/repositories/e/manifest2_reader.hh
@@ -21,7 +21,6 @@
#define PALUDIS_GUARD_PALUDIS_MANIFEST2_READER_HH 1
#include <paludis/action.hh>
-#include <paludis/util/fs_entry-fwd.hh>
#include <paludis/util/stringify.hh>
#include <paludis/util/wrapped_forward_iterator-fwd.hh>
#include <string>
@@ -83,7 +82,7 @@ namespace paludis
public:
///\name Basic operations
- Manifest2Reader(const FSEntry & f);
+ Manifest2Reader(const FSPath & f);
~Manifest2Reader();
///}
diff --git a/paludis/repositories/e/memoised_hashes.cc b/paludis/repositories/e/memoised_hashes.cc
index 00552c1..8a75e36 100644
--- a/paludis/repositories/e/memoised_hashes.cc
+++ b/paludis/repositories/e/memoised_hashes.cc
@@ -23,12 +23,13 @@
#include <paludis/util/pimp-impl.hh>
#include <paludis/util/singleton-impl.hh>
#include <paludis/util/safe_ifstream.hh>
-#include <paludis/util/fs_entry.hh>
#include <paludis/util/rmd160.hh>
#include <paludis/util/sha1.hh>
#include <paludis/util/sha256.hh>
#include <paludis/util/md5.hh>
#include <paludis/util/timestamp.hh>
+#include <paludis/util/fs_path.hh>
+#include <paludis/util/fs_stat.hh>
#include <map>
@@ -96,10 +97,10 @@ namespace
template <typename H_>
const std::string
-MemoisedHashes::get(const FSEntry & file, SafeIFStream & stream) const
+MemoisedHashes::get(const FSPath & file, SafeIFStream & stream) const
{
std::pair<std::string, int> key(stringify(file), HashIDs<H_>::id);
- Timestamp mtime(file.mtim());
+ Timestamp mtime(file.stat().mtim());
Lock l(_imp->mutex);
@@ -121,10 +122,10 @@ MemoisedHashes::get(const FSEntry & file, SafeIFStream & stream) const
return i->second.second;
}
-template const std::string MemoisedHashes::get<RMD160>(const FSEntry &, SafeIFStream &) const;
-template const std::string MemoisedHashes::get<SHA1>(const FSEntry &, SafeIFStream &) const;
-template const std::string MemoisedHashes::get<SHA256>(const FSEntry &, SafeIFStream &) const;
-template const std::string MemoisedHashes::get<MD5>(const FSEntry &, SafeIFStream &) const;
+template const std::string MemoisedHashes::get<RMD160>(const FSPath &, SafeIFStream &) const;
+template const std::string MemoisedHashes::get<SHA1>(const FSPath &, SafeIFStream &) const;
+template const std::string MemoisedHashes::get<SHA256>(const FSPath &, SafeIFStream &) const;
+template const std::string MemoisedHashes::get<MD5>(const FSPath &, SafeIFStream &) const;
template class Pimp<MemoisedHashes>;
template class Singleton<MemoisedHashes>;
diff --git a/paludis/repositories/e/memoised_hashes.hh b/paludis/repositories/e/memoised_hashes.hh
index a20f0fe..5227aef 100644
--- a/paludis/repositories/e/memoised_hashes.hh
+++ b/paludis/repositories/e/memoised_hashes.hh
@@ -22,7 +22,7 @@
#include <paludis/util/pimp.hh>
#include <paludis/util/singleton.hh>
-#include <paludis/util/fs_entry-fwd.hh>
+#include <paludis/util/fs_path-fwd.hh>
#include <paludis/util/safe_ifstream-fwd.hh>
namespace paludis
@@ -37,7 +37,7 @@ namespace paludis
public:
template <typename H_>
- const std::string get(const FSEntry & file, SafeIFStream & stream) const;
+ const std::string get(const FSPath & file, SafeIFStream & stream) const;
private:
MemoisedHashes();
diff --git a/paludis/repositories/e/metadata_xml.cc b/paludis/repositories/e/metadata_xml.cc
index 44c8ae1..cd401dd 100644
--- a/paludis/repositories/e/metadata_xml.cc
+++ b/paludis/repositories/e/metadata_xml.cc
@@ -23,9 +23,10 @@
#include <paludis/util/singleton-impl.hh>
#include <paludis/util/map-impl.hh>
#include <paludis/util/mutex.hh>
-#include <paludis/util/fs_entry.hh>
#include <paludis/util/hashes.hh>
#include <paludis/util/log.hh>
+#include <paludis/util/fs_path.hh>
+#include <paludis/util/fs_stat.hh>
#include <paludis/literal_metadata_key.hh>
#include <paludis/choice.hh>
#include <unordered_map>
@@ -33,7 +34,7 @@
using namespace paludis;
using namespace paludis::erepository;
-typedef std::unordered_map<FSEntry, std::shared_ptr<MetadataXML>, Hash<FSEntry> > Store;
+typedef std::unordered_map<FSPath, std::shared_ptr<MetadataXML>, Hash<FSPath> > Store;
namespace paludis
{
@@ -55,11 +56,11 @@ MetadataXMLPool::~MetadataXMLPool()
}
const std::shared_ptr<const MetadataXML>
-MetadataXMLPool::metadata_if_exists(const FSEntry & f) const
+MetadataXMLPool::metadata_if_exists(const FSPath & f) const
{
Context context("When handling metadata.xml file '" + stringify(f) + "':");
- FSEntry f_real(f.realpath_if_exists());
+ FSPath f_real(f.realpath_if_exists());
Lock lock(_imp->mutex);
Store::const_iterator i(_imp->store.find(f_real));
if (i != _imp->store.end())
@@ -67,7 +68,7 @@ MetadataXMLPool::metadata_if_exists(const FSEntry & f) const
else
{
std::shared_ptr<MetadataXML> metadata_xml;
- if (f_real.is_regular_file_or_symlink_to_regular_file())
+ if (f_real.stat().is_regular_file_or_symlink_to_regular_file())
{
try
{
diff --git a/paludis/repositories/e/metadata_xml.hh b/paludis/repositories/e/metadata_xml.hh
index 03a4b05..7e0e99a 100644
--- a/paludis/repositories/e/metadata_xml.hh
+++ b/paludis/repositories/e/metadata_xml.hh
@@ -26,7 +26,7 @@
#include <paludis/util/singleton.hh>
#include <paludis/util/sequence-fwd.hh>
#include <paludis/util/map-fwd.hh>
-#include <paludis/util/fs_entry-fwd.hh>
+#include <paludis/util/fs_path-fwd.hh>
#include <paludis/choice-fwd.hh>
#include <memory>
@@ -61,7 +61,7 @@ namespace paludis
~MetadataXMLPool();
public:
- const std::shared_ptr<const MetadataXML> metadata_if_exists(const FSEntry &) const PALUDIS_ATTRIBUTE((warn_unused_result));
+ const std::shared_ptr<const MetadataXML> metadata_if_exists(const FSPath &) const PALUDIS_ATTRIBUTE((warn_unused_result));
};
}
diff --git a/paludis/repositories/e/pbin_merger.cc b/paludis/repositories/e/pbin_merger.cc
index 0dceaf2..e027781 100644
--- a/paludis/repositories/e/pbin_merger.cc
+++ b/paludis/repositories/e/pbin_merger.cc
@@ -19,7 +19,7 @@
#include <paludis/repositories/e/pbin_merger.hh>
#include <paludis/util/pimp-impl.hh>
-#include <paludis/util/fs_entry.hh>
+#include <paludis/util/fs_stat.hh>
#include <paludis/util/make_named_values.hh>
#include <paludis/util/system.hh>
#include <paludis/util/join.hh>
@@ -51,10 +51,11 @@ namespace paludis
namespace
{
std::pair<uid_t, gid_t>
- get_new_ids_or_minus_one(const Environment * const env, const FSEntry & f)
+ get_new_ids_or_minus_one(const Environment * const env, const FSPath & f)
{
- uid_t uid = (f.owner() == env->reduced_uid()) ? 0 : -1;
- gid_t gid = (f.group() == env->reduced_gid()) ? 0 : -1;
+ FSStat f_stat(f);
+ uid_t uid = (f_stat.owner() == env->reduced_uid()) ? 0 : -1;
+ gid_t gid = (f_stat.group() == env->reduced_gid()) ? 0 : -1;
return std::make_pair(uid, gid);
}
@@ -68,7 +69,7 @@ PbinMerger::PbinMerger(const PbinMergerParams & p) :
n::fix_mtimes_before() = p.fix_mtimes_before(),
n::get_new_ids_or_minus_one() = std::bind(&get_new_ids_or_minus_one, p.environment(), std::placeholders::_1),
n::image() = p.image(),
- n::install_under() = FSEntry("/"),
+ n::install_under() = FSPath("/"),
n::maybe_output_manager() = p.output_manager(),
n::merged_entries() = p.merged_entries(),
n::no_chown() = ! getenv_with_default("PALUDIS_NO_CHOWN", "").empty(),
@@ -85,7 +86,7 @@ PbinMerger::~PbinMerger() = default;
Hook
PbinMerger::extend_hook(const Hook & h)
{
- std::shared_ptr<const FSEntrySequence> bashrc_files(_imp->params.environment()->bashrc_files());
+ std::shared_ptr<const FSPathSequence> bashrc_files(_imp->params.environment()->bashrc_files());
if (_imp->params.package_id())
{
@@ -148,7 +149,7 @@ PbinMerger::check()
}
void
-PbinMerger::on_enter_dir(bool is_check, const FSEntry)
+PbinMerger::on_enter_dir(bool is_check, const FSPath)
{
if (! is_check)
return;
@@ -165,17 +166,17 @@ PbinMerger::display_override(const std::string & message) const
void
PbinMerger::on_done_merge()
{
- add_file(_imp->params.environment_file(), FSEntry("/PBIN/environment"));
+ add_file(_imp->params.environment_file(), FSPath("/PBIN/environment"));
}
void
-PbinMerger::track_install_file(const FSEntry &, const FSEntry & dst)
+PbinMerger::track_install_file(const FSPath &, const FSPath & dst)
{
display_override(">>> [obj] " + stringify(dst));
}
void
-PbinMerger::track_install_sym(const FSEntry &, const FSEntry & dst)
+PbinMerger::track_install_sym(const FSPath &, const FSPath & dst)
{
display_override(">>> [sym] " + stringify(dst));
}
diff --git a/paludis/repositories/e/pbin_merger.hh b/paludis/repositories/e/pbin_merger.hh
index e996b73..5b3620a 100644
--- a/paludis/repositories/e/pbin_merger.hh
+++ b/paludis/repositories/e/pbin_merger.hh
@@ -48,16 +48,16 @@ namespace paludis
struct PbinMergerParams
{
NamedValue<n::environment, Environment *> environment;
- NamedValue<n::environment_file, FSEntry> environment_file;
+ NamedValue<n::environment_file, FSPath> environment_file;
NamedValue<n::fix_mtimes_before, Timestamp> fix_mtimes_before;
- NamedValue<n::image, FSEntry> image;
- NamedValue<n::install_under, FSEntry> install_under;
- NamedValue<n::merged_entries, std::shared_ptr<FSEntrySet> > merged_entries;
+ NamedValue<n::image, FSPath> image;
+ NamedValue<n::install_under, FSPath> install_under;
+ NamedValue<n::merged_entries, std::shared_ptr<FSPathSet> > merged_entries;
NamedValue<n::options, MergerOptions> options;
NamedValue<n::output_manager, std::shared_ptr<OutputManager> > output_manager;
NamedValue<n::package_id, std::shared_ptr<const PackageID> > package_id;
- NamedValue<n::root, FSEntry> root;
- NamedValue<n::tar_file, FSEntry> tar_file;
+ NamedValue<n::root, FSPath> root;
+ NamedValue<n::tar_file, FSPath> tar_file;
};
class PALUDIS_VISIBLE PbinMerger :
@@ -72,12 +72,12 @@ namespace paludis
virtual void on_warn(bool is_check, const std::string &);
virtual void display_override(const std::string &) const;
- virtual void on_enter_dir(bool is_check, const FSEntry);
+ virtual void on_enter_dir(bool is_check, const FSPath);
virtual void on_done_merge();
- virtual void track_install_file(const FSEntry &, const FSEntry &);
- virtual void track_install_sym(const FSEntry &, const FSEntry &);
+ virtual void track_install_file(const FSPath &, const FSPath &);
+ virtual void track_install_sym(const FSPath &, const FSPath &);
public:
PbinMerger(const PbinMergerParams &);
diff --git a/paludis/repositories/e/pipe_command_handler.cc b/paludis/repositories/e/pipe_command_handler.cc
index b68d14d..9a9b0bc 100644
--- a/paludis/repositories/e/pipe_command_handler.cc
+++ b/paludis/repositories/e/pipe_command_handler.cc
@@ -392,9 +392,9 @@ paludis::erepository::pipe_command_handler(const Environment * const environment
Repository::MetadataConstIterator key(repo->find_metadata("location"));
if (repo->end_metadata() == key)
return "Einstalled repository has no location key";
- if (! simple_visitor_cast<const MetadataValueKey<FSEntry> >(**key))
- return "Einstalled repository location key is not a MetadataValueKey<FSEntry> ";
- return "O0;" + stringify(simple_visitor_cast<const MetadataValueKey<FSEntry> >(**key)->value());
+ if (! simple_visitor_cast<const MetadataValueKey<FSPath> >(**key))
+ return "Einstalled repository location key is not a MetadataValueKey<FSPath> ";
+ return "O0;" + stringify(simple_visitor_cast<const MetadataValueKey<FSPath> >(**key)->value());
}
}
else if (tokens[0] == "OPTIONQ")
diff --git a/paludis/repositories/e/pretend_fetch_visitor.cc b/paludis/repositories/e/pretend_fetch_visitor.cc
index 9b1f319..955340a 100644
--- a/paludis/repositories/e/pretend_fetch_visitor.cc
+++ b/paludis/repositories/e/pretend_fetch_visitor.cc
@@ -20,17 +20,20 @@
#include <paludis/repositories/e/pretend_fetch_visitor.hh>
#include <paludis/repositories/e/e_repository_id.hh>
#include <paludis/repositories/e/manifest2_reader.hh>
+
#include <paludis/dep_spec.hh>
#include <paludis/environment.hh>
#include <paludis/package_id.hh>
#include <paludis/action.hh>
#include <paludis/metadata_key.hh>
+
#include <paludis/util/pimp-impl.hh>
-#include <paludis/util/fs_entry.hh>
#include <paludis/util/log.hh>
#include <paludis/util/stringify.hh>
#include <paludis/util/indirect_iterator-impl.hh>
#include <paludis/util/accept_visitor.hh>
+#include <paludis/util/fs_stat.hh>
+
#include <algorithm>
#include <list>
#include <set>
@@ -46,7 +49,7 @@ namespace paludis
const Environment * const env;
const std::shared_ptr<const PackageID> id;
const EAPI & eapi;
- const FSEntry distdir;
+ const FSPath distdir;
const bool fetch_unneeded;
std::shared_ptr<const URILabel> default_label;
PretendFetchAction & action;
@@ -59,7 +62,7 @@ namespace paludis
const Environment * const e,
const std::shared_ptr<const PackageID> & i,
const EAPI & p,
- const FSEntry & d,
+ const FSPath & d,
const bool f,
const std::shared_ptr<const URILabel> & n,
PretendFetchAction & a) :
@@ -81,7 +84,7 @@ PretendFetchVisitor::PretendFetchVisitor(
const Environment * const e,
const std::shared_ptr<const PackageID> & i,
const EAPI & p,
- const FSEntry & d,
+ const FSPath & d,
const bool f,
const std::shared_ptr<const URILabel> & n,
PretendFetchAction & a) :
@@ -126,8 +129,8 @@ PretendFetchVisitor::visit(const FetchableURISpecTree::NodeType<FetchableURIDepS
if (! _imp->already_done.insert(node.spec()->filename()).second)
return;
- FSEntry destination(_imp->distdir / node.spec()->filename());
- if (destination.exists())
+ FSPath destination(_imp->distdir / node.spec()->filename());
+ if (destination.stat().exists())
return;
Manifest2Reader::ConstIterator m(_imp->manifest.find("DIST", node.spec()->filename()));
diff --git a/paludis/repositories/e/pretend_fetch_visitor.hh b/paludis/repositories/e/pretend_fetch_visitor.hh
index d975541..291b134 100644
--- a/paludis/repositories/e/pretend_fetch_visitor.hh
+++ b/paludis/repositories/e/pretend_fetch_visitor.hh
@@ -1,7 +1,7 @@
/* vim: set sw=4 sts=4 et foldmethod=syntax : */
/*
- * Copyright (c) 2008 Ciaran McCreesh
+ * Copyright (c) 2008, 2010 Ciaran McCreesh
*
* This file is part of the Paludis package manager. Paludis is free software;
* you can redistribute it and/or modify it under the terms of the GNU General
@@ -26,7 +26,6 @@
#include <paludis/spec_tree.hh>
#include <paludis/package_id-fwd.hh>
#include <paludis/repositories/e/eapi-fwd.hh>
-#include <paludis/util/fs_entry-fwd.hh>
#include <paludis/util/pimp.hh>
namespace paludis
@@ -41,7 +40,7 @@ namespace paludis
const Environment * const,
const std::shared_ptr<const PackageID> &,
const EAPI & eapi,
- const FSEntry & distdir,
+ const FSPath & distdir,
const bool fetch_unneeded,
const std::shared_ptr<const URILabel> & initial_label,
PretendFetchAction & action);
diff --git a/paludis/repositories/e/profile.cc b/paludis/repositories/e/profile.cc
index 48562d9..70ffdf4 100644
--- a/paludis/repositories/e/profile.cc
+++ b/paludis/repositories/e/profile.cc
@@ -41,7 +41,7 @@ namespace
const Environment * const env,
const ERepository * const repo,
const RepositoryName & name,
- const FSEntrySequence & locations,
+ const FSPathSequence & locations,
const std::string & a,
const bool x)
{
@@ -59,7 +59,7 @@ ProfileFactory::create(
const Environment * const env,
const ERepository * const repo,
const RepositoryName & name,
- const FSEntrySequence & locations,
+ const FSPathSequence & locations,
const std::string & a,
const bool x) const
{
diff --git a/paludis/repositories/e/profile.hh b/paludis/repositories/e/profile.hh
index 28083b4..5cc09da 100644
--- a/paludis/repositories/e/profile.hh
+++ b/paludis/repositories/e/profile.hh
@@ -28,7 +28,6 @@
#include <paludis/metadata_key-fwd.hh>
#include <paludis/choice-fwd.hh>
#include <paludis/spec_tree-fwd.hh>
-#include <paludis/util/fs_entry-fwd.hh>
#include <paludis/util/tribool.hh>
#include <paludis/util/wrapped_forward_iterator-fwd.hh>
#include <paludis/util/map-fwd.hh>
@@ -47,7 +46,7 @@ namespace paludis
public:
virtual ~Profile() = 0;
- virtual std::shared_ptr<const FSEntrySequence> profiles_with_parents() const
+ virtual std::shared_ptr<const FSPathSequence> profiles_with_parents() const
PALUDIS_ATTRIBUTE((warn_unused_result)) = 0;
virtual bool use_masked(
@@ -114,7 +113,7 @@ namespace paludis
const Environment * const,
const ERepository * const,
const RepositoryName &,
- const FSEntrySequence &,
+ const FSPathSequence &,
const std::string & arch_var_if_special,
const bool profiles_explicitly_set)
const PALUDIS_ATTRIBUTE((warn_unused_result));
diff --git a/paludis/repositories/e/profile_file.cc b/paludis/repositories/e/profile_file.cc
index f788c81..82ef709 100644
--- a/paludis/repositories/e/profile_file.cc
+++ b/paludis/repositories/e/profile_file.cc
@@ -28,6 +28,7 @@
#include <paludis/util/wrapped_forward_iterator-impl.hh>
#include <paludis/util/pimp-impl.hh>
#include <paludis/util/options.hh>
+#include <paludis/util/fs_stat.hh>
#include <paludis/mask.hh>
#include <list>
#include <set>
@@ -114,11 +115,11 @@ namespace paludis
template <typename F_>
void
-ProfileFile<F_>::add_file(const FSEntry & f)
+ProfileFile<F_>::add_file(const FSPath & f)
{
Context context("When adding profile configuration file '" + stringify(f) + "':");
- if (! f.exists())
+ if (! f.stat().exists())
return;
const std::shared_ptr<const EAPI> eapi(EAPIData::get_instance()->eapi_from_string(
diff --git a/paludis/repositories/e/profile_file.hh b/paludis/repositories/e/profile_file.hh
index eae5140..bb9d547 100644
--- a/paludis/repositories/e/profile_file.hh
+++ b/paludis/repositories/e/profile_file.hh
@@ -1,7 +1,7 @@
/* vim: set sw=4 sts=4 et foldmethod=syntax : */
/*
- * Copyright (c) 2006, 2007, 2008, 2009 Ciaran McCreesh
+ * Copyright (c) 2006, 2007, 2008, 2009, 2010 Ciaran McCreesh
*
* This file is part of the Paludis package manager. Paludis is free software;
* you can redistribute it and/or modify it under the terms of the GNU General
@@ -23,7 +23,7 @@
#include <paludis/repositories/e/eapi-fwd.hh>
#include <paludis/util/pimp.hh>
#include <paludis/util/attributes.hh>
-#include <paludis/util/fs_entry.hh>
+#include <paludis/util/fs_path.hh>
#include <paludis/util/wrapped_forward_iterator-fwd.hh>
#include <paludis/mask-fwd.hh>
#include <type_traits>
@@ -50,7 +50,7 @@ namespace paludis
/**
* Add a file.
*/
- void add_file(const FSEntry &);
+ void add_file(const FSPath &);
///\name Iterate over our profile lines.
///\{
diff --git a/paludis/repositories/e/traditional_layout.cc b/paludis/repositories/e/traditional_layout.cc
index e9e3163..9279208 100644
--- a/paludis/repositories/e/traditional_layout.cc
+++ b/paludis/repositories/e/traditional_layout.cc
@@ -23,8 +23,6 @@
#include <paludis/util/config_file.hh>
#include <paludis/package_id.hh>
#include <paludis/package_database.hh>
-#include <paludis/util/dir_iterator.hh>
-#include <paludis/util/fs_entry.hh>
#include <paludis/util/pimp-impl.hh>
#include <paludis/util/wrapped_forward_iterator.hh>
#include <paludis/util/log.hh>
@@ -39,6 +37,8 @@
#include <paludis/util/indirect_iterator-impl.hh>
#include <paludis/util/hashes.hh>
#include <paludis/util/make_null_shared_ptr.hh>
+#include <paludis/util/fs_stat.hh>
+#include <paludis/util/fs_iterator.hh>
#include <paludis/choice.hh>
#include <paludis/literal_metadata_key.hh>
#include <functional>
@@ -59,7 +59,7 @@ namespace paludis
struct Imp<TraditionalLayout>
{
const ERepository * const repository;
- const FSEntry tree_root;
+ const FSPath tree_root;
mutable Mutex big_nasty_mutex;
@@ -70,38 +70,38 @@ namespace paludis
mutable std::shared_ptr<CategoryNamePartSet> category_names_collection;
- std::shared_ptr<FSEntrySequence> arch_list_files;
- std::shared_ptr<FSEntrySequence> repository_mask_files;
- std::shared_ptr<FSEntrySequence> profiles_desc_files;
- std::shared_ptr<FSEntrySequence> mirror_files;
- std::shared_ptr<FSEntrySequence> info_packages_files;
- std::shared_ptr<FSEntrySequence> info_variables_files;
+ std::shared_ptr<FSPathSequence> arch_list_files;
+ std::shared_ptr<FSPathSequence> repository_mask_files;
+ std::shared_ptr<FSPathSequence> profiles_desc_files;
+ std::shared_ptr<FSPathSequence> mirror_files;
+ std::shared_ptr<FSPathSequence> info_packages_files;
+ std::shared_ptr<FSPathSequence> info_variables_files;
std::shared_ptr<UseDescFileInfoSequence> use_desc_files;
- Imp(const ERepository * const r, const FSEntry & t) :
+ Imp(const ERepository * const r, const FSPath & t) :
repository(r),
tree_root(t),
has_category_names(false),
- arch_list_files(std::make_shared<FSEntrySequence>()),
- repository_mask_files(std::make_shared<FSEntrySequence>()),
- profiles_desc_files(std::make_shared<FSEntrySequence>()),
- mirror_files(std::make_shared<FSEntrySequence>()),
- info_packages_files(std::make_shared<FSEntrySequence>()),
- info_variables_files(std::make_shared<FSEntrySequence>()),
+ arch_list_files(std::make_shared<FSPathSequence>()),
+ repository_mask_files(std::make_shared<FSPathSequence>()),
+ profiles_desc_files(std::make_shared<FSPathSequence>()),
+ mirror_files(std::make_shared<FSPathSequence>()),
+ info_packages_files(std::make_shared<FSPathSequence>()),
+ info_variables_files(std::make_shared<FSPathSequence>()),
use_desc_files(std::make_shared<UseDescFileInfoSequence>())
{
}
};
}
-TraditionalLayout::TraditionalLayout(const ERepository * const repo, const FSEntry & tree_root,
- const std::shared_ptr<const FSEntrySequence> & f) :
+TraditionalLayout::TraditionalLayout(const ERepository * const repo, const FSPath & tree_root,
+ const std::shared_ptr<const FSPathSequence> & f) :
Layout(f),
Pimp<TraditionalLayout>(repo, tree_root)
{
if (master_repositories_locations())
{
- for (FSEntrySequence::ConstIterator l(master_repositories_locations()->begin()), l_end(master_repositories_locations()->end()) ;
+ for (FSPathSequence::ConstIterator l(master_repositories_locations()->begin()), l_end(master_repositories_locations()->end()) ;
l != l_end ; ++l)
{
_imp->arch_list_files->push_back(*l / "profiles" / "arch.list");
@@ -112,10 +112,10 @@ TraditionalLayout::TraditionalLayout(const ERepository * const repo, const FSEnt
_imp->use_desc_files->push_back(std::make_pair(*l / "profiles" / "use.desc", ChoicePrefixName("")));
_imp->use_desc_files->push_back(std::make_pair(*l / "profiles" / "use.local.desc", ChoicePrefixName("")));
- FSEntry descs(*l / "profiles" / "desc");
- if (descs.is_directory_or_symlink_to_directory())
+ FSPath descs(*l / "profiles" / "desc");
+ if (descs.stat().is_directory_or_symlink_to_directory())
{
- for (DirIterator d(descs), d_end ; d != d_end ; ++d)
+ for (FSIterator d(descs, { }), d_end ; d != d_end ; ++d)
{
if (! is_file_with_extension(*d, ".desc", { }))
continue;
@@ -134,10 +134,10 @@ TraditionalLayout::TraditionalLayout(const ERepository * const repo, const FSEnt
_imp->use_desc_files->push_back(std::make_pair(_imp->tree_root / "profiles" / "use.desc", ""));
_imp->use_desc_files->push_back(std::make_pair(_imp->tree_root / "profiles" / "use.local.desc", ""));
- FSEntry descs(_imp->tree_root / "profiles" / "desc");
- if (descs.is_directory_or_symlink_to_directory())
+ FSPath descs(_imp->tree_root / "profiles" / "desc");
+ if (descs.stat().is_directory_or_symlink_to_directory())
{
- for (DirIterator d(descs), d_end ; d != d_end ; ++d)
+ for (FSIterator d(descs, { }), d_end ; d != d_end ; ++d)
{
if (! is_file_with_extension(*d, ".desc", { }))
continue;
@@ -150,7 +150,7 @@ TraditionalLayout::~TraditionalLayout()
{
}
-FSEntry
+FSPath
TraditionalLayout::categories_file() const
{
return _imp->tree_root / "profiles" / "categories";
@@ -170,17 +170,17 @@ TraditionalLayout::need_category_names() const
bool found_one(false);
- std::list<FSEntry> cats_list;
+ std::list<FSPath> cats_list;
if (_imp->repository->params().master_repositories())
for (ERepositorySequence::ConstIterator e(_imp->repository->params().master_repositories()->begin()),
e_end(_imp->repository->params().master_repositories()->end()) ; e != e_end ; ++e)
cats_list.push_back((*e)->layout()->categories_file());
cats_list.push_back(categories_file());
- for (std::list<FSEntry>::const_iterator i(cats_list.begin()), i_end(cats_list.end()) ;
+ for (std::list<FSPath>::const_iterator i(cats_list.begin()), i_end(cats_list.end()) ;
i != i_end ; ++i)
{
- if (! i->exists())
+ if (! i->stat().exists())
continue;
LineConfigFile cats(*i, { lcfo_disallow_continuations });
@@ -207,9 +207,9 @@ TraditionalLayout::need_category_names() const
{
Log::get_instance()->message("e.traditional_layout.categories.no_file", ll_qa, lc_context)
<< "No categories file for repository at '" << _imp->tree_root << "', faking it";
- for (DirIterator d(_imp->tree_root, { dio_inode_sort }), d_end ; d != d_end ; ++d)
+ for (FSIterator d(_imp->tree_root, { fsio_inode_sort }), d_end ; d != d_end ; ++d)
{
- if (! d->is_directory_or_symlink_to_directory())
+ if (! d->stat().is_directory_or_symlink_to_directory())
continue;
std::string n(d->basename());
@@ -245,9 +245,9 @@ TraditionalLayout::need_package_ids(const QualifiedPackageName & n) const
std::shared_ptr<PackageIDSequence> v(std::make_shared<PackageIDSequence>());
- FSEntry path(_imp->tree_root / stringify(n.category()) / stringify(n.package()));
+ FSPath path(_imp->tree_root / stringify(n.category()) / stringify(n.package()));
- for (DirIterator e(path, { dio_inode_sort }), e_end ; e != e_end ; ++e)
+ for (FSIterator e(path, { fsio_inode_sort }), e_end ; e != e_end ; ++e)
{
if (! _imp->repository->is_package_file(n, *e))
continue;
@@ -316,10 +316,10 @@ TraditionalLayout::has_package_named(const QualifiedPackageName & q) const
if (_imp->package_names.find(q) != _imp->package_names.end())
return true;
- FSEntry fs(_imp->tree_root);
+ FSPath fs(_imp->tree_root);
fs /= stringify(q.category());
fs /= stringify(q.package());
- if (! fs.is_directory_or_symlink_to_directory())
+ if (! fs.stat().is_directory_or_symlink_to_directory())
return false;
_imp->package_names.insert(std::make_pair(q, false));
return true;
@@ -372,12 +372,12 @@ TraditionalLayout::package_names(const CategoryNamePart & c) const
if (_imp->category_names.end() == _imp->category_names.find(c))
return std::make_shared<QualifiedPackageNameSet>();
- if ((_imp->tree_root / stringify(c)).is_directory_or_symlink_to_directory())
- for (DirIterator d(_imp->tree_root / stringify(c), { dio_inode_sort }), d_end ; d != d_end ; ++d)
+ if ((_imp->tree_root / stringify(c)).stat().is_directory_or_symlink_to_directory())
+ for (FSIterator d(_imp->tree_root / stringify(c), { fsio_inode_sort }), d_end ; d != d_end ; ++d)
{
try
{
- if (! d->is_directory_or_symlink_to_directory())
+ if (! d->stat().is_directory_or_symlink_to_directory())
continue;
if (d->basename() == "CVS")
@@ -421,49 +421,49 @@ TraditionalLayout::package_ids(const QualifiedPackageName & n) const
return std::make_shared<PackageIDSequence>();
}
-const std::shared_ptr<const FSEntrySequence>
+const std::shared_ptr<const FSPathSequence>
TraditionalLayout::info_packages_files() const
{
return _imp->info_packages_files;
}
-const std::shared_ptr<const FSEntrySequence>
+const std::shared_ptr<const FSPathSequence>
TraditionalLayout::info_variables_files() const
{
return _imp->info_variables_files;
}
-FSEntry
+FSPath
TraditionalLayout::package_directory(const QualifiedPackageName & qpn) const
{
return _imp->tree_root / stringify(qpn.category()) / stringify(qpn.package());
}
-FSEntry
+FSPath
TraditionalLayout::category_directory(const CategoryNamePart & cat) const
{
return _imp->tree_root / stringify(cat);
}
-std::shared_ptr<const FSEntrySequence>
+std::shared_ptr<const FSPathSequence>
TraditionalLayout::arch_list_files() const
{
return _imp->arch_list_files;
}
-std::shared_ptr<const FSEntrySequence>
+std::shared_ptr<const FSPathSequence>
TraditionalLayout::repository_mask_files() const
{
return _imp->repository_mask_files;
}
-std::shared_ptr<const FSEntrySequence>
+std::shared_ptr<const FSPathSequence>
TraditionalLayout::profiles_desc_files() const
{
return _imp->profiles_desc_files;
}
-std::shared_ptr<const FSEntrySequence>
+std::shared_ptr<const FSPathSequence>
TraditionalLayout::mirror_files() const
{
return _imp->mirror_files;
@@ -475,7 +475,7 @@ TraditionalLayout::use_desc_files() const
return _imp->use_desc_files;
}
-FSEntry
+FSPath
TraditionalLayout::profiles_base_dir() const
{
if (master_repositories_locations() && ! master_repositories_locations()->empty())
@@ -484,34 +484,34 @@ TraditionalLayout::profiles_base_dir() const
return _imp->tree_root / "profiles";
}
-std::shared_ptr<const FSEntrySequence>
+std::shared_ptr<const FSPathSequence>
TraditionalLayout::exlibsdirs(const QualifiedPackageName & q) const
{
- std::shared_ptr<FSEntrySequence> result(std::make_shared<FSEntrySequence>());
+ std::shared_ptr<FSPathSequence> result(std::make_shared<FSPathSequence>());
- std::shared_ptr<const FSEntrySequence> global(exlibsdirs_global());
+ std::shared_ptr<const FSPathSequence> global(exlibsdirs_global());
std::copy(global->begin(), global->end(), result->back_inserter());
- std::shared_ptr<const FSEntrySequence> category(exlibsdirs_category(q.category()));
+ std::shared_ptr<const FSPathSequence> category(exlibsdirs_category(q.category()));
std::copy(category->begin(), category->end(), result->back_inserter());
- std::shared_ptr<const FSEntrySequence> package(exlibsdirs_package(q));
+ std::shared_ptr<const FSPathSequence> package(exlibsdirs_package(q));
std::copy(package->begin(), package->end(), result->back_inserter());
return result;
}
-std::shared_ptr<const FSEntrySequence>
+std::shared_ptr<const FSPathSequence>
TraditionalLayout::exlibsdirs_global() const
{
- std::shared_ptr<FSEntrySequence> result(std::make_shared<FSEntrySequence>());
+ std::shared_ptr<FSPathSequence> result(std::make_shared<FSPathSequence>());
if (_imp->repository->params().master_repositories())
{
for (ERepositorySequence::ConstIterator e(_imp->repository->params().master_repositories()->begin()),
e_end(_imp->repository->params().master_repositories()->end()) ; e != e_end ; ++e)
{
- std::shared_ptr<const FSEntrySequence> master((*e)->layout()->exlibsdirs_global());
+ std::shared_ptr<const FSPathSequence> master((*e)->layout()->exlibsdirs_global());
std::copy(master->begin(), master->end(), result->back_inserter());
}
}
@@ -520,17 +520,17 @@ TraditionalLayout::exlibsdirs_global() const
return result;
}
-std::shared_ptr<const FSEntrySequence>
+std::shared_ptr<const FSPathSequence>
TraditionalLayout::exlibsdirs_category(const CategoryNamePart & c) const
{
- std::shared_ptr<FSEntrySequence> result(std::make_shared<FSEntrySequence>());
+ std::shared_ptr<FSPathSequence> result(std::make_shared<FSPathSequence>());
if (_imp->repository->params().master_repositories())
{
for (ERepositorySequence::ConstIterator e(_imp->repository->params().master_repositories()->begin()),
e_end(_imp->repository->params().master_repositories()->end()) ; e != e_end ; ++e)
{
- std::shared_ptr<const FSEntrySequence> master((*e)->layout()->exlibsdirs_category(c));
+ std::shared_ptr<const FSPathSequence> master((*e)->layout()->exlibsdirs_category(c));
std::copy(master->begin(), master->end(), result->back_inserter());
}
}
@@ -539,17 +539,17 @@ TraditionalLayout::exlibsdirs_category(const CategoryNamePart & c) const
return result;
}
-std::shared_ptr<const FSEntrySequence>
+std::shared_ptr<const FSPathSequence>
TraditionalLayout::exlibsdirs_package(const QualifiedPackageName & q) const
{
- std::shared_ptr<FSEntrySequence> result(std::make_shared<FSEntrySequence>());
+ std::shared_ptr<FSPathSequence> result(std::make_shared<FSPathSequence>());
if (_imp->repository->params().master_repositories())
{
for (ERepositorySequence::ConstIterator e(_imp->repository->params().master_repositories()->begin()),
e_end(_imp->repository->params().master_repositories()->end()) ; e != e_end ; ++e)
{
- std::shared_ptr<const FSEntrySequence> master((*e)->layout()->exlibsdirs_package(q));
+ std::shared_ptr<const FSPathSequence> master((*e)->layout()->exlibsdirs_package(q));
std::copy(master->begin(), master->end(), result->back_inserter());
}
}
@@ -558,17 +558,17 @@ TraditionalLayout::exlibsdirs_package(const QualifiedPackageName & q) const
return result;
}
-std::shared_ptr<const FSEntrySequence>
+std::shared_ptr<const FSPathSequence>
TraditionalLayout::licenses_dirs() const
{
- std::shared_ptr<FSEntrySequence> result(std::make_shared<FSEntrySequence>());
+ std::shared_ptr<FSPathSequence> result(std::make_shared<FSPathSequence>());
if (_imp->repository->params().master_repositories())
{
for (ERepositorySequence::ConstIterator e(_imp->repository->params().master_repositories()->begin()),
e_end(_imp->repository->params().master_repositories()->end()) ; e != e_end ; ++e)
{
- std::shared_ptr<const FSEntrySequence> master((*e)->layout()->licenses_dirs());
+ std::shared_ptr<const FSPathSequence> master((*e)->layout()->licenses_dirs());
std::copy(master->begin(), master->end(), result->back_inserter());
}
}
@@ -579,26 +579,26 @@ TraditionalLayout::licenses_dirs() const
namespace
{
- void aux_files_helper(const FSEntry & d,
- std::shared_ptr<Map<FSEntry, std::string> > & m,
+ void aux_files_helper(const FSPath & d,
+ std::shared_ptr<Map<FSPath, std::string, FSPathComparator> > & m,
const QualifiedPackageName & qpn)
{
- if (! d.exists())
+ if (! d.stat().exists())
return;
- std::list<FSEntry> files((DirIterator(d, { dio_inode_sort })),
- DirIterator());
- for (std::list<FSEntry>::iterator f(files.begin()) ;
+ std::list<FSPath> files((FSIterator(d, { fsio_inode_sort })), FSIterator());
+ for (std::list<FSPath>::iterator f(files.begin()) ;
f != files.end() ; ++f)
{
- if (f->is_directory())
+ FSStat f_stat(f->stat());
+ if (f_stat.is_directory())
{
if ("CVS" != f->basename())
aux_files_helper((*f), m, qpn);
}
else
{
- if (! f->is_regular_file())
+ if (! f_stat.is_regular_file())
continue;
if (is_file_with_prefix_extension((*f),
("digest-"+stringify(qpn.package())), "",
@@ -610,18 +610,17 @@ namespace
}
}
-std::shared_ptr<Map<FSEntry, std::string> >
+std::shared_ptr<Map<FSPath, std::string, FSPathComparator> >
TraditionalLayout::manifest_files(const QualifiedPackageName & qpn) const
{
- std::shared_ptr<Map<FSEntry, std::string> > result(std::make_shared<Map<FSEntry, std::string>>());
- FSEntry package_dir = _imp->repository->layout()->package_directory(qpn);
+ auto result(std::make_shared<Map<FSPath, std::string, FSPathComparator>>());
+ FSPath package_dir = _imp->repository->layout()->package_directory(qpn);
- std::list<FSEntry> package_files((DirIterator(package_dir, { dio_inode_sort })),
- DirIterator());
- for (std::list<FSEntry>::iterator f(package_files.begin()) ;
+ std::list<FSPath> package_files((FSIterator(package_dir, { fsio_inode_sort })), FSIterator());
+ for (std::list<FSPath>::iterator f(package_files.begin()) ;
f != package_files.end() ; ++f)
{
- if (! (*f).is_regular_file() || ((*f).basename() == "Manifest") )
+ if (! f->stat().is_regular_file() || ((*f).basename() == "Manifest") )
continue;
std::string file_type("MISC");
@@ -636,10 +635,10 @@ TraditionalLayout::manifest_files(const QualifiedPackageName & qpn) const
return result;
}
-FSEntry
+FSPath
TraditionalLayout::sync_filter_file() const
{
- return FSEntry(DATADIR "/paludis/traditional.exclude");
+ return FSPath(DATADIR "/paludis/traditional.exclude");
}
void
@@ -653,24 +652,24 @@ TraditionalLayout::invalidate_masks()
(*it2)->invalidate_masks();
}
-FSEntry
+FSPath
TraditionalLayout::binary_ebuild_location(const QualifiedPackageName & q, const VersionSpec & v,
const std::string & eapi) const
{
return package_directory(q) / _imp->repository->binary_ebuild_name(q, v, eapi);
}
-std::shared_ptr<MetadataValueKey<FSEntry> >
+std::shared_ptr<MetadataValueKey<FSPath> >
TraditionalLayout::accounts_repository_data_location_key() const
{
return make_null_shared_ptr();
}
-std::shared_ptr<MetadataValueKey<FSEntry> >
+std::shared_ptr<MetadataValueKey<FSPath> >
TraditionalLayout::e_updates_location_key() const
{
- if ((_imp->tree_root / "profiles" / "updates").exists())
- return std::make_shared<LiteralMetadataValueKey<FSEntry>>("e_updates_location",
+ if ((_imp->tree_root / "profiles" / "updates").stat().exists())
+ return std::make_shared<LiteralMetadataValueKey<FSPath>>("e_updates_location",
"VDBRepository updates data location", mkt_internal, _imp->tree_root / "profiles" / "updates");
else
return make_null_shared_ptr();
diff --git a/paludis/repositories/e/traditional_layout.hh b/paludis/repositories/e/traditional_layout.hh
index eb3d113..52d796b 100644
--- a/paludis/repositories/e/traditional_layout.hh
+++ b/paludis/repositories/e/traditional_layout.hh
@@ -1,7 +1,7 @@
/* vim: set sw=4 sts=4 et foldmethod=syntax : */
/*
- * Copyright (c) 2005, 2006, 2007, 2008, 2009 Ciaran McCreesh
+ * Copyright (c) 2005, 2006, 2007, 2008, 2009, 2010 Ciaran McCreesh
* Copyright (c) 2006 Danny van Dyk
*
* This file is part of the Paludis package manager. Paludis is free software;
@@ -47,8 +47,8 @@ namespace paludis
///\name Basic operations
///\{
- TraditionalLayout(const ERepository * const, const FSEntry &,
- const std::shared_ptr<const FSEntrySequence> &);
+ TraditionalLayout(const ERepository * const, const FSPath &,
+ const std::shared_ptr<const FSPathSequence> &);
virtual ~TraditionalLayout();
@@ -60,7 +60,7 @@ namespace paludis
virtual bool has_package_named(const QualifiedPackageName &) const
PALUDIS_ATTRIBUTE((warn_unused_result));
- virtual FSEntry categories_file() const
+ virtual FSPath categories_file() const
PALUDIS_ATTRIBUTE((warn_unused_result));
virtual std::shared_ptr<const CategoryNamePartSet> category_names() const
@@ -74,65 +74,65 @@ namespace paludis
const QualifiedPackageName &) const
PALUDIS_ATTRIBUTE((warn_unused_result));
- virtual const std::shared_ptr<const FSEntrySequence> info_packages_files() const
+ virtual const std::shared_ptr<const FSPathSequence> info_packages_files() const
PALUDIS_ATTRIBUTE((warn_unused_result));
- virtual const std::shared_ptr<const FSEntrySequence> info_variables_files() const
+ virtual const std::shared_ptr<const FSPathSequence> info_variables_files() const
PALUDIS_ATTRIBUTE((warn_unused_result));
- virtual FSEntry package_directory(const QualifiedPackageName &) const
+ virtual FSPath package_directory(const QualifiedPackageName &) const
PALUDIS_ATTRIBUTE((warn_unused_result));
- virtual FSEntry category_directory(const CategoryNamePart &) const
+ virtual FSPath category_directory(const CategoryNamePart &) const
PALUDIS_ATTRIBUTE((warn_unused_result));
- virtual FSEntry binary_ebuild_location(const QualifiedPackageName &, const VersionSpec &,
+ virtual FSPath binary_ebuild_location(const QualifiedPackageName &, const VersionSpec &,
const std::string & eapi) const
PALUDIS_ATTRIBUTE((warn_unused_result));
- virtual std::shared_ptr<const FSEntrySequence> arch_list_files() const
+ virtual std::shared_ptr<const FSPathSequence> arch_list_files() const
PALUDIS_ATTRIBUTE((warn_unused_result));
- virtual std::shared_ptr<const FSEntrySequence> repository_mask_files() const
+ virtual std::shared_ptr<const FSPathSequence> repository_mask_files() const
PALUDIS_ATTRIBUTE((warn_unused_result));
- virtual std::shared_ptr<const FSEntrySequence> profiles_desc_files() const
+ virtual std::shared_ptr<const FSPathSequence> profiles_desc_files() const
PALUDIS_ATTRIBUTE((warn_unused_result));
- virtual std::shared_ptr<const FSEntrySequence> mirror_files() const
+ virtual std::shared_ptr<const FSPathSequence> mirror_files() const
PALUDIS_ATTRIBUTE((warn_unused_result));
virtual std::shared_ptr<const UseDescFileInfoSequence> use_desc_files() const
PALUDIS_ATTRIBUTE((warn_unused_result));
- virtual FSEntry profiles_base_dir() const
+ virtual FSPath profiles_base_dir() const
PALUDIS_ATTRIBUTE((warn_unused_result));
- virtual std::shared_ptr<const FSEntrySequence> exlibsdirs(const QualifiedPackageName &) const
+ virtual std::shared_ptr<const FSPathSequence> exlibsdirs(const QualifiedPackageName &) const
PALUDIS_ATTRIBUTE((warn_unused_result));
- virtual std::shared_ptr<const FSEntrySequence> exlibsdirs_global() const
+ virtual std::shared_ptr<const FSPathSequence> exlibsdirs_global() const
PALUDIS_ATTRIBUTE((warn_unused_result));
- virtual std::shared_ptr<const FSEntrySequence> exlibsdirs_category(const CategoryNamePart &) const
+ virtual std::shared_ptr<const FSPathSequence> exlibsdirs_category(const CategoryNamePart &) const
PALUDIS_ATTRIBUTE((warn_unused_result));
- virtual std::shared_ptr<const FSEntrySequence> exlibsdirs_package(const QualifiedPackageName &) const
+ virtual std::shared_ptr<const FSPathSequence> exlibsdirs_package(const QualifiedPackageName &) const
PALUDIS_ATTRIBUTE((warn_unused_result));
- virtual std::shared_ptr<const FSEntrySequence> licenses_dirs() const
+ virtual std::shared_ptr<const FSPathSequence> licenses_dirs() const
PALUDIS_ATTRIBUTE((warn_unused_result));
- virtual std::shared_ptr<Map<FSEntry, std::string> > manifest_files(const QualifiedPackageName &) const
+ virtual std::shared_ptr<Map<FSPath, std::string, FSPathComparator> > manifest_files(const QualifiedPackageName &) const
PALUDIS_ATTRIBUTE((warn_unused_result));
- virtual std::shared_ptr<MetadataValueKey<FSEntry> > accounts_repository_data_location_key() const
+ virtual std::shared_ptr<MetadataValueKey<FSPath> > accounts_repository_data_location_key() const
PALUDIS_ATTRIBUTE((warn_unused_result));
- virtual std::shared_ptr<MetadataValueKey<FSEntry> > e_updates_location_key() const
+ virtual std::shared_ptr<MetadataValueKey<FSPath> > e_updates_location_key() const
PALUDIS_ATTRIBUTE((warn_unused_result));
- virtual FSEntry sync_filter_file() const;
+ virtual FSPath sync_filter_file() const;
virtual void invalidate_masks();
};
diff --git a/paludis/repositories/e/traditional_profile.cc b/paludis/repositories/e/traditional_profile.cc
index feb8e30..fa15647 100644
--- a/paludis/repositories/e/traditional_profile.cc
+++ b/paludis/repositories/e/traditional_profile.cc
@@ -41,6 +41,9 @@
#include <paludis/util/hashes.hh>
#include <paludis/util/mutex.hh>
#include <paludis/util/map.hh>
+#include <paludis/util/fs_stat.hh>
+#include <paludis/util/fs_error.hh>
+
#include <paludis/choice.hh>
#include <paludis/dep_tag.hh>
#include <paludis/environment.hh>
@@ -106,18 +109,18 @@ namespace paludis
{
private:
void load_environment();
- void load_profile_directory_recursively(const FSEntry & dir);
- void load_profile_parent(const FSEntry & dir);
- void load_profile_make_defaults(const FSEntry & dir);
+ void load_profile_directory_recursively(const FSPath & dir);
+ void load_profile_parent(const FSPath & dir);
+ void load_profile_make_defaults(const FSPath & dir);
- void load_basic_use_file(const FSEntry & file, FlagStatusMap & m);
- void load_spec_use_file(const EAPI &, const FSEntry & file, PackageFlagStatusMapList & m);
+ void load_basic_use_file(const FSPath & file, FlagStatusMap & m);
+ void load_spec_use_file(const EAPI &, const FSPath & file, PackageFlagStatusMapList & m);
void add_use_expand_to_use();
void fish_out_use_expand_names();
void make_vars_from_file_vars();
void handle_profile_arch_var(const std::string &);
- void load_special_make_defaults_vars(const FSEntry &);
+ void load_special_make_defaults_vars(const FSPath &);
ProfileFile<LineConfigFile> packages_file;
ProfileFile<LineConfigFile> virtuals_file;
@@ -132,7 +135,7 @@ namespace paludis
const Environment * const env;
const ERepository * const repository;
- std::shared_ptr<FSEntrySequence> profiles_with_parents;
+ std::shared_ptr<FSPathSequence> profiles_with_parents;
///\}
@@ -186,14 +189,14 @@ namespace paludis
///\{
Imp(const Environment * const e, const ERepository * const p,
- const RepositoryName & name, const FSEntrySequence & dirs,
+ const RepositoryName & name, const FSPathSequence & dirs,
const std::string & arch_var_if_special, const bool profiles_explicitly_set) :
packages_file(p),
virtuals_file(p),
package_mask_file(p),
env(e),
repository(p),
- profiles_with_parents(std::make_shared<FSEntrySequence>()),
+ profiles_with_parents(std::make_shared<FSPathSequence>()),
system_packages(std::make_shared<SetSpecTree>(std::make_shared<AllDepSpec>())),
system_tag(std::make_shared<GeneralSetDepTag>(SetName("system"), stringify(name))),
virtuals(std::make_shared<Map<QualifiedPackageName, PackageDepSpec>>()),
@@ -210,14 +213,14 @@ namespace paludis
load_environment();
- for (FSEntrySequence::ConstIterator d(dirs.begin()), d_end(dirs.end()) ;
+ for (FSPathSequence::ConstIterator d(dirs.begin()), d_end(dirs.end()) ;
d != d_end ; ++d)
{
Context subcontext("When using directory '" + stringify(*d) + "':");
if (profiles_explicitly_set)
if (! p->params().ignore_deprecated_profiles())
- if ((*d / "deprecated").is_regular_file_or_symlink_to_regular_file())
+ if ((*d / "deprecated").stat().is_regular_file_or_symlink_to_regular_file())
Log::get_instance()->message("e.profile.deprecated", ll_warning, lc_context) << "Profile directory '" << *d
<< "' is deprecated. See the file '" << (*d / "deprecated") << "' for details";
@@ -248,19 +251,18 @@ Imp<TraditionalProfile>::load_environment()
}
void
-Imp<TraditionalProfile>::load_profile_directory_recursively(const FSEntry & dir)
+Imp<TraditionalProfile>::load_profile_directory_recursively(const FSPath & dir)
{
Context context("When adding profile directory '" + stringify(dir) + ":");
- if (! dir.is_directory_or_symlink_to_directory())
+ if (! dir.stat().is_directory_or_symlink_to_directory())
{
Log::get_instance()->message("e.profile.not_a_directory", ll_warning, lc_context)
<< "Profile component '" << dir << "' is not a directory";
return;
}
- const std::shared_ptr<const EAPI> eapi(EAPIData::get_instance()->eapi_from_string(
- repository->eapi_for_file(dir / "use.mask")));
+ const std::shared_ptr<const EAPI> eapi(EAPIData::get_instance()->eapi_from_string(repository->eapi_for_file(dir / "use.mask")));
if (! eapi->supported())
throw ERepositoryConfigurationError("Can't use profile directory '" + stringify(dir) +
@@ -286,11 +288,11 @@ Imp<TraditionalProfile>::load_profile_directory_recursively(const FSEntry & dir)
}
void
-Imp<TraditionalProfile>::load_profile_parent(const FSEntry & dir)
+Imp<TraditionalProfile>::load_profile_parent(const FSPath & dir)
{
Context context("When handling parent file for profile directory '" + stringify(dir) + ":");
- if (! (dir / "parent").exists())
+ if (! (dir / "parent").stat().exists())
return;
LineConfigFile file(dir / "parent", { lcfo_disallow_continuations });
@@ -311,7 +313,7 @@ Imp<TraditionalProfile>::load_profile_parent(const FSEntry & dir)
continue;
}
- FSEntry parent_dir(dir);
+ FSPath parent_dir(dir);
do
{
try
@@ -332,11 +334,11 @@ Imp<TraditionalProfile>::load_profile_parent(const FSEntry & dir)
}
void
-Imp<TraditionalProfile>::load_profile_make_defaults(const FSEntry & dir)
+Imp<TraditionalProfile>::load_profile_make_defaults(const FSPath & dir)
{
Context context("When handling make.defaults file for profile directory '" + stringify(dir) + ":");
- if (! (dir / "make.defaults").exists())
+ if (! (dir / "make.defaults").stat().exists())
return;
const std::shared_ptr<const EAPI> eapi(EAPIData::get_instance()->eapi_from_string(
@@ -479,7 +481,7 @@ Imp<TraditionalProfile>::load_profile_make_defaults(const FSEntry & dir)
}
void
-Imp<TraditionalProfile>::load_special_make_defaults_vars(const FSEntry & dir)
+Imp<TraditionalProfile>::load_special_make_defaults_vars(const FSPath & dir)
{
const std::shared_ptr<const EAPI> eapi(EAPIData::get_instance()->eapi_from_string(
repository->eapi_for_file(dir / "make.defaults")));
@@ -660,9 +662,9 @@ Imp<TraditionalProfile>::make_vars_from_file_vars()
}
void
-Imp<TraditionalProfile>::load_basic_use_file(const FSEntry & file, FlagStatusMap & m)
+Imp<TraditionalProfile>::load_basic_use_file(const FSPath & file, FlagStatusMap & m)
{
- if (! file.exists())
+ if (! file.stat().exists())
return;
Context context("When loading basic use file '" + stringify(file) + ":");
@@ -699,9 +701,9 @@ Imp<TraditionalProfile>::load_basic_use_file(const FSEntry & file, FlagStatusMap
}
void
-Imp<TraditionalProfile>::load_spec_use_file(const EAPI & eapi, const FSEntry & file, PackageFlagStatusMapList & m)
+Imp<TraditionalProfile>::load_spec_use_file(const EAPI & eapi, const FSPath & file, PackageFlagStatusMapList & m)
{
- if (! file.exists())
+ if (! file.stat().exists())
return;
Context context("When loading specised use file '" + stringify(file) + ":");
@@ -830,7 +832,7 @@ Imp<TraditionalProfile>::handle_profile_arch_var(const std::string & s)
TraditionalProfile::TraditionalProfile(
const Environment * const env, const ERepository * const p, const RepositoryName & name,
- const FSEntrySequence & location,
+ const FSPathSequence & location,
const std::string & arch_var_if_special, const bool x) :
Pimp<TraditionalProfile>(env, p, name, location, arch_var_if_special, x)
{
@@ -840,7 +842,7 @@ TraditionalProfile::~TraditionalProfile()
{
}
-std::shared_ptr<const FSEntrySequence>
+std::shared_ptr<const FSPathSequence>
TraditionalProfile::profiles_with_parents() const
{
return _imp->profiles_with_parents;
diff --git a/paludis/repositories/e/traditional_profile.hh b/paludis/repositories/e/traditional_profile.hh
index aeae22d..cee6fd1 100644
--- a/paludis/repositories/e/traditional_profile.hh
+++ b/paludis/repositories/e/traditional_profile.hh
@@ -1,7 +1,7 @@
/* vim: set sw=4 sts=4 et foldmethod=syntax : */
/*
- * Copyright (c) 2005, 2006, 2007, 2008, 2009 Ciaran McCreesh
+ * Copyright (c) 2005, 2006, 2007, 2008, 2009, 2010 Ciaran McCreesh
*
* This file is part of the Paludis package manager. Paludis is free software;
* you can redistribute it and/or modify it under the terms of the GNU General
@@ -35,14 +35,14 @@ namespace paludis
public:
TraditionalProfile(
const Environment * const, const ERepository * const, const RepositoryName &,
- const FSEntrySequence &,
+ const FSPathSequence &,
const std::string & arch_var_if_special,
const bool x
);
virtual ~TraditionalProfile();
- virtual std::shared_ptr<const FSEntrySequence> profiles_with_parents() const
+ virtual std::shared_ptr<const FSPathSequence> profiles_with_parents() const
PALUDIS_ATTRIBUTE((warn_unused_result));
virtual bool use_masked(
diff --git a/paludis/repositories/e/use_desc.cc b/paludis/repositories/e/use_desc.cc
index 3b85116..64a5571 100644
--- a/paludis/repositories/e/use_desc.cc
+++ b/paludis/repositories/e/use_desc.cc
@@ -20,8 +20,6 @@
#include "use_desc.hh"
#include <paludis/name.hh>
#include <paludis/package_id.hh>
-#include <paludis/util/fs_entry.hh>
-#include <paludis/util/dir_iterator.hh>
#include <paludis/util/is_file_with_extension.hh>
#include <paludis/util/pimp-impl.hh>
#include <paludis/util/stringify.hh>
@@ -30,6 +28,9 @@
#include <paludis/util/config_file.hh>
#include <paludis/util/hashes.hh>
#include <paludis/util/sequence-impl.hh>
+#include <paludis/util/fs_stat.hh>
+#include <paludis/util/fs_path.hh>
+#include <paludis/util/options.hh>
#include <paludis/choice.hh>
#include <unordered_map>
@@ -47,9 +48,9 @@ namespace paludis
std::unordered_map<QualifiedPackageName, UseDescs, Hash<QualifiedPackageName> > local_descs;
UseDescs global_descs;
- void add(const FSEntry & f, const ChoicePrefixName & prefix)
+ void add(const FSPath & f, const ChoicePrefixName & prefix)
{
- if (f.is_regular_file_or_symlink_to_regular_file())
+ if (f.stat().is_regular_file_or_symlink_to_regular_file())
{
LineConfigFile ff(f, { lcfo_disallow_continuations });
for (LineConfigFile::ConstIterator line(ff.begin()), line_end(ff.end()) ;
diff --git a/paludis/repositories/e/use_desc.hh b/paludis/repositories/e/use_desc.hh
index 521e898..347ee1a 100644
--- a/paludis/repositories/e/use_desc.hh
+++ b/paludis/repositories/e/use_desc.hh
@@ -21,7 +21,7 @@
#define PALUDIS_GUARD_PALUDIS_PALUDIS_REPOSITORIES_E_USE_DESC_HH 1
#include <paludis/util/pimp.hh>
-#include <paludis/util/fs_entry-fwd.hh>
+#include <paludis/util/fs_path-fwd.hh>
#include <paludis/name-fwd.hh>
#include <paludis/package_id-fwd.hh>
#include <paludis/choice-fwd.hh>
@@ -29,7 +29,7 @@
namespace paludis
{
- typedef std::pair<FSEntry, ChoicePrefixName> UseDescFileInfo;
+ typedef std::pair<FSPath, ChoicePrefixName> UseDescFileInfo;
typedef Sequence<UseDescFileInfo> UseDescFileInfoSequence;
/**
diff --git a/paludis/repositories/e/vdb_id.cc b/paludis/repositories/e/vdb_id.cc
index 2f1688e..45c58bf 100644
--- a/paludis/repositories/e/vdb_id.cc
+++ b/paludis/repositories/e/vdb_id.cc
@@ -19,6 +19,7 @@
#include <paludis/repositories/e/vdb_id.hh>
#include <paludis/repositories/e/e_key.hh>
+#include <paludis/util/fs_path.hh>
using namespace paludis;
using namespace paludis::erepository;
@@ -26,7 +27,7 @@ using namespace paludis::erepository;
VDBID::VDBID(const QualifiedPackageName & q, const VersionSpec & v,
const Environment * const e,
const std::shared_ptr<const Repository> & r,
- const FSEntry & f) :
+ const FSPath & f) :
EInstalledRepositoryID(q, v, e, r, f)
{
}
diff --git a/paludis/repositories/e/vdb_id.hh b/paludis/repositories/e/vdb_id.hh
index 78b5180..500d92b 100644
--- a/paludis/repositories/e/vdb_id.hh
+++ b/paludis/repositories/e/vdb_id.hh
@@ -1,7 +1,7 @@
/* vim: set sw=4 sts=4 et foldmethod=syntax : */
/*
- * Copyright (c) 2007, 2008 Ciaran McCreesh
+ * Copyright (c) 2007, 2008, 2010 Ciaran McCreesh
*
* This file is part of the Paludis package manager. Paludis is free software;
* you can redistribute it and/or modify it under the terms of the GNU General
@@ -33,7 +33,7 @@ namespace paludis
VDBID(const QualifiedPackageName &, const VersionSpec &,
const Environment * const,
const std::shared_ptr<const Repository> &,
- const FSEntry & file);
+ const FSPath & file);
virtual std::string fs_location_raw_name() const;
virtual std::string fs_location_human_name() const;
diff --git a/paludis/repositories/e/vdb_merger.cc b/paludis/repositories/e/vdb_merger.cc
index 1bcf3e9..492179b 100644
--- a/paludis/repositories/e/vdb_merger.cc
+++ b/paludis/repositories/e/vdb_merger.cc
@@ -25,7 +25,7 @@
#include <paludis/util/join.hh>
#include <paludis/util/pimp-impl.hh>
#include <paludis/util/sequence.hh>
-#include <paludis/util/fs_entry.hh>
+#include <paludis/util/fs_stat.hh>
#include <paludis/util/strip.hh>
#include <paludis/util/options.hh>
#include <paludis/util/make_named_values.hh>
@@ -51,7 +51,7 @@ namespace paludis
struct Imp<VDBMerger>
{
VDBMergerParams params;
- FSEntry realroot;
+ FSPath realroot;
std::shared_ptr<SafeOFStream> contents_file;
std::list<std::string> config_protect;
@@ -70,10 +70,11 @@ namespace paludis
namespace
{
std::pair<uid_t, gid_t>
- get_new_ids_or_minus_one(const Environment * const env, const FSEntry & f)
+ get_new_ids_or_minus_one(const Environment * const env, const FSPath & f)
{
- uid_t uid = (f.owner() == env->reduced_uid()) ? 0 : -1;
- gid_t gid = (f.group() == env->reduced_gid()) ? 0 : -1;
+ FSStat f_stat(f.stat());
+ uid_t uid = (f_stat.owner() == env->reduced_uid()) ? 0 : -1;
+ gid_t gid = (f_stat.group() == env->reduced_gid()) ? 0 : -1;
return std::make_pair(uid, gid);
}
@@ -85,7 +86,7 @@ VDBMerger::VDBMerger(const VDBMergerParams & p) :
n::fix_mtimes_before() = p.fix_mtimes_before(),
n::get_new_ids_or_minus_one() = std::bind(&get_new_ids_or_minus_one, p.environment(), std::placeholders::_1),
n::image() = p.image(),
- n::install_under() = FSEntry("/"),
+ n::install_under() = FSPath("/"),
n::maybe_output_manager() = p.output_manager(),
n::merged_entries() = p.merged_entries(),
n::no_chown() = ! getenv_with_default("PALUDIS_NO_CHOWN", "").empty(),
@@ -104,7 +105,7 @@ VDBMerger::~VDBMerger()
Hook
VDBMerger::extend_hook(const Hook & h)
{
- std::shared_ptr<const FSEntrySequence> bashrc_files(_imp->params.environment()->bashrc_files());
+ std::shared_ptr<const FSPathSequence> bashrc_files(_imp->params.environment()->bashrc_files());
if (_imp->params.package_id())
{
@@ -137,28 +138,28 @@ VDBMerger::extend_hook(const Hook & h)
}
void
-VDBMerger::record_install_file(const FSEntry & src, const FSEntry & dst_dir, const std::string & dst_name, const FSMergerStatusFlags & flags)
+VDBMerger::record_install_file(const FSPath & src, const FSPath & dst_dir, const std::string & dst_name, const FSMergerStatusFlags & flags)
{
std::string tidy(stringify((dst_dir / dst_name).strip_leading(_imp->realroot))),
tidy_real(stringify((dst_dir / src.basename()).strip_leading(_imp->realroot)));
- Timestamp timestamp((dst_dir / dst_name).mtim());
+ Timestamp timestamp((dst_dir / dst_name).stat().mtim());
- SafeIFStream infile(FSEntry(dst_dir / dst_name));
+ SafeIFStream infile(FSPath(dst_dir / dst_name));
if (! infile)
- throw FSMergerError("Cannot read '" + stringify(FSEntry(dst_dir / dst_name)) + "'");
+ throw FSMergerError("Cannot read '" + stringify(FSPath(dst_dir / dst_name)) + "'");
MD5 md5(infile);
std::string line(make_arrows(flags) + " [obj] " + tidy_real);
if (tidy_real != tidy)
- line.append(" (" + FSEntry(tidy).basename() + ")");
+ line.append(" (" + FSPath(tidy).basename() + ")");
display_override(line);
*_imp->contents_file << "obj " << tidy_real << " " << md5.hexsum() << " " << timestamp.seconds() << std::endl;
}
void
-VDBMerger::record_install_dir(const FSEntry & src, const FSEntry & dst_dir, const FSMergerStatusFlags & flags)
+VDBMerger::record_install_dir(const FSPath & src, const FSPath & dst_dir, const FSMergerStatusFlags & flags)
{
std::string tidy(stringify((dst_dir / src.basename()).strip_leading(_imp->realroot)));
display_override(make_arrows(flags) + " [dir] " + tidy);
@@ -167,7 +168,7 @@ VDBMerger::record_install_dir(const FSEntry & src, const FSEntry & dst_dir, cons
}
void
-VDBMerger::record_install_under_dir(const FSEntry & dst_dir, const FSMergerStatusFlags & flags)
+VDBMerger::record_install_under_dir(const FSPath & dst_dir, const FSMergerStatusFlags & flags)
{
std::string tidy(stringify(dst_dir.strip_leading(_imp->realroot)));
display_override(make_arrows(flags) + " [dir] " + tidy);
@@ -176,11 +177,11 @@ VDBMerger::record_install_under_dir(const FSEntry & dst_dir, const FSMergerStatu
}
void
-VDBMerger::record_install_sym(const FSEntry & src, const FSEntry & dst_dir, const FSMergerStatusFlags & flags)
+VDBMerger::record_install_sym(const FSPath & src, const FSPath & dst_dir, const FSMergerStatusFlags & flags)
{
std::string tidy(stringify((dst_dir / src.basename()).strip_leading(_imp->realroot)));
std::string target((dst_dir / src.basename()).readlink());
- Timestamp timestamp((dst_dir / src.basename()).mtim());
+ Timestamp timestamp((dst_dir / src.basename()).stat().mtim());
display_override(make_arrows(flags) + " [sym] " + tidy);
@@ -206,7 +207,7 @@ VDBMerger::on_warn(bool is_check, const std::string & s)
}
bool
-VDBMerger::config_protected(const FSEntry & src, const FSEntry & dst_dir)
+VDBMerger::config_protected(const FSPath & src, const FSPath & dst_dir)
{
std::string tidy(stringify((dst_dir / src.basename()).strip_leading(_imp->realroot)));
@@ -231,7 +232,7 @@ VDBMerger::config_protected(const FSEntry & src, const FSEntry & dst_dir)
}
std::string
-VDBMerger::make_config_protect_name(const FSEntry & src, const FSEntry & dst)
+VDBMerger::make_config_protect_name(const FSPath & src, const FSPath & dst)
{
std::string result_name(src.basename());
int n(0);
@@ -243,10 +244,12 @@ VDBMerger::make_config_protect_name(const FSEntry & src, const FSEntry & dst)
while (true)
{
- if (! (dst / result_name).exists())
+ FSPath dst_result_name(dst / result_name);
+ FSStat dst_result_name_stat(dst_result_name);
+ if (! dst_result_name_stat.exists())
break;
- if ((dst / result_name).is_regular_file_or_symlink_to_regular_file())
+ if (dst_result_name_stat.is_regular_file_or_symlink_to_regular_file())
{
try
{
@@ -286,7 +289,7 @@ VDBMerger::check()
}
void
-VDBMerger::on_enter_dir(bool is_check, const FSEntry)
+VDBMerger::on_enter_dir(bool is_check, const FSPath)
{
if (! is_check)
return;
@@ -295,7 +298,7 @@ VDBMerger::on_enter_dir(bool is_check, const FSEntry)
}
void
-VDBMerger::on_file(bool is_check, const FSEntry & src, const FSEntry & dst)
+VDBMerger::on_file(bool is_check, const FSPath & src, const FSPath & dst)
{
if (is_check && std::string::npos != src.basename().find('\n'))
throw FSMergerError("File '" + stringify(src) + "' contains a newline in its name, which cannot be stored by VDB");
@@ -303,7 +306,7 @@ VDBMerger::on_file(bool is_check, const FSEntry & src, const FSEntry & dst)
}
void
-VDBMerger::on_dir(bool is_check, const FSEntry & src, const FSEntry & dst)
+VDBMerger::on_dir(bool is_check, const FSPath & src, const FSPath & dst)
{
if (is_check && std::string::npos != src.basename().find('\n'))
throw FSMergerError("Directory '" + stringify(src) + "' contains a newline in its name, which cannot be stored by VDB");
@@ -311,7 +314,7 @@ VDBMerger::on_dir(bool is_check, const FSEntry & src, const FSEntry & dst)
}
void
-VDBMerger::on_sym(bool is_check, const FSEntry & src, const FSEntry & dst)
+VDBMerger::on_sym(bool is_check, const FSPath & src, const FSPath & dst)
{
if (is_check)
{
diff --git a/paludis/repositories/e/vdb_merger.hh b/paludis/repositories/e/vdb_merger.hh
index 8ac3e36..d76a33e 100644
--- a/paludis/repositories/e/vdb_merger.hh
+++ b/paludis/repositories/e/vdb_merger.hh
@@ -56,15 +56,15 @@ namespace paludis
{
NamedValue<n::config_protect, std::string> config_protect;
NamedValue<n::config_protect_mask, std::string> config_protect_mask;
- NamedValue<n::contents_file, FSEntry> contents_file;
+ NamedValue<n::contents_file, FSPath> contents_file;
NamedValue<n::environment, Environment *> environment;
NamedValue<n::fix_mtimes_before, Timestamp> fix_mtimes_before;
- NamedValue<n::image, FSEntry> image;
- NamedValue<n::merged_entries, std::shared_ptr<FSEntrySet> > merged_entries;
+ NamedValue<n::image, FSPath> image;
+ NamedValue<n::merged_entries, std::shared_ptr<FSPathSet> > merged_entries;
NamedValue<n::options, MergerOptions> options;
NamedValue<n::output_manager, std::shared_ptr<OutputManager> > output_manager;
NamedValue<n::package_id, std::shared_ptr<const PackageID> > package_id;
- NamedValue<n::root, FSEntry> root;
+ NamedValue<n::root, FSPath> root;
};
/**
@@ -94,21 +94,21 @@ namespace paludis
virtual Hook extend_hook(const Hook &);
- virtual void record_install_file(const FSEntry &, const FSEntry &, const std::string &, const FSMergerStatusFlags &);
- virtual void record_install_dir(const FSEntry &, const FSEntry &, const FSMergerStatusFlags &);
- virtual void record_install_under_dir(const FSEntry &, const FSMergerStatusFlags &);
- virtual void record_install_sym(const FSEntry &, const FSEntry &, const FSMergerStatusFlags &);
+ virtual void record_install_file(const FSPath &, const FSPath &, const std::string &, const FSMergerStatusFlags &);
+ virtual void record_install_dir(const FSPath &, const FSPath &, const FSMergerStatusFlags &);
+ virtual void record_install_under_dir(const FSPath &, const FSMergerStatusFlags &);
+ virtual void record_install_sym(const FSPath &, const FSPath &, const FSMergerStatusFlags &);
virtual void on_error(bool is_check, const std::string &);
virtual void on_warn(bool is_check, const std::string &);
- virtual void on_enter_dir(bool is_check, const FSEntry);
+ virtual void on_enter_dir(bool is_check, const FSPath);
- virtual void on_file(bool is_check, const FSEntry &, const FSEntry &);
- virtual void on_dir(bool is_check, const FSEntry &, const FSEntry &);
- virtual void on_sym(bool is_check, const FSEntry &, const FSEntry &);
+ virtual void on_file(bool is_check, const FSPath &, const FSPath &);
+ virtual void on_dir(bool is_check, const FSPath &, const FSPath &);
+ virtual void on_sym(bool is_check, const FSPath &, const FSPath &);
- virtual bool config_protected(const FSEntry &, const FSEntry &);
- virtual std::string make_config_protect_name(const FSEntry &, const FSEntry &);
+ virtual bool config_protected(const FSPath &, const FSPath &);
+ virtual std::string make_config_protect_name(const FSPath &, const FSPath &);
virtual void merge();
virtual bool check();
diff --git a/paludis/repositories/e/vdb_merger_TEST.cc b/paludis/repositories/e/vdb_merger_TEST.cc
index 63f31f6..79db1de 100644
--- a/paludis/repositories/e/vdb_merger_TEST.cc
+++ b/paludis/repositories/e/vdb_merger_TEST.cc
@@ -24,6 +24,7 @@
#include <paludis/util/make_named_values.hh>
#include <paludis/util/safe_ifstream.hh>
#include <paludis/util/set.hh>
+#include <paludis/util/fs_stat.hh>
#include <paludis/standard_output_manager.hh>
#include <test/test_framework.hh>
#include <test/test_runner.hh>
@@ -52,7 +53,7 @@ namespace
return FSMerger::check();
}
- void on_enter_dir(bool, const FSEntry)
+ void on_enter_dir(bool, const FSPath)
{
}
};
@@ -62,7 +63,7 @@ namespace
{
public:
- FSEntry root_dir;
+ FSPath root_dir;
std::string target;
TestEnvironment env;
VDBMergerNoDisplay merger;
@@ -76,16 +77,16 @@ namespace
VDBMergerTest(const std::string & what) :
TestCase("merge '" + what + "' test"),
- root_dir(FSEntry::cwd() / "vdb_merger_TEST_dir" / what / "root"),
+ root_dir(FSPath::cwd() / "vdb_merger_TEST_dir" / what / "root"),
target(what),
merger(make_named_values<VDBMergerParams>(
n::config_protect() = "/protected_file /protected_dir",
n::config_protect_mask() = "/protected_dir/unprotected_file /protected_dir/unprotected_dir",
- n::contents_file() = FSEntry::cwd() / "vdb_merger_TEST_dir/CONTENTS" / what,
+ n::contents_file() = FSPath::cwd() / "vdb_merger_TEST_dir/CONTENTS" / what,
n::environment() = &env,
n::fix_mtimes_before() = Timestamp(0, 0),
- n::image() = FSEntry::cwd() / "vdb_merger_TEST_dir" / what / "image",
- n::merged_entries() = std::make_shared<FSEntrySet>(),
+ n::image() = FSPath::cwd() / "vdb_merger_TEST_dir" / what / "image",
+ n::merged_entries() = std::make_shared<FSPathSet>(),
n::options() = MergerOptions() + mo_rewrite_symlinks + mo_allow_empty_dirs,
n::output_manager() = std::make_shared<StandardOutputManager>(),
n::package_id() = std::shared_ptr<PackageID>(),
@@ -102,9 +103,9 @@ namespace test_cases
{
VDBMergerTestConfigProtect() : VDBMergerTest("config_protect") { }
- static std::string file_contents(const FSEntry & f)
+ static std::string file_contents(const FSPath & f)
{
- if (! f.is_regular_file())
+ if (! f.stat().is_regular_file())
return "";
try
@@ -124,50 +125,50 @@ namespace test_cases
void run()
{
TEST_CHECK_EQUAL(file_contents(root_dir / "protected_file"), "bar");
- TEST_CHECK(! (root_dir / "._cfg0000_protected_file").exists());
+ TEST_CHECK(! (root_dir / "._cfg0000_protected_file").stat().exists());
TEST_CHECK_EQUAL(file_contents(root_dir / "unprotected_file"), "bar");
- TEST_CHECK(! (root_dir / "._cfg0000_unprotected_file").exists());
+ TEST_CHECK(! (root_dir / "._cfg0000_unprotected_file").stat().exists());
TEST_CHECK_EQUAL(file_contents(root_dir / "protected_file_not_really"), "bar");
- TEST_CHECK(! (root_dir / "._cfg0000_protected_file_not_really").exists());
+ TEST_CHECK(! (root_dir / "._cfg0000_protected_file_not_really").stat().exists());
TEST_CHECK_EQUAL(file_contents(root_dir / "protected_dir/protected_file"), "bar");
- TEST_CHECK(! (root_dir / "protected_dir/._cfg0000_protected_file").exists());
+ TEST_CHECK(! (root_dir / "protected_dir/._cfg0000_protected_file").stat().exists());
TEST_CHECK_EQUAL(file_contents(root_dir / "protected_dir/unprotected_file"), "bar");
- TEST_CHECK(! (root_dir / "protected_dir/._cfg0000_unprotected_file").exists());
+ TEST_CHECK(! (root_dir / "protected_dir/._cfg0000_unprotected_file").stat().exists());
TEST_CHECK_EQUAL(file_contents(root_dir / "protected_dir/unprotected_file_not_really"), "bar");
- TEST_CHECK(! (root_dir / "protected_dir/._cfg0000_unprotected_file_not_really").exists());
+ TEST_CHECK(! (root_dir / "protected_dir/._cfg0000_unprotected_file_not_really").stat().exists());
TEST_CHECK_EQUAL(file_contents(root_dir / "protected_dir/protected_file_already_needs_update"), "bar");
TEST_CHECK_EQUAL(file_contents(root_dir / "protected_dir/._cfg0000_protected_file_already_needs_update"), "baz");
- TEST_CHECK(! (root_dir / "protected_dir/._cfg0001_protected_file_already_needs_update").exists());
+ TEST_CHECK(! (root_dir / "protected_dir/._cfg0001_protected_file_already_needs_update").stat().exists());
TEST_CHECK_EQUAL(file_contents(root_dir / "protected_dir/unchanged_protected_file"), "foo");
- TEST_CHECK(! (root_dir / "protected_dir/._cfg0000_unchanged_protected_file").exists());
+ TEST_CHECK(! (root_dir / "protected_dir/._cfg0000_unchanged_protected_file").stat().exists());
TEST_CHECK_EQUAL(file_contents(root_dir / "protected_dir/protected_file_same_as_existing_update"), "bar");
TEST_CHECK_EQUAL(file_contents(root_dir / "protected_dir/._cfg0000_protected_file_same_as_existing_update"), "foo");
- TEST_CHECK(! (root_dir / "protected_dir/._cfg0001_protected_file_same_as_existing_update").exists());
+ TEST_CHECK(! (root_dir / "protected_dir/._cfg0001_protected_file_same_as_existing_update").stat().exists());
TEST_CHECK_EQUAL(file_contents(root_dir / "protected_dir/unprotected_dir/unprotected_file"), "bar");
- TEST_CHECK(! (root_dir / "protected_dir/unprotected_dir/._cfg0000_unprotected_file").exists());
+ TEST_CHECK(! (root_dir / "protected_dir/unprotected_dir/._cfg0000_unprotected_file").stat().exists());
TEST_CHECK_EQUAL(file_contents(root_dir / "protected_dir/unprotected_dir_not_really/protected_file"), "bar");
- TEST_CHECK(! (root_dir / "protected_dir/unprotected_dir_not_really/._cfg0000_protected_file").exists());
+ TEST_CHECK(! (root_dir / "protected_dir/unprotected_dir_not_really/._cfg0000_protected_file").stat().exists());
TEST_CHECK_EQUAL(file_contents(root_dir / "protected_dir_not_really/unprotected_file"), "bar");
- TEST_CHECK(! (root_dir / "protected_dir_not_really/._cfg0000_unprotected_file").exists());
+ TEST_CHECK(! (root_dir / "protected_dir_not_really/._cfg0000_unprotected_file").stat().exists());
merger.merge();
TEST_CHECK_EQUAL(file_contents(root_dir / "protected_file"), "bar");
TEST_CHECK_EQUAL(file_contents(root_dir / "._cfg0000_protected_file"), "foo");
TEST_CHECK_EQUAL(file_contents(root_dir / "unprotected_file"), "foo");
- TEST_CHECK(! (root_dir / "._cfg0000_unprotected_file").exists());
+ TEST_CHECK(! (root_dir / "._cfg0000_unprotected_file").stat().exists());
TEST_CHECK_EQUAL(file_contents(root_dir / "protected_file_not_really"), "foo");
- TEST_CHECK(! (root_dir / "._cfg0000_protected_file_not_really").exists());
+ TEST_CHECK(! (root_dir / "._cfg0000_protected_file_not_really").stat().exists());
TEST_CHECK_EQUAL(file_contents(root_dir / "protected_dir/protected_file"), "bar");
TEST_CHECK_EQUAL(file_contents(root_dir / "protected_dir/._cfg0000_protected_file"), "foo");
TEST_CHECK_EQUAL(file_contents(root_dir / "protected_dir/unprotected_file"), "foo");
- TEST_CHECK(! (root_dir / "protected_dir/._cfg0000_unprotected_file").exists());
+ TEST_CHECK(! (root_dir / "protected_dir/._cfg0000_unprotected_file").stat().exists());
TEST_CHECK_EQUAL(file_contents(root_dir / "protected_dir/unprotected_file_not_really"), "bar");
TEST_CHECK_EQUAL(file_contents(root_dir / "protected_dir/._cfg0000_unprotected_file_not_really"), "foo");
@@ -175,19 +176,19 @@ namespace test_cases
TEST_CHECK_EQUAL(file_contents(root_dir / "protected_dir/._cfg0000_protected_file_already_needs_update"), "baz");
TEST_CHECK_EQUAL(file_contents(root_dir / "protected_dir/._cfg0001_protected_file_already_needs_update"), "foo");
TEST_CHECK_EQUAL(file_contents(root_dir / "protected_dir/unchanged_protected_file"), "foo");
- TEST_CHECK(! (root_dir / "protected_dir/._cfg0000_unchanged_protected_file").exists());
+ TEST_CHECK(! (root_dir / "protected_dir/._cfg0000_unchanged_protected_file").stat().exists());
TEST_CHECK_EQUAL(file_contents(root_dir / "protected_dir/protected_file_same_as_existing_update"), "bar");
TEST_CHECK_EQUAL(file_contents(root_dir / "protected_dir/._cfg0000_protected_file_same_as_existing_update"), "foo");
- TEST_CHECK(! (root_dir / "protected_dir/._cfg0001_protected_file_same_as_existing_update").exists());
+ TEST_CHECK(! (root_dir / "protected_dir/._cfg0001_protected_file_same_as_existing_update").stat().exists());
TEST_CHECK_EQUAL(file_contents(root_dir / "protected_dir/unprotected_dir/unprotected_file"), "foo");
- TEST_CHECK(! (root_dir / "protected_dir/unprotected_dir/._cfg0000_unprotected_file").exists());
+ TEST_CHECK(! (root_dir / "protected_dir/unprotected_dir/._cfg0000_unprotected_file").stat().exists());
TEST_CHECK_EQUAL(file_contents(root_dir / "protected_dir/unprotected_dir_not_really/protected_file"), "bar");
TEST_CHECK_EQUAL(file_contents(root_dir / "protected_dir/unprotected_dir_not_really/._cfg0000_protected_file"), "foo");
TEST_CHECK_EQUAL(file_contents(root_dir / "protected_dir_not_really/unprotected_file"), "foo");
- TEST_CHECK(! (root_dir / "protected_dir_not_really/._cfg0000_unprotected_file").exists());
+ TEST_CHECK(! (root_dir / "protected_dir_not_really/._cfg0000_unprotected_file").stat().exists());
}
} test_vdb_merger_config_protect;
diff --git a/paludis/repositories/e/vdb_repository.cc b/paludis/repositories/e/vdb_repository.cc
index 0d89b43..cbdf0e3 100644
--- a/paludis/repositories/e/vdb_repository.cc
+++ b/paludis/repositories/e/vdb_repository.cc
@@ -58,10 +58,8 @@
#include <paludis/partially_made_package_dep_spec.hh>
#include <paludis/util/accept_visitor.hh>
-#include <paludis/util/dir_iterator.hh>
#include <paludis/util/fast_unique_copy.hh>
#include <paludis/util/mutex.hh>
-#include <paludis/util/fs_entry.hh>
#include <paludis/util/is_file_with_extension.hh>
#include <paludis/util/log.hh>
#include <paludis/util/set.hh>
@@ -80,6 +78,8 @@
#include <paludis/util/safe_ofstream.hh>
#include <paludis/util/timestamp.hh>
#include <paludis/util/destringify.hh>
+#include <paludis/util/fs_stat.hh>
+#include <paludis/util/fs_iterator.hh>
#include <paludis/util/pimp-impl.hh>
#include <paludis/util/create_iterator-impl.hh>
@@ -94,6 +94,7 @@
#include <iostream>
#include <cstring>
#include <cerrno>
+#include <ctime>
using namespace paludis;
using namespace paludis::erepository;
@@ -123,12 +124,12 @@ namespace paludis
Imp(const VDBRepository * const, const VDBRepositoryParams &, std::shared_ptr<Mutex> = std::make_shared<Mutex>());
~Imp();
- std::shared_ptr<const MetadataValueKey<FSEntry> > location_key;
- std::shared_ptr<const MetadataValueKey<FSEntry> > root_key;
+ std::shared_ptr<const MetadataValueKey<FSPath> > location_key;
+ std::shared_ptr<const MetadataValueKey<FSPath> > root_key;
std::shared_ptr<const MetadataValueKey<std::string> > format_key;
- std::shared_ptr<const MetadataValueKey<FSEntry> > provides_cache_key;
- std::shared_ptr<const MetadataValueKey<FSEntry> > names_cache_key;
- std::shared_ptr<const MetadataValueKey<FSEntry> > builddir_key;
+ std::shared_ptr<const MetadataValueKey<FSPath> > provides_cache_key;
+ std::shared_ptr<const MetadataValueKey<FSPath> > names_cache_key;
+ std::shared_ptr<const MetadataValueKey<FSPath> > builddir_key;
std::shared_ptr<const MetadataValueKey<std::string> > eapi_when_unknown_key;
};
@@ -140,17 +141,17 @@ namespace paludis
tried_provides_cache(false),
used_provides_cache(false),
names_cache(std::make_shared<RepositoryNameCache>(p.names_cache(), r)),
- location_key(std::make_shared<LiteralMetadataValueKey<FSEntry> >("location", "location",
+ location_key(std::make_shared<LiteralMetadataValueKey<FSPath> >("location", "location",
mkt_significant, params.location())),
- root_key(std::make_shared<LiteralMetadataValueKey<FSEntry> >("root", "root",
+ root_key(std::make_shared<LiteralMetadataValueKey<FSPath> >("root", "root",
mkt_normal, params.root())),
format_key(std::make_shared<LiteralMetadataValueKey<std::string> >("format", "format",
mkt_significant, "vdb")),
- provides_cache_key(std::make_shared<LiteralMetadataValueKey<FSEntry> >("provides_cache", "provides_cache",
+ provides_cache_key(std::make_shared<LiteralMetadataValueKey<FSPath> >("provides_cache", "provides_cache",
mkt_normal, params.provides_cache())),
- names_cache_key(std::make_shared<LiteralMetadataValueKey<FSEntry> >("names_cache", "names_cache",
+ names_cache_key(std::make_shared<LiteralMetadataValueKey<FSPath> >("names_cache", "names_cache",
mkt_normal, params.names_cache())),
- builddir_key(std::make_shared<LiteralMetadataValueKey<FSEntry> >("builddir", "builddir",
+ builddir_key(std::make_shared<LiteralMetadataValueKey<FSPath> >("builddir", "builddir",
mkt_normal, params.builddir())),
eapi_when_unknown_key(std::make_shared<LiteralMetadataValueKey<std::string> >(
"eapi_when_unknown", "eapi_when_unknown", mkt_normal, params.eapi_when_unknown()))
@@ -398,8 +399,7 @@ VDBRepositoryKeyReadError::VDBRepositoryKeyReadError(
namespace
{
- bool ignore_merged(const std::shared_ptr<const FSEntrySet> & s,
- const FSEntry & f)
+ bool ignore_merged(const std::shared_ptr<const FSPathSet> & s, const FSPath & f)
{
return s->end() != s->find(f);
}
@@ -412,7 +412,7 @@ VDBRepository::perform_uninstall(
{
Context context("When uninstalling '" + stringify(*id) + (a.options.is_overwrite() ? "' for an overwrite:" : "':"));
- if (! _imp->params.root().is_directory())
+ if (! _imp->params.root().stat().is_directory())
throw ActionFailedError("Couldn't uninstall '" + stringify(*id) +
"' because root ('" + stringify(_imp->params.root()) + "') is not a directory");
@@ -420,14 +420,14 @@ VDBRepository::perform_uninstall(
std::string reinstalling_str(a.options.is_overwrite() ? "-reinstalling-" : "");
- std::shared_ptr<FSEntrySequence> eclassdirs(std::make_shared<FSEntrySequence>());
- eclassdirs->push_back(FSEntry(_imp->params.location() / stringify(id->name().category()) /
+ std::shared_ptr<FSPathSequence> eclassdirs(std::make_shared<FSPathSequence>());
+ eclassdirs->push_back(FSPath(_imp->params.location() / stringify(id->name().category()) /
(reinstalling_str + stringify(id->name().package()) + "-" + stringify(id->version()))));
- FSEntry pkg_dir(_imp->params.location() / stringify(id->name().category()) / (reinstalling_str +
+ FSPath pkg_dir(_imp->params.location() / stringify(id->name().category()) / (reinstalling_str +
stringify(id->name().package()) + "-" + stringify(id->version())));
- std::shared_ptr<FSEntry> load_env(std::make_shared<FSEntry>(pkg_dir / "environment.bz2"));
+ std::shared_ptr<FSPath> load_env(std::make_shared<FSPath>(pkg_dir / "environment.bz2"));
EAPIPhases phases(id->eapi()->supported()->ebuild_phases()->ebuild_uninstall());
for (EAPIPhases::ConstIterator phase(phases.begin_phases()), phase_end(phases.end_phases()) ;
@@ -487,7 +487,7 @@ VDBRepository::perform_uninstall(
}
else
{
- FSEntry package_builddir(_imp->params.builddir() / (stringify(id->name().category()) + "-" + stringify(id->name().package()) + "-" + stringify(id->version()) + "-uninstall"));
+ FSPath package_builddir(_imp->params.builddir() / (stringify(id->name().category()) + "-" + stringify(id->name().package()) + "-" + stringify(id->version()) + "-uninstall"));
EbuildCommandParams params(make_named_values<EbuildCommandParams>(
n::builddir() = _imp->params.builddir(),
n::clearenv() = phase->option("clearenv"),
@@ -497,7 +497,7 @@ VDBRepository::perform_uninstall(
n::ebuild_file() = pkg_dir / (stringify(id->name().package()) + "-" + stringify(id->version()) + ".ebuild"),
n::eclassdirs() = eclassdirs,
n::environment() = _imp->params.environment(),
- n::exlibsdirs() = std::make_shared<FSEntrySequence>(),
+ n::exlibsdirs() = std::make_shared<FSPathSequence>(),
n::files_dir() = pkg_dir,
n::maybe_output_manager() = output_manager,
n::package_builddir() = package_builddir,
@@ -522,8 +522,8 @@ VDBRepository::perform_uninstall(
}
/* remove vdb entry */
- for (DirIterator d(pkg_dir, { dio_include_dotfiles }), d_end ; d != d_end ; ++d)
- FSEntry(*d).unlink();
+ for (FSIterator d(pkg_dir, { fsio_include_dotfiles, fsio_inode_sort }), d_end ; d != d_end ; ++d)
+ d->unlink();
pkg_dir.rmdir();
{
@@ -621,12 +621,12 @@ VDBRepository::load_provided_using_cache() const
Lock l(*_imp->big_nasty_mutex);
_imp->tried_provides_cache = true;
- if (_imp->params.provides_cache() == FSEntry("/var/empty"))
+ if (_imp->params.provides_cache() == FSPath("/var/empty"))
return false;
Context context("When loading VDB PROVIDEs map using '" + stringify(_imp->params.provides_cache()) + "':");
- if (! _imp->params.provides_cache().is_regular_file())
+ if (! _imp->params.provides_cache().stat().is_regular_file())
{
Log::get_instance()->message("e.vdb.provides_cache.not_regular_file", ll_warning, lc_no_context)
<< "Provides cache at '" << _imp->params.provides_cache() << "' is not a regular file. Perhaps you need to regenerate "
@@ -788,7 +788,7 @@ VDBRepository::write_provides_cache() const
{
Context context("When saving provides cache to '" + stringify(_imp->params.provides_cache()) + "':");
- if (! _imp->params.provides_cache().dirname().exists())
+ if (! _imp->params.provides_cache().dirname().stat().exists())
{
Log::get_instance()->message("e.vdb.provides.no_dir", ll_warning, lc_no_context) << "Directory '"
<< _imp->params.provides_cache().dirname() << "' does not exist, so cannot save cache file '"
@@ -838,13 +838,13 @@ VDBRepository::regenerate_provides_cache() const
using namespace std::placeholders;
- if (_imp->params.provides_cache() == FSEntry("/var/empty"))
+ if (_imp->params.provides_cache() == FSPath("/var/empty"))
return;
Context context("When generating VDB repository provides cache at '"
+ stringify(_imp->params.provides_cache()) + "':");
- FSEntry(_imp->params.provides_cache()).unlink();
+ FSPath(_imp->params.provides_cache()).unlink();
load_provided_the_slow_way();
write_provides_cache();
@@ -892,14 +892,14 @@ VDBRepository::merge(const MergeParams & m)
std::shared_ptr<const ERepositoryID> is_replace(package_id_if_exists(m.package_id()->name(), m.package_id()->version()));
- FSEntry tmp_vdb_dir(_imp->params.location());
- if (! tmp_vdb_dir.exists())
- tmp_vdb_dir.mkdir();
+ FSPath tmp_vdb_dir(_imp->params.location());
+ if (! tmp_vdb_dir.stat().exists())
+ tmp_vdb_dir.mkdir(0755, { });
tmp_vdb_dir /= stringify(m.package_id()->name().category());
- if (! tmp_vdb_dir.exists())
- tmp_vdb_dir.mkdir();
+ if (! tmp_vdb_dir.stat().exists())
+ tmp_vdb_dir.mkdir(0755, { });
tmp_vdb_dir /= ("-checking-" + stringify(m.package_id()->name().package()) + "-" + stringify(m.package_id()->version()));
- tmp_vdb_dir.mkdir();
+ tmp_vdb_dir.mkdir(0755, { });
WriteVDBEntryCommand write_vdb_entry_command(
make_named_values<WriteVDBEntryParams>(
@@ -932,7 +932,7 @@ VDBRepository::merge(const MergeParams & m)
{
}
- FSEntry vdb_dir(_imp->params.location());
+ FSPath vdb_dir(_imp->params.location());
vdb_dir /= stringify(m.package_id()->name().category());
vdb_dir /= (stringify(m.package_id()->name().package()) + "-" + stringify(m.package_id()->version()));
@@ -958,8 +958,8 @@ VDBRepository::merge(const MergeParams & m)
if (! merger.check())
{
- for (DirIterator d(tmp_vdb_dir, { dio_include_dotfiles }), d_end ; d != d_end ; ++d)
- FSEntry(*d).unlink();
+ for (FSIterator d(tmp_vdb_dir, { fsio_include_dotfiles, fsio_inode_sort }), d_end ; d != d_end ; ++d)
+ d->unlink();
tmp_vdb_dir.rmdir();
throw ActionFailedError("Not proceeding with install due to merge sanity check failing");
}
@@ -971,11 +971,11 @@ VDBRepository::merge(const MergeParams & m)
throw InternalError(PALUDIS_HERE, "No contents key in " + stringify(*is_replace) + ". How did that happen?");
is_replace->contents_key()->value();
- FSEntry old_vdb_dir(_imp->params.location());
+ FSPath old_vdb_dir(_imp->params.location());
old_vdb_dir /= stringify(is_replace->name().category());
old_vdb_dir /= (stringify(is_replace->name().package()) + "-" + stringify(is_replace->version()));
- if ((old_vdb_dir.dirname() / ("-reinstalling-" + old_vdb_dir.basename())).exists())
+ if ((old_vdb_dir.dirname() / ("-reinstalling-" + old_vdb_dir.basename())).stat().exists())
throw ActionFailedError("Directory '" + stringify(old_vdb_dir.dirname() /
("-reinstalling-" + old_vdb_dir.basename())) + "' already exists, probably due to "
"a previous failed upgrade. If it is safe to do so, remove this directory and try "
@@ -1065,10 +1065,10 @@ VDBRepository::need_category_names() const
Context context("When loading category names from '" + stringify(_imp->params.location()) + "':");
- for (DirIterator d(_imp->params.location(), { dio_inode_sort }), d_end ; d != d_end ; ++d)
+ for (FSIterator d(_imp->params.location(), { fsio_inode_sort }), d_end ; d != d_end ; ++d)
try
{
- if (d->is_directory_or_symlink_to_directory())
+ if (d->stat().is_directory_or_symlink_to_directory())
_imp->categories.insert(std::make_pair(CategoryNamePart(d->basename()),
std::shared_ptr<QualifiedPackageNameSet>()));
}
@@ -1098,10 +1098,10 @@ VDBRepository::need_package_ids(const CategoryNamePart & c) const
std::shared_ptr<QualifiedPackageNameSet> q(std::make_shared<QualifiedPackageNameSet>());
- for (DirIterator d(_imp->params.location() / stringify(c), { dio_inode_sort }), d_end ; d != d_end ; ++d)
+ for (FSIterator d(_imp->params.location() / stringify(c), { fsio_inode_sort }), d_end ; d != d_end ; ++d)
try
{
- if (d->is_directory_or_symlink_to_directory())
+ if (d->stat().is_directory_or_symlink_to_directory())
{
std::string s(d->basename());
if (std::string::npos == s.rfind('-'))
@@ -1130,7 +1130,7 @@ VDBRepository::need_package_ids(const CategoryNamePart & c) const
}
const std::shared_ptr<const ERepositoryID>
-VDBRepository::make_id(const QualifiedPackageName & q, const VersionSpec & v, const FSEntry & f) const
+VDBRepository::make_id(const QualifiedPackageName & q, const VersionSpec & v, const FSPath & f) const
{
Lock l(*_imp->big_nasty_mutex);
@@ -1170,13 +1170,13 @@ VDBRepository::format_key() const
return _imp->format_key;
}
-const std::shared_ptr<const MetadataValueKey<FSEntry> >
+const std::shared_ptr<const MetadataValueKey<FSPath> >
VDBRepository::location_key() const
{
return _imp->location_key;
}
-const std::shared_ptr<const MetadataValueKey<FSEntry> >
+const std::shared_ptr<const MetadataValueKey<FSPath> >
VDBRepository::installed_root_key() const
{
return _imp->root_key;
@@ -1286,7 +1286,7 @@ namespace
};
bool rewrite_dependencies(
- const FSEntry & f,
+ const FSPath & f,
const std::shared_ptr<const MetadataSpecTreeKey<DependencySpecTree> > & key,
const DepRewrites & rewrites)
{
@@ -1316,10 +1316,10 @@ VDBRepository::perform_updates()
typedef std::list<std::pair<std::shared_ptr<const PackageID>, SlotName> > SlotMoves;
SlotMoves slot_moves;
- std::map<FSEntry, std::time_t> cache_contents;
- FSEntry cache_dir(_imp->params.location() / ".cache");
- FSEntry cache_file(cache_dir / "updates_time_cache");
- if (cache_file.is_regular_file_or_symlink_to_regular_file())
+ std::map<FSPath, std::time_t, FSPathComparator> cache_contents;
+ FSPath cache_dir(_imp->params.location() / ".cache");
+ FSPath cache_file(cache_dir / "updates_time_cache");
+ if (cache_file.stat().is_regular_file_or_symlink_to_regular_file())
{
Context ctx2("When reading update file timestamps from '" + stringify(cache_file) + "':");
LineConfigFile f(cache_file, { lcfo_preserve_whitespace });
@@ -1336,7 +1336,7 @@ VDBRepository::perform_updates()
}
try
{
- cache_contents.insert(std::make_pair(FSEntry(line->substr(tab + 1)), destringify<std::time_t>(line->substr(0, tab))));
+ cache_contents.insert(std::make_pair(FSPath(line->substr(tab + 1)), destringify<std::time_t>(line->substr(0, tab))));
}
catch (const DestringifyError &)
{
@@ -1348,7 +1348,7 @@ VDBRepository::perform_updates()
std::cout << std::endl << "Checking for updates (package moves etc):" << std::endl;
- std::map<FSEntry, std::time_t> update_timestamps;
+ std::map<FSPath, std::time_t, FSPathComparator> update_timestamps;
for (PackageDatabase::RepositoryConstIterator r(_imp->params.environment()->package_database()->begin_repositories()),
r_end(_imp->params.environment()->package_database()->end_repositories()) ;
r != r_end ; ++r)
@@ -1371,33 +1371,33 @@ VDBRepository::perform_updates()
continue;
}
- const MetadataValueKey<FSEntry> * k(simple_visitor_cast<const MetadataValueKey<FSEntry> >(**k_iter));
+ const MetadataValueKey<FSPath> * k(simple_visitor_cast<const MetadataValueKey<FSPath> >(**k_iter));
if (! k)
{
Log::get_instance()->message("e.vdb.udpates.bad_key", ll_warning, lc_context) <<
- "Repository " << (*r)->name() << " defines an e_updates_location key, but it is not an FSEntry key";
+ "Repository " << (*r)->name() << " defines an e_updates_location key, but it is not an FSPath key";
continue;
}
- FSEntry dir(k->value());
- if (! dir.is_directory_or_symlink_to_directory())
+ FSPath dir(k->value());
+ if (! dir.stat().is_directory_or_symlink_to_directory())
{
Log::get_instance()->message("e.vdb.updates.bad_key", ll_warning, lc_context) <<
"Repository " << (*r)->name() << " has e_updates_location " << dir << ", but this is not a directory";
continue;
}
- for (DirIterator d(k->value(), { }), d_end ;
- d != d_end ; ++d)
+ for (FSIterator d(k->value(), { }), d_end ; d != d_end ; ++d)
{
Context context_3("When performing updates from '" + stringify(*d) + "':");
- if (! d->is_regular_file_or_symlink_to_regular_file())
+ FSStat d_stat(*d);
+ if (! d_stat.is_regular_file_or_symlink_to_regular_file())
continue;
- update_timestamps.insert(std::make_pair(*d, d->mtim().seconds()));
- std::map<FSEntry, std::time_t>::const_iterator last_checked(cache_contents.find(*d));
- if (cache_contents.end() != last_checked && d->mtim().seconds() <= last_checked->second)
+ update_timestamps.insert(std::make_pair(*d, d_stat.mtim().seconds()));
+ std::map<FSPath, std::time_t, FSPathComparator>::const_iterator last_checked(cache_contents.find(*d));
+ if (cache_contents.end() != last_checked && d_stat.mtim().seconds() <= last_checked->second)
{
Log::get_instance()->message("e.vdb.updates.ignoring", ll_debug, lc_context) <<
"Ignoring " << *d << " because it hasn't changed";
@@ -1494,13 +1494,13 @@ VDBRepository::perform_updates()
{
std::cout << " " << *m->first << " to " << m->second << std::endl;
- FSEntry target_cat_dir(_imp->params.location() / stringify(m->second.category()));
- target_cat_dir.mkdir();
+ FSPath target_cat_dir(_imp->params.location() / stringify(m->second.category()));
+ target_cat_dir.mkdir(0755, { fspmkdo_ok_if_exists });
- FSEntry from_dir(m->first->fs_location_key()->value());
- FSEntry to_dir(target_cat_dir / ((stringify(m->second.package()) + "-" + stringify(m->first->version()))));
+ FSPath from_dir(m->first->fs_location_key()->value());
+ FSPath to_dir(target_cat_dir / ((stringify(m->second.package()) + "-" + stringify(m->first->version()))));
- if (to_dir.exists())
+ if (to_dir.stat().exists())
{
/* Uh oh. It's possible to install both a package and its renamed version. */
Log::get_instance()->message("e.vdb.updates.collision", ll_warning, lc_context) <<
@@ -1533,12 +1533,11 @@ VDBRepository::perform_updates()
if (newpf != oldpf)
{
- for (DirIterator it(to_dir, { dio_inode_sort }),
- it_end; it_end != it; ++it)
+ for (FSIterator it(to_dir, { fsio_inode_sort }), it_end; it_end != it; ++it)
{
std::string::size_type lastdot(it->basename().rfind('.'));
if (std::string::npos != lastdot && 0 == it->basename().compare(0, lastdot, oldpf, 0, oldpf.length()))
- FSEntry(*it).rename(to_dir / (newpf + it->basename().substr(lastdot)));
+ it->rename(to_dir / (newpf + it->basename().substr(lastdot)));
}
}
}
@@ -1562,11 +1561,11 @@ VDBRepository::perform_updates()
{
invalidate();
- if (_imp->params.provides_cache() != FSEntry("/var/empty"))
- if (_imp->params.provides_cache().is_regular_file_or_symlink_to_regular_file())
+ if (_imp->params.provides_cache() != FSPath("/var/empty"))
+ if (_imp->params.provides_cache().stat().is_regular_file_or_symlink_to_regular_file())
{
std::cout << std::endl << "Invalidating provides cache following updates" << std::endl;
- FSEntry(_imp->params.provides_cache()).unlink();
+ _imp->params.provides_cache().unlink();
regenerate_provides_cache();
}
@@ -1610,9 +1609,9 @@ VDBRepository::perform_updates()
if (! failed)
{
- cache_dir.mkdir();
+ cache_dir.mkdir(0755, { fspmkdo_ok_if_exists });
SafeOFStream cache_file_f(cache_file);
- for (std::map<FSEntry, std::time_t>::const_iterator it(update_timestamps.begin()),
+ for (std::map<FSPath, std::time_t, FSPathComparator>::const_iterator it(update_timestamps.begin()),
it_end(update_timestamps.end()); it_end != it; ++it)
cache_file_f << it->second << '\t' << it->first << std::endl;
}
diff --git a/paludis/repositories/e/vdb_repository.hh b/paludis/repositories/e/vdb_repository.hh
index 9b2f210..e79c53a 100644
--- a/paludis/repositories/e/vdb_repository.hh
+++ b/paludis/repositories/e/vdb_repository.hh
@@ -25,7 +25,6 @@
#include <paludis/action-fwd.hh>
#include <paludis/util/attributes.hh>
#include <paludis/util/pimp.hh>
-#include <paludis/util/fs_entry.hh>
#include <paludis/util/map.hh>
#include <paludis/repositories/e/e_repository_id.hh>
#include <memory>
@@ -54,14 +53,14 @@ namespace paludis
{
struct VDBRepositoryParams
{
- NamedValue<n::builddir, FSEntry> builddir;
+ NamedValue<n::builddir, FSPath> builddir;
NamedValue<n::eapi_when_unknown, std::string> eapi_when_unknown;
NamedValue<n::environment, Environment *> environment;
- NamedValue<n::location, FSEntry> location;
+ NamedValue<n::location, FSPath> location;
NamedValue<n::name, RepositoryName> name;
- NamedValue<n::names_cache, FSEntry> names_cache;
- NamedValue<n::provides_cache, FSEntry> provides_cache;
- NamedValue<n::root, FSEntry> root;
+ NamedValue<n::names_cache, FSPath> names_cache;
+ NamedValue<n::provides_cache, FSPath> provides_cache;
+ NamedValue<n::root, FSPath> root;
};
}
@@ -98,7 +97,7 @@ namespace paludis
PALUDIS_ATTRIBUTE((warn_unused_result));
const std::shared_ptr<const erepository::ERepositoryID> make_id(const QualifiedPackageName &, const VersionSpec &,
- const FSEntry &) const
+ const FSPath &) const
PALUDIS_ATTRIBUTE((warn_unused_result));
protected:
@@ -161,8 +160,8 @@ namespace paludis
/* Keys */
virtual const std::shared_ptr<const MetadataValueKey<std::string> > format_key() const;
- virtual const std::shared_ptr<const MetadataValueKey<FSEntry> > location_key() const;
- virtual const std::shared_ptr<const MetadataValueKey<FSEntry> > installed_root_key() const;
+ virtual const std::shared_ptr<const MetadataValueKey<FSPath> > location_key() const;
+ virtual const std::shared_ptr<const MetadataValueKey<FSPath> > installed_root_key() const;
virtual const std::shared_ptr<const MetadataValueKey<std::string> > accept_keywords_key() const;
virtual const std::shared_ptr<const MetadataValueKey<std::string> > sync_host_key() const;
diff --git a/paludis/repositories/e/vdb_repository_TEST.cc b/paludis/repositories/e/vdb_repository_TEST.cc
index 0178626..f6f616f 100644
--- a/paludis/repositories/e/vdb_repository_TEST.cc
+++ b/paludis/repositories/e/vdb_repository_TEST.cc
@@ -25,10 +25,11 @@
#include <paludis/metadata_key.hh>
#include <paludis/util/sequence.hh>
#include <paludis/util/options.hh>
-#include <paludis/util/dir_iterator.hh>
#include <paludis/util/make_named_values.hh>
#include <paludis/util/accept_visitor.hh>
#include <paludis/util/safe_ifstream.hh>
+#include <paludis/util/fs_iterator.hh>
+#include <paludis/util/fs_stat.hh>
#include <paludis/standard_output_manager.hh>
#include <paludis/generator.hh>
#include <paludis/filter.hh>
@@ -81,7 +82,7 @@ namespace
return wp_yes;
}
- bool ignore_nothing(const FSEntry &)
+ bool ignore_nothing(const FSPath &)
{
return false;
}
@@ -101,8 +102,8 @@ namespace test_cases
keys->insert("format", "vdb");
keys->insert("names_cache", "/var/empty");
keys->insert("provides_cache", "/var/empty");
- keys->insert("location", stringify(FSEntry::cwd() / "vdb_repository_TEST_dir" / "repo1"));
- keys->insert("builddir", stringify(FSEntry::cwd() / "vdb_repository_TEST_dir" / "build"));
+ keys->insert("location", stringify(FSPath::cwd() / "vdb_repository_TEST_dir" / "repo1"));
+ keys->insert("builddir", stringify(FSPath::cwd() / "vdb_repository_TEST_dir" / "build"));
std::shared_ptr<Repository> repo(VDBRepository::VDBRepository::repository_factory_create(&env,
std::bind(from_keys, keys, std::placeholders::_1)));
TEST_CHECK_STRINGIFY_EQUAL(repo->name(), "installed");
@@ -121,8 +122,8 @@ namespace test_cases
keys->insert("format", "vdb");
keys->insert("names_cache", "/var/empty");
keys->insert("provides_cache", "/var/empty");
- keys->insert("location", stringify(FSEntry::cwd() / "vdb_repository_TEST_dir" / "repo1"));
- keys->insert("builddir", stringify(FSEntry::cwd() / "vdb_repository_TEST_dir" / "build"));
+ keys->insert("location", stringify(FSPath::cwd() / "vdb_repository_TEST_dir" / "repo1"));
+ keys->insert("builddir", stringify(FSPath::cwd() / "vdb_repository_TEST_dir" / "build"));
std::shared_ptr<Repository> repo(VDBRepository::VDBRepository::repository_factory_create(&env,
std::bind(from_keys, keys, std::placeholders::_1)));
@@ -144,8 +145,8 @@ namespace test_cases
keys->insert("format", "vdb");
keys->insert("names_cache", "/var/empty");
keys->insert("provides_cache", "/var/empty");
- keys->insert("location", stringify(FSEntry::cwd() / "vdb_repository_TEST_dir" / "repo1"));
- keys->insert("builddir", stringify(FSEntry::cwd() / "vdb_repository_TEST_dir" / "build"));
+ keys->insert("location", stringify(FSPath::cwd() / "vdb_repository_TEST_dir" / "repo1"));
+ keys->insert("builddir", stringify(FSPath::cwd() / "vdb_repository_TEST_dir" / "build"));
std::shared_ptr<Repository> repo(VDBRepository::VDBRepository::repository_factory_create(&env,
std::bind(from_keys, keys, std::placeholders::_1)));
env.package_database()->add_repository(1, repo);
@@ -214,9 +215,9 @@ namespace test_cases
keys->insert("format", "vdb");
keys->insert("names_cache", "/var/empty");
keys->insert("provides_cache", "/var/empty");
- keys->insert("location", stringify(FSEntry::cwd() / "vdb_repository_TEST_dir" / "repo1"));
- keys->insert("builddir", stringify(FSEntry::cwd() / "vdb_repository_TEST_dir" / "build"));
- keys->insert("world", stringify(FSEntry::cwd() / "vdb_repository_TEST_dir" / "world-no-match-no-eol"));
+ keys->insert("location", stringify(FSPath::cwd() / "vdb_repository_TEST_dir" / "repo1"));
+ keys->insert("builddir", stringify(FSPath::cwd() / "vdb_repository_TEST_dir" / "build"));
+ keys->insert("world", stringify(FSPath::cwd() / "vdb_repository_TEST_dir" / "world-no-match-no-eol"));
std::shared_ptr<Repository> repo(VDBRepository::VDBRepository::repository_factory_create(&env,
std::bind(from_keys, keys, std::placeholders::_1)));
env.package_database()->add_repository(1, repo);
@@ -269,8 +270,8 @@ namespace test_cases
keys->insert("format", "vdb");
keys->insert("names_cache", "/var/empty");
keys->insert("provides_cache", "/var/empty");
- keys->insert("location", stringify(FSEntry::cwd() / "vdb_repository_TEST_dir" / "repo2"));
- keys->insert("builddir", stringify(FSEntry::cwd() / "vdb_repository_TEST_dir" / "build"));
+ keys->insert("location", stringify(FSPath::cwd() / "vdb_repository_TEST_dir" / "repo2"));
+ keys->insert("builddir", stringify(FSPath::cwd() / "vdb_repository_TEST_dir" / "build"));
std::shared_ptr<Repository> repo(VDBRepository::VDBRepository::repository_factory_create(&env,
std::bind(from_keys, keys, std::placeholders::_1)));
env.package_database()->add_repository(1, repo);
@@ -325,15 +326,15 @@ namespace test_cases
std::shared_ptr<Map<std::string, std::string> > keys(std::make_shared<Map<std::string, std::string>>());
keys->insert("format", "e");
keys->insert("names_cache", "/var/empty");
- keys->insert("location", stringify(FSEntry::cwd() / "vdb_repository_TEST_dir" / "srcrepo"));
- keys->insert("profiles", stringify(FSEntry::cwd() / "vdb_repository_TEST_dir" / "srcrepo/profiles/profile"));
+ keys->insert("location", stringify(FSPath::cwd() / "vdb_repository_TEST_dir" / "srcrepo"));
+ keys->insert("profiles", stringify(FSPath::cwd() / "vdb_repository_TEST_dir" / "srcrepo/profiles/profile"));
keys->insert("layout", "traditional");
keys->insert("eapi_when_unknown", eapi);
keys->insert("eapi_when_unspecified", eapi);
keys->insert("profile_eapi", "0");
- keys->insert("distdir", stringify(FSEntry::cwd() / "vdb_repository_TEST_dir" / "distdir"));
- keys->insert("builddir", stringify(FSEntry::cwd() / "vdb_repository_TEST_dir" / "build"));
- keys->insert("root", stringify(FSEntry("vdb_repository_TEST_dir/root").realpath()));
+ keys->insert("distdir", stringify(FSPath::cwd() / "vdb_repository_TEST_dir" / "distdir"));
+ keys->insert("builddir", stringify(FSPath::cwd() / "vdb_repository_TEST_dir" / "build"));
+ keys->insert("root", stringify(FSPath("vdb_repository_TEST_dir/root").realpath()));
std::shared_ptr<Repository> repo(ERepository::repository_factory_create(&env,
std::bind(from_keys, keys, std::placeholders::_1)));
env.package_database()->add_repository(1, repo);
@@ -342,9 +343,9 @@ namespace test_cases
keys->insert("format", "vdb");
keys->insert("names_cache", "/var/empty");
keys->insert("provides_cache", "/var/empty");
- keys->insert("location", stringify(FSEntry::cwd() / "vdb_repository_TEST_dir" / "repo3"));
- keys->insert("builddir", stringify(FSEntry::cwd() / "vdb_repository_TEST_dir" / "build"));
- keys->insert("root", stringify(FSEntry("vdb_repository_TEST_dir/root").realpath()));
+ keys->insert("location", stringify(FSPath::cwd() / "vdb_repository_TEST_dir" / "repo3"));
+ keys->insert("builddir", stringify(FSPath::cwd() / "vdb_repository_TEST_dir" / "build"));
+ keys->insert("root", stringify(FSPath("vdb_repository_TEST_dir/root").realpath()));
std::shared_ptr<Repository> vdb_repo(VDBRepository::VDBRepository::repository_factory_create(&env,
std::bind(from_keys, keys, std::placeholders::_1)));
env.package_database()->add_repository(0, vdb_repo);
@@ -455,15 +456,15 @@ namespace test_cases
std::shared_ptr<Map<std::string, std::string> > keys(std::make_shared<Map<std::string, std::string>>());
keys->insert("format", "e");
keys->insert("names_cache", "/var/empty");
- keys->insert("location", stringify(FSEntry::cwd() / "vdb_repository_TEST_dir" / "srcrepo"));
- keys->insert("profiles", stringify(FSEntry::cwd() / "vdb_repository_TEST_dir" / "srcrepo/profiles/profile"));
+ keys->insert("location", stringify(FSPath::cwd() / "vdb_repository_TEST_dir" / "srcrepo"));
+ keys->insert("profiles", stringify(FSPath::cwd() / "vdb_repository_TEST_dir" / "srcrepo/profiles/profile"));
keys->insert("layout", "traditional");
keys->insert("eapi_when_unknown", eapi);
keys->insert("eapi_when_unspecified", eapi);
keys->insert("profile_eapi", "0");
- keys->insert("distdir", stringify(FSEntry::cwd() / "vdb_repository_TEST_dir" / "distdir"));
- keys->insert("builddir", stringify(FSEntry::cwd() / "vdb_repository_TEST_dir" / "build"));
- keys->insert("root", stringify(FSEntry("vdb_repository_TEST_dir/root").realpath()));
+ keys->insert("distdir", stringify(FSPath::cwd() / "vdb_repository_TEST_dir" / "distdir"));
+ keys->insert("builddir", stringify(FSPath::cwd() / "vdb_repository_TEST_dir" / "build"));
+ keys->insert("root", stringify(FSPath("vdb_repository_TEST_dir/root").realpath()));
std::shared_ptr<Repository> repo(ERepository::repository_factory_create(&env,
std::bind(from_keys, keys, std::placeholders::_1)));
env.package_database()->add_repository(1, repo);
@@ -472,9 +473,9 @@ namespace test_cases
keys->insert("format", "vdb");
keys->insert("names_cache", "/var/empty");
keys->insert("provides_cache", "/var/empty");
- keys->insert("location", stringify(FSEntry::cwd() / "vdb_repository_TEST_dir" / "repo3"));
- keys->insert("builddir", stringify(FSEntry::cwd() / "vdb_repository_TEST_dir" / "build"));
- keys->insert("root", stringify(FSEntry("vdb_repository_TEST_dir/root").realpath()));
+ keys->insert("location", stringify(FSPath::cwd() / "vdb_repository_TEST_dir" / "repo3"));
+ keys->insert("builddir", stringify(FSPath::cwd() / "vdb_repository_TEST_dir" / "build"));
+ keys->insert("root", stringify(FSPath("vdb_repository_TEST_dir/root").realpath()));
std::shared_ptr<Repository> vdb_repo(VDBRepository::VDBRepository::repository_factory_create(&env,
std::bind(from_keys, keys, std::placeholders::_1)));
env.package_database()->add_repository(0, vdb_repo);
@@ -560,11 +561,11 @@ namespace test_cases
struct NamesCacheIncrementalTest : TestCase
{
- FSEntry names_cache;
+ FSPath names_cache;
NamesCacheIncrementalTest() :
TestCase("names cache incremental"),
- names_cache(stringify(FSEntry::cwd() / "vdb_repository_TEST_dir" / "namesincrtest/.cache/names/installed"))
+ names_cache(stringify(FSPath::cwd() / "vdb_repository_TEST_dir" / "namesincrtest/.cache/names/installed"))
{
}
@@ -607,15 +608,15 @@ namespace test_cases
std::shared_ptr<Map<std::string, std::string> > keys(std::make_shared<Map<std::string, std::string>>());
keys->insert("format", "e");
keys->insert("names_cache", "/var/empty");
- keys->insert("location", stringify(FSEntry::cwd() / "vdb_repository_TEST_dir" / "namesincrtest_src"));
- keys->insert("profiles", stringify(FSEntry::cwd() / "vdb_repository_TEST_dir" / "namesincrtest_src/profiles/profile"));
+ keys->insert("location", stringify(FSPath::cwd() / "vdb_repository_TEST_dir" / "namesincrtest_src"));
+ keys->insert("profiles", stringify(FSPath::cwd() / "vdb_repository_TEST_dir" / "namesincrtest_src/profiles/profile"));
keys->insert("layout", "traditional");
keys->insert("eapi_when_unknown", "0");
keys->insert("eapi_when_unspecified", "0");
keys->insert("profile_eapi", "0");
- keys->insert("distdir", stringify(FSEntry::cwd() / "vdb_repository_TEST_dir" / "distdir"));
- keys->insert("builddir", stringify(FSEntry::cwd() / "vdb_repository_TEST_dir" / "build"));
- keys->insert("root", stringify(FSEntry("vdb_repository_TEST_dir/root").realpath()));
+ keys->insert("distdir", stringify(FSPath::cwd() / "vdb_repository_TEST_dir" / "distdir"));
+ keys->insert("builddir", stringify(FSPath::cwd() / "vdb_repository_TEST_dir" / "build"));
+ keys->insert("root", stringify(FSPath("vdb_repository_TEST_dir/root").realpath()));
std::shared_ptr<Repository> repo(ERepository::repository_factory_create(&env,
std::bind(from_keys, keys, std::placeholders::_1)));
env.package_database()->add_repository(1, repo);
@@ -624,9 +625,9 @@ namespace test_cases
keys->insert("format", "vdb");
keys->insert("names_cache", stringify(names_cache.dirname()));
keys->insert("provides_cache", "/var/empty");
- keys->insert("location", stringify(FSEntry::cwd() / "vdb_repository_TEST_dir" / "namesincrtest"));
- keys->insert("builddir", stringify(FSEntry::cwd() / "vdb_repository_TEST_dir" / "build"));
- keys->insert("root", stringify(FSEntry("vdb_repository_TEST_dir/root").realpath()));
+ keys->insert("location", stringify(FSPath::cwd() / "vdb_repository_TEST_dir" / "namesincrtest"));
+ keys->insert("builddir", stringify(FSPath::cwd() / "vdb_repository_TEST_dir" / "build"));
+ keys->insert("root", stringify(FSPath("vdb_repository_TEST_dir/root").realpath()));
std::shared_ptr<Repository> vdb_repo(VDBRepository::VDBRepository::repository_factory_create(&env,
std::bind(from_keys, keys, std::placeholders::_1)));
env.package_database()->add_repository(0, vdb_repo);
@@ -640,7 +641,7 @@ namespace test_cases
));
{
- std::vector<FSEntry> cache_contents;
+ std::vector<FSPath> cache_contents;
read_cache(cache_contents);
TEST_CHECK_EQUAL(cache_contents.size(), 0U);
}
@@ -650,7 +651,7 @@ namespace test_cases
install(env, vdb_repo, "=cat1/pkg1-1::namesincrtest_src", "");
vdb_repo->invalidate();
- std::vector<FSEntry> cache_contents;
+ std::vector<FSPath> cache_contents;
read_cache(cache_contents);
TEST_CHECK_EQUAL(cache_contents.size(), 1U);
TEST_CHECK_EQUAL(cache_contents.front().basename(), "pkg1");
@@ -662,7 +663,7 @@ namespace test_cases
install(env, vdb_repo, "=cat1/pkg1-1::namesincrtest_src", "");
vdb_repo->invalidate();
- std::vector<FSEntry> cache_contents;
+ std::vector<FSPath> cache_contents;
read_cache(cache_contents);
TEST_CHECK_EQUAL(cache_contents.size(), 1U);
TEST_CHECK_EQUAL(cache_contents.front().basename(), "pkg1");
@@ -674,7 +675,7 @@ namespace test_cases
install(env, vdb_repo, "=cat1/pkg1-1.1::namesincrtest_src", "=cat1/pkg1-1::installed");
vdb_repo->invalidate();
- std::vector<FSEntry> cache_contents;
+ std::vector<FSPath> cache_contents;
read_cache(cache_contents);
TEST_CHECK_EQUAL(cache_contents.size(), 1U);
TEST_CHECK_EQUAL(cache_contents.front().basename(), "pkg1");
@@ -686,7 +687,7 @@ namespace test_cases
install(env, vdb_repo, "=cat1/pkg1-1::namesincrtest_src", "=cat1/pkg1-1.1::installed");
vdb_repo->invalidate();
- std::vector<FSEntry> cache_contents;
+ std::vector<FSPath> cache_contents;
read_cache(cache_contents);
TEST_CHECK_EQUAL(cache_contents.size(), 1U);
TEST_CHECK_EQUAL(cache_contents.front().basename(), "pkg1");
@@ -698,7 +699,7 @@ namespace test_cases
install(env, vdb_repo, "=cat1/pkg1-2::namesincrtest_src", "");
vdb_repo->invalidate();
- std::vector<FSEntry> cache_contents;
+ std::vector<FSPath> cache_contents;
read_cache(cache_contents);
TEST_CHECK_EQUAL(cache_contents.size(), 1U);
TEST_CHECK_EQUAL(cache_contents.front().basename(), "pkg1");
@@ -713,7 +714,7 @@ namespace test_cases
inst_id->perform_action(uninstall_action);
vdb_repo->invalidate();
- std::vector<FSEntry> cache_contents;
+ std::vector<FSPath> cache_contents;
read_cache(cache_contents);
TEST_CHECK_EQUAL(cache_contents.size(), 1U);
TEST_CHECK_EQUAL(cache_contents.front().basename(), "pkg1");
@@ -725,7 +726,7 @@ namespace test_cases
install(env, vdb_repo, "=cat1/pkg2-1::namesincrtest_src", "");
vdb_repo->invalidate();
- std::vector<FSEntry> cache_contents;
+ std::vector<FSPath> cache_contents;
read_cache(cache_contents);
TEST_CHECK_EQUAL(cache_contents.size(), 2U);
TEST_CHECK_EQUAL(cache_contents.front().basename(), "pkg1");
@@ -742,7 +743,7 @@ namespace test_cases
inst_id->perform_action(uninstall_action);
vdb_repo->invalidate();
- std::vector<FSEntry> cache_contents;
+ std::vector<FSPath> cache_contents;
read_cache(cache_contents);
TEST_CHECK_EQUAL(cache_contents.size(), 1U);
TEST_CHECK_EQUAL(cache_contents.front().basename(), "pkg1");
@@ -754,7 +755,7 @@ namespace test_cases
install(env, vdb_repo, "=cat2/pkg1-1::namesincrtest_src", "");
vdb_repo->invalidate();
- std::vector<FSEntry> cache_contents;
+ std::vector<FSPath> cache_contents;
read_cache(cache_contents);
TEST_CHECK_EQUAL(cache_contents.size(), 1U);
TEST_CHECK_EQUAL(cache_contents.front().basename(), "pkg1");
@@ -769,7 +770,7 @@ namespace test_cases
inst_id->perform_action(uninstall_action);
vdb_repo->invalidate();
- std::vector<FSEntry> cache_contents;
+ std::vector<FSPath> cache_contents;
read_cache(cache_contents);
TEST_CHECK_EQUAL(cache_contents.size(), 1U);
TEST_CHECK_EQUAL(cache_contents.front().basename(), "pkg1");
@@ -784,7 +785,7 @@ namespace test_cases
inst_id->perform_action(uninstall_action);
vdb_repo->invalidate();
- std::vector<FSEntry> cache_contents;
+ std::vector<FSPath> cache_contents;
read_cache(cache_contents);
TEST_CHECK_EQUAL(cache_contents.size(), 0U);
}
@@ -794,7 +795,7 @@ namespace test_cases
install(env, vdb_repo, "=cat3/pkg1-1::namesincrtest_src", "");
vdb_repo->invalidate();
- std::vector<FSEntry> cache_contents;
+ std::vector<FSPath> cache_contents;
read_cache(cache_contents);
TEST_CHECK_EQUAL(cache_contents.size(), 1U);
TEST_CHECK_EQUAL(cache_contents.front().basename(), "pkg1");
@@ -806,7 +807,7 @@ namespace test_cases
install(env, vdb_repo, "=cat3/pkg1-2::namesincrtest_src", "=cat3/pkg1-1::installed");
vdb_repo->invalidate();
- std::vector<FSEntry> cache_contents;
+ std::vector<FSPath> cache_contents;
read_cache(cache_contents);
TEST_CHECK_EQUAL(cache_contents.size(), 1U);
TEST_CHECK_EQUAL(cache_contents.front().basename(), "pkg1");
@@ -814,17 +815,17 @@ namespace test_cases
}
}
- void read_cache(std::vector<FSEntry> & vec)
+ void read_cache(std::vector<FSPath> & vec)
{
using namespace std::placeholders;
- std::remove_copy_if(DirIterator(names_cache, { dio_include_dotfiles }),
- DirIterator(), std::back_inserter(vec),
+ std::remove_copy_if(FSIterator(names_cache, { fsio_include_dotfiles }),
+ FSIterator(), std::back_inserter(vec),
std::bind(&std::equal_to<std::string>::operator(),
std::equal_to<std::string>(),
- "_VERSION_", std::bind(&FSEntry::basename, _1)));
+ "_VERSION_", std::bind(&FSPath::basename, _1)));
}
- std::string read_file(const FSEntry & f)
+ std::string read_file(const FSPath & f)
{
SafeIFStream s(f);
std::stringstream ss;
@@ -836,11 +837,11 @@ namespace test_cases
struct ProvidesCacheTest : TestCase
{
- FSEntry provides_cache;
+ FSPath provides_cache;
ProvidesCacheTest() :
TestCase("provides cache"),
- provides_cache(stringify(FSEntry::cwd() / "vdb_repository_TEST_dir" / "providestest/.cache/provides"))
+ provides_cache(stringify(FSPath::cwd() / "vdb_repository_TEST_dir" / "providestest/.cache/provides"))
{
}
@@ -858,14 +859,14 @@ namespace test_cases
keys->insert("format", "vdb");
keys->insert("names_cache", "/var/empty");
keys->insert("provides_cache", stringify(provides_cache));
- keys->insert("location", stringify(FSEntry::cwd() / "vdb_repository_TEST_dir" / "providestest"));
- keys->insert("builddir", stringify(FSEntry::cwd() / "vdb_repository_TEST_dir" / "build"));
- keys->insert("root", stringify(FSEntry("vdb_repository_TEST_dir/root").realpath()));
+ keys->insert("location", stringify(FSPath::cwd() / "vdb_repository_TEST_dir" / "providestest"));
+ keys->insert("builddir", stringify(FSPath::cwd() / "vdb_repository_TEST_dir" / "build"));
+ keys->insert("root", stringify(FSPath("vdb_repository_TEST_dir/root").realpath()));
std::shared_ptr<Repository> vdb_repo(VDBRepository::VDBRepository::repository_factory_create(&env,
std::bind(from_keys, keys, std::placeholders::_1)));
env.package_database()->add_repository(0, vdb_repo);
- TEST_CHECK(! provides_cache.exists());
+ TEST_CHECK(! provides_cache.stat().exists());
{
std::shared_ptr<const RepositoryProvidesInterface::ProvidesSequence> seq(vdb_repo->provides_interface()->provided_packages());
@@ -897,6 +898,10 @@ namespace test_cases
std::shared_ptr<const RepositoryProvidesInterface::ProvidesSequence> seq(vdb_repo->provides_interface()->provided_packages());
TEST_CHECK_EQUAL(std::distance(seq->begin(), seq->end()), 5);
+ for (auto i(seq->begin()), i_end(seq->end()) ;
+ i != i_end ; ++i)
+ TEST_CHECK(! stringify(i->provided_by()->slot_key()->value()).empty());
+
RepositoryProvidesInterface::ProvidesSequence::ConstIterator it(seq->begin());
TEST_CHECK_STRINGIFY_EQUAL(it->virtual_name(), "virtual/foo");
TEST_CHECK_STRINGIFY_EQUAL(*(*it++).provided_by(), "cat1/pkg1-1:1::installed");
@@ -911,7 +916,7 @@ namespace test_cases
}
}
- std::string read_file(const FSEntry & f)
+ std::string read_file(const FSPath & f)
{
SafeIFStream s(f);
std::stringstream ss;
@@ -923,11 +928,11 @@ namespace test_cases
struct ProvidesCacheIncrementalTest : TestCase
{
- FSEntry provides_cache;
+ FSPath provides_cache;
ProvidesCacheIncrementalTest() :
TestCase("provides cache incremental"),
- provides_cache(stringify(FSEntry::cwd() / "vdb_repository_TEST_dir" / "providesincrtest/.cache/provides"))
+ provides_cache(stringify(FSPath::cwd() / "vdb_repository_TEST_dir" / "providesincrtest/.cache/provides"))
{
}
@@ -970,15 +975,15 @@ namespace test_cases
std::shared_ptr<Map<std::string, std::string> > keys(std::make_shared<Map<std::string, std::string>>());
keys->insert("format", "e");
keys->insert("names_cache", "/var/empty");
- keys->insert("location", stringify(FSEntry::cwd() / "vdb_repository_TEST_dir" / "providesincrtest_src1"));
- keys->insert("profiles", stringify(FSEntry::cwd() / "vdb_repository_TEST_dir" / "providesincrtest_src1/profiles/profile"));
+ keys->insert("location", stringify(FSPath::cwd() / "vdb_repository_TEST_dir" / "providesincrtest_src1"));
+ keys->insert("profiles", stringify(FSPath::cwd() / "vdb_repository_TEST_dir" / "providesincrtest_src1/profiles/profile"));
keys->insert("layout", "traditional");
keys->insert("eapi_when_unknown", "0");
keys->insert("eapi_when_unspecified", "0");
keys->insert("profile_eapi", "0");
- keys->insert("distdir", stringify(FSEntry::cwd() / "vdb_repository_TEST_dir" / "distdir"));
- keys->insert("builddir", stringify(FSEntry::cwd() / "vdb_repository_TEST_dir" / "build"));
- keys->insert("root", stringify(FSEntry("vdb_repository_TEST_dir/root").realpath()));
+ keys->insert("distdir", stringify(FSPath::cwd() / "vdb_repository_TEST_dir" / "distdir"));
+ keys->insert("builddir", stringify(FSPath::cwd() / "vdb_repository_TEST_dir" / "build"));
+ keys->insert("root", stringify(FSPath("vdb_repository_TEST_dir/root").realpath()));
std::shared_ptr<Repository> repo1(ERepository::repository_factory_create(&env,
std::bind(from_keys, keys, std::placeholders::_1)));
env.package_database()->add_repository(1, repo1);
@@ -986,15 +991,15 @@ namespace test_cases
keys = std::make_shared<Map<std::string, std::string>>();
keys->insert("format", "e");
keys->insert("names_cache", "/var/empty");
- keys->insert("location", stringify(FSEntry::cwd() / "vdb_repository_TEST_dir" / "providesincrtest_src2"));
- keys->insert("profiles", stringify(FSEntry::cwd() / "vdb_repository_TEST_dir" / "providesincrtest_src1/profiles/profile"));
+ keys->insert("location", stringify(FSPath::cwd() / "vdb_repository_TEST_dir" / "providesincrtest_src2"));
+ keys->insert("profiles", stringify(FSPath::cwd() / "vdb_repository_TEST_dir" / "providesincrtest_src1/profiles/profile"));
keys->insert("layout", "traditional");
keys->insert("eapi_when_unknown", "0");
keys->insert("eapi_when_unspecified", "0");
keys->insert("profile_eapi", "0");
- keys->insert("distdir", stringify(FSEntry::cwd() / "vdb_repository_TEST_dir" / "distdir"));
- keys->insert("builddir", stringify(FSEntry::cwd() / "vdb_repository_TEST_dir" / "build"));
- keys->insert("root", stringify(FSEntry("vdb_repository_TEST_dir/root").realpath()));
+ keys->insert("distdir", stringify(FSPath::cwd() / "vdb_repository_TEST_dir" / "distdir"));
+ keys->insert("builddir", stringify(FSPath::cwd() / "vdb_repository_TEST_dir" / "build"));
+ keys->insert("root", stringify(FSPath("vdb_repository_TEST_dir/root").realpath()));
std::shared_ptr<Repository> repo2(ERepository::repository_factory_create(&env,
std::bind(from_keys, keys, std::placeholders::_1)));
env.package_database()->add_repository(2, repo2);
@@ -1003,9 +1008,9 @@ namespace test_cases
keys->insert("format", "vdb");
keys->insert("names_cache", "/var/empty");
keys->insert("provides_cache", stringify(provides_cache));
- keys->insert("location", stringify(FSEntry::cwd() / "vdb_repository_TEST_dir" / "providesincrtest"));
- keys->insert("builddir", stringify(FSEntry::cwd() / "vdb_repository_TEST_dir" / "build"));
- keys->insert("root", stringify(FSEntry("vdb_repository_TEST_dir/root").realpath()));
+ keys->insert("location", stringify(FSPath::cwd() / "vdb_repository_TEST_dir" / "providesincrtest"));
+ keys->insert("builddir", stringify(FSPath::cwd() / "vdb_repository_TEST_dir" / "build"));
+ keys->insert("root", stringify(FSPath("vdb_repository_TEST_dir/root").realpath()));
std::shared_ptr<Repository> vdb_repo(VDBRepository::VDBRepository::repository_factory_create(&env,
std::bind(from_keys, keys, std::placeholders::_1)));
env.package_database()->add_repository(0, vdb_repo);
@@ -1134,7 +1139,7 @@ namespace test_cases
}
}
- std::string read_file(const FSEntry & f)
+ std::string read_file(const FSPath & f)
{
SafeIFStream s(f);
std::stringstream ss;
@@ -1165,15 +1170,15 @@ namespace test_cases
std::shared_ptr<Map<std::string, std::string> > keys(std::make_shared<Map<std::string, std::string>>());
keys->insert("format", "e");
keys->insert("names_cache", "/var/empty");
- keys->insert("location", stringify(FSEntry::cwd() / "vdb_repository_TEST_dir" / "reinstalltest_src1"));
- keys->insert("profiles", stringify(FSEntry::cwd() / "vdb_repository_TEST_dir" / "reinstalltest_src1/profiles/profile"));
+ keys->insert("location", stringify(FSPath::cwd() / "vdb_repository_TEST_dir" / "reinstalltest_src1"));
+ keys->insert("profiles", stringify(FSPath::cwd() / "vdb_repository_TEST_dir" / "reinstalltest_src1/profiles/profile"));
keys->insert("layout", "traditional");
keys->insert("eapi_when_unknown", "0");
keys->insert("eapi_when_unspecified", "0");
keys->insert("profile_eapi", "0");
- keys->insert("distdir", stringify(FSEntry::cwd() / "vdb_repository_TEST_dir" / "distdir"));
- keys->insert("builddir", stringify(FSEntry::cwd() / "vdb_repository_TEST_dir" / "build"));
- keys->insert("root", stringify(FSEntry("vdb_repository_TEST_dir/root").realpath()));
+ keys->insert("distdir", stringify(FSPath::cwd() / "vdb_repository_TEST_dir" / "distdir"));
+ keys->insert("builddir", stringify(FSPath::cwd() / "vdb_repository_TEST_dir" / "build"));
+ keys->insert("root", stringify(FSPath("vdb_repository_TEST_dir/root").realpath()));
std::shared_ptr<Repository> repo1(ERepository::repository_factory_create(&env,
std::bind(from_keys, keys, std::placeholders::_1)));
env.package_database()->add_repository(1, repo1);
@@ -1181,15 +1186,15 @@ namespace test_cases
keys = std::make_shared<Map<std::string, std::string>>();
keys->insert("format", "e");
keys->insert("names_cache", "/var/empty");
- keys->insert("location", stringify(FSEntry::cwd() / "vdb_repository_TEST_dir" / "reinstalltest_src2"));
- keys->insert("profiles", stringify(FSEntry::cwd() / "vdb_repository_TEST_dir" / "reinstalltest_src1/profiles/profile"));
+ keys->insert("location", stringify(FSPath::cwd() / "vdb_repository_TEST_dir" / "reinstalltest_src2"));
+ keys->insert("profiles", stringify(FSPath::cwd() / "vdb_repository_TEST_dir" / "reinstalltest_src1/profiles/profile"));
keys->insert("layout", "traditional");
keys->insert("eapi_when_unknown", "0");
keys->insert("eapi_when_unspecified", "0");
keys->insert("profile_eapi", "0");
- keys->insert("distdir", stringify(FSEntry::cwd() / "vdb_repository_TEST_dir" / "distdir"));
- keys->insert("builddir", stringify(FSEntry::cwd() / "vdb_repository_TEST_dir" / "build"));
- keys->insert("root", stringify(FSEntry("vdb_repository_TEST_dir/root").realpath()));
+ keys->insert("distdir", stringify(FSPath::cwd() / "vdb_repository_TEST_dir" / "distdir"));
+ keys->insert("builddir", stringify(FSPath::cwd() / "vdb_repository_TEST_dir" / "build"));
+ keys->insert("root", stringify(FSPath("vdb_repository_TEST_dir/root").realpath()));
std::shared_ptr<Repository> repo2(ERepository::repository_factory_create(&env,
std::bind(from_keys, keys, std::placeholders::_1)));
env.package_database()->add_repository(2, repo2);
@@ -1198,9 +1203,9 @@ namespace test_cases
keys->insert("format", "vdb");
keys->insert("names_cache", "/var/empty");
keys->insert("provides_cache", "/var/empty");
- keys->insert("location", stringify(FSEntry::cwd() / "vdb_repository_TEST_dir" / "reinstalltest"));
- keys->insert("builddir", stringify(FSEntry::cwd() / "vdb_repository_TEST_dir" / "build"));
- keys->insert("root", stringify(FSEntry("vdb_repository_TEST_dir/root").realpath()));
+ keys->insert("location", stringify(FSPath::cwd() / "vdb_repository_TEST_dir" / "reinstalltest"));
+ keys->insert("builddir", stringify(FSPath::cwd() / "vdb_repository_TEST_dir" / "build"));
+ keys->insert("root", stringify(FSPath("vdb_repository_TEST_dir/root").realpath()));
std::shared_ptr<Repository> vdb_repo(VDBRepository::VDBRepository::repository_factory_create(&env,
std::bind(from_keys, keys, std::placeholders::_1)));
env.package_database()->add_repository(0, vdb_repo);
@@ -1291,20 +1296,20 @@ namespace test_cases
void run()
{
- TestEnvironment env(FSEntry(stringify(FSEntry::cwd() / "vdb_repository_TEST_dir" / "root")).realpath());
+ TestEnvironment env(FSPath(stringify(FSPath::cwd() / "vdb_repository_TEST_dir" / "root")).realpath());
env.set_paludis_command("/bin/false");
std::shared_ptr<Map<std::string, std::string> > keys(std::make_shared<Map<std::string, std::string>>());
keys->insert("format", "e");
keys->insert("names_cache", "/var/empty");
- keys->insert("location", stringify(FSEntry::cwd() / "vdb_repository_TEST_dir" / "postinsttest_src1"));
- keys->insert("profiles", stringify(FSEntry::cwd() / "vdb_repository_TEST_dir" / "postinsttest_src1/profiles/profile"));
+ keys->insert("location", stringify(FSPath::cwd() / "vdb_repository_TEST_dir" / "postinsttest_src1"));
+ keys->insert("profiles", stringify(FSPath::cwd() / "vdb_repository_TEST_dir" / "postinsttest_src1/profiles/profile"));
keys->insert("layout", "traditional");
keys->insert("eapi_when_unknown", "0");
keys->insert("eapi_when_unspecified", "0");
keys->insert("profile_eapi", "0");
- keys->insert("distdir", stringify(FSEntry::cwd() / "vdb_repository_TEST_dir" / "distdir"));
- keys->insert("builddir", stringify(FSEntry::cwd() / "vdb_repository_TEST_dir" / "build"));
- keys->insert("root", stringify(FSEntry("vdb_repository_TEST_dir/root").realpath()));
+ keys->insert("distdir", stringify(FSPath::cwd() / "vdb_repository_TEST_dir" / "distdir"));
+ keys->insert("builddir", stringify(FSPath::cwd() / "vdb_repository_TEST_dir" / "build"));
+ keys->insert("root", stringify(FSPath("vdb_repository_TEST_dir/root").realpath()));
std::shared_ptr<Repository> repo1(ERepository::repository_factory_create(&env,
std::bind(from_keys, keys, std::placeholders::_1)));
env.package_database()->add_repository(1, repo1);
@@ -1313,9 +1318,9 @@ namespace test_cases
keys->insert("format", "vdb");
keys->insert("names_cache", "/var/empty");
keys->insert("provides_cache", "/var/empty");
- keys->insert("location", stringify(FSEntry::cwd() / "vdb_repository_TEST_dir" / "postinsttest"));
- keys->insert("builddir", stringify(FSEntry::cwd() / "vdb_repository_TEST_dir" / "build"));
- keys->insert("root", stringify(FSEntry("vdb_repository_TEST_dir/root").realpath()));
+ keys->insert("location", stringify(FSPath::cwd() / "vdb_repository_TEST_dir" / "postinsttest"));
+ keys->insert("builddir", stringify(FSPath::cwd() / "vdb_repository_TEST_dir" / "build"));
+ keys->insert("root", stringify(FSPath("vdb_repository_TEST_dir/root").realpath()));
std::shared_ptr<Repository> vdb_repo(VDBRepository::VDBRepository::repository_factory_create(&env,
std::bind(from_keys, keys, std::placeholders::_1)));
env.package_database()->add_repository(0, vdb_repo);
diff --git a/paludis/repositories/e/vdb_unmerger.cc b/paludis/repositories/e/vdb_unmerger.cc
index 710321d..8799dc2 100644
--- a/paludis/repositories/e/vdb_unmerger.cc
+++ b/paludis/repositories/e/vdb_unmerger.cc
@@ -30,7 +30,6 @@ using namespace paludis;
#include <paludis/package_database.hh>
#include <paludis/package_id.hh>
#include <paludis/metadata_key.hh>
-#include <paludis/util/dir_iterator.hh>
#include <paludis/util/join.hh>
#include <paludis/util/wrapped_forward_iterator.hh>
#include <paludis/util/log.hh>
@@ -42,6 +41,8 @@ using namespace paludis;
#include <paludis/util/simple_visitor_cast.hh>
#include <paludis/util/set.hh>
#include <paludis/util/timestamp.hh>
+#include <paludis/util/fs_stat.hh>
+#include <paludis/util/fs_iterator.hh>
#include <paludis/output_manager.hh>
#include <paludis/util/safe_ifstream.hh>
@@ -87,7 +88,7 @@ VDBUnmerger::~VDBUnmerger()
Hook
VDBUnmerger::extend_hook(const Hook & h) const
{
- std::shared_ptr<const FSEntrySequence> bashrc_files(_imp->options.environment()->bashrc_files());
+ std::shared_ptr<const FSPathSequence> bashrc_files(_imp->options.environment()->bashrc_files());
Hook result(Unmerger::extend_hook(h)
("CONFIG_PROTECT", _imp->options.config_protect())
@@ -120,7 +121,7 @@ VDBUnmerger::extend_hook(const Hook & h) const
}
bool
-VDBUnmerger::config_protected(const FSEntry & f) const
+VDBUnmerger::config_protected(const FSPath & f) const
{
std::string tidy(make_tidy(f));
@@ -145,7 +146,7 @@ VDBUnmerger::config_protected(const FSEntry & f) const
}
std::string
-VDBUnmerger::make_tidy(const FSEntry & f) const
+VDBUnmerger::make_tidy(const FSPath & f) const
{
std::string root_str(stringify(_imp->options.root())), f_str(stringify(f));
if (root_str == "/")
@@ -219,12 +220,14 @@ namespace
bool
VDBUnmerger::check_file(const std::shared_ptr<const ContentsEntry> & e) const
{
- const FSEntry f(e->location_key()->value());
- if (! (_imp->options.root() / f).exists())
+ const FSPath f(e->location_key()->value());
+ const FSPath root_f(_imp->options.root() / f);
+ const FSStat root_f_stat(root_f);
+ if (! root_f_stat.exists())
display("--- [gone ] " + stringify(f));
- else if (! (_imp->options.root() / f).is_regular_file())
+ else if (! root_f_stat.is_regular_file())
display("--- [!type] " + stringify(f));
- else if ((_imp->options.root() / f).mtim().seconds() != require_key<MetadataTimeKey>(*e, "mtime").value().seconds())
+ else if (root_f_stat.mtim().seconds() != require_key<MetadataTimeKey>(*e, "mtime").value().seconds())
display("--- [!time] " + stringify(f));
else
{
@@ -252,15 +255,17 @@ VDBUnmerger::check_file(const std::shared_ptr<const ContentsEntry> & e) const
bool
VDBUnmerger::check_sym(const std::shared_ptr<const ContentsEntry> & e) const
{
- const FSEntry f(e->location_key()->value());
+ const FSPath f(e->location_key()->value());
+ const FSPath root_f(_imp->options.root() / f);
+ const FSStat root_f_stat(root_f);
- if (! (_imp->options.root() / f).exists())
+ if (! root_f_stat.exists())
display("--- [gone ] " + stringify(f));
- else if (! (_imp->options.root() / f).is_symbolic_link())
+ else if (! root_f_stat.is_symlink())
display("--- [!type] " + stringify(f));
- else if ((_imp->options.root() / f).mtim().seconds() != require_key<MetadataTimeKey>(*e, "mtime").value().seconds())
+ else if (root_f_stat.mtim().seconds() != require_key<MetadataTimeKey>(*e, "mtime").value().seconds())
display("--- [!time] " + stringify(f));
- else if ((_imp->options.root() / f).readlink() != require_key<MetadataValueKey<std::string> >(*e, "target").value())
+ else if (root_f.readlink() != require_key<MetadataValueKey<std::string> >(*e, "target").value())
display("--- [!dest] " + stringify(f));
else
return true;
@@ -271,9 +276,11 @@ VDBUnmerger::check_sym(const std::shared_ptr<const ContentsEntry> & e) const
bool
VDBUnmerger::check_misc(const std::shared_ptr<const ContentsEntry> & e) const
{
- const FSEntry f(e->location_key()->value());
+ const FSPath f(e->location_key()->value());
+ const FSPath root_f(_imp->options.root() / f);
+ const FSStat root_f_stat(root_f);
- if (! (_imp->options.root() / f).exists())
+ if (! root_f_stat.exists())
display("--- [gone ] " + stringify(f));
return false;
}
@@ -281,13 +288,15 @@ VDBUnmerger::check_misc(const std::shared_ptr<const ContentsEntry> & e) const
bool
VDBUnmerger::check_dir(const std::shared_ptr<const ContentsEntry> & e) const
{
- const FSEntry f(e->location_key()->value());
+ const FSPath f(e->location_key()->value());
+ const FSPath root_f(_imp->options.root() / f);
+ const FSStat root_f_stat(root_f);
- if (! (_imp->options.root() / f).exists())
+ if (! root_f_stat.exists())
display("--- [gone ] " + stringify(f));
- else if (! (_imp->options.root() / f).is_directory())
+ else if (! root_f_stat.is_directory())
display("--- [!type] " + stringify(f));
- else if (DirIterator(_imp->options.root() / f, { dio_include_dotfiles, dio_first_only }) != DirIterator())
+ else if (FSIterator(root_f, { fsio_include_dotfiles, fsio_first_only }) != FSIterator())
display("--- [!empt] " + stringify(f));
else
return true;
diff --git a/paludis/repositories/e/vdb_unmerger.hh b/paludis/repositories/e/vdb_unmerger.hh
index 529d1f4..a336b8c 100644
--- a/paludis/repositories/e/vdb_unmerger.hh
+++ b/paludis/repositories/e/vdb_unmerger.hh
@@ -23,7 +23,6 @@
#include <paludis/repository.hh>
#include <paludis/util/pimp.hh>
-#include <paludis/util/fs_entry.hh>
#include <paludis/unmerger.hh>
namespace paludis
@@ -53,10 +52,10 @@ namespace paludis
NamedValue<n::config_protect, std::string> config_protect;
NamedValue<n::config_protect_mask, std::string> config_protect_mask;
NamedValue<n::environment, Environment *> environment;
- NamedValue<n::ignore, const std::function<bool (const FSEntry &)> > ignore;
+ NamedValue<n::ignore, const std::function<bool (const FSPath &)> > ignore;
NamedValue<n::output_manager, std::shared_ptr<OutputManager> > output_manager;
NamedValue<n::package_id, std::shared_ptr<const PackageID> > package_id;
- NamedValue<n::root, FSEntry> root;
+ NamedValue<n::root, FSPath> root;
};
/**
@@ -92,8 +91,8 @@ namespace paludis
Imp<VDBUnmerger> * _imp;
protected:
- bool config_protected(const FSEntry &) const;
- std::string make_tidy(const FSEntry &) const;
+ bool config_protected(const FSPath &) const;
+ std::string make_tidy(const FSPath &) const;
void populate_unmerge_set();
diff --git a/paludis/repositories/e/vdb_unmerger_TEST.cc b/paludis/repositories/e/vdb_unmerger_TEST.cc
index 6ad4e02..5610f3d 100644
--- a/paludis/repositories/e/vdb_unmerger_TEST.cc
+++ b/paludis/repositories/e/vdb_unmerger_TEST.cc
@@ -25,6 +25,7 @@
#include <paludis/util/map.hh>
#include <paludis/util/wrapped_forward_iterator.hh>
#include <paludis/util/sequence.hh>
+#include <paludis/util/fs_stat.hh>
#include <paludis/standard_output_manager.hh>
#include <paludis/user_dep_spec.hh>
#include <paludis/package_database.hh>
@@ -51,7 +52,7 @@ namespace
return mm->second;
}
- bool ignore_nothing(const FSEntry &)
+ bool ignore_nothing(const FSPath &)
{
return false;
}
@@ -86,7 +87,7 @@ namespace
{
public:
const std::string what;
- FSEntry root_dir;
+ FSPath root_dir;
std::string target;
TestEnvironment env;
std::shared_ptr<Repository> repo;
@@ -116,8 +117,8 @@ namespace
keys->insert("format", "vdb");
keys->insert("names_cache", "/var/empty");
keys->insert("provides_cache", "/var/empty");
- keys->insert("location", stringify(FSEntry::cwd() / "vdb_unmerger_TEST_dir" / "repo"));
- keys->insert("builddir", stringify(FSEntry::cwd() / "vdb_unmerger_TEST_dir" / "build"));
+ keys->insert("location", stringify(FSPath::cwd() / "vdb_unmerger_TEST_dir" / "repo"));
+ keys->insert("builddir", stringify(FSPath::cwd() / "vdb_unmerger_TEST_dir" / "build"));
repo = VDBRepository::repository_factory_create(&env, std::bind(from_keys, keys, std::placeholders::_1));
env.package_database()->add_repository(0, repo);
@@ -146,11 +147,11 @@ namespace test_cases
void main_run()
{
- TEST_CHECK((root_dir / target).is_regular_file());
+ TEST_CHECK((root_dir / target).stat().is_regular_file());
unmerger->unmerge();
- TEST_CHECK(! (root_dir / target).exists());
+ TEST_CHECK(! (root_dir / target).stat().exists());
}
} test_vdb_unmerger_file_ok;
@@ -160,11 +161,11 @@ namespace test_cases
void main_run()
{
- TEST_CHECK((root_dir / target).is_regular_file());
+ TEST_CHECK((root_dir / target).stat().is_regular_file());
unmerger->unmerge();
- TEST_CHECK(! (root_dir / target).exists());
+ TEST_CHECK(! (root_dir / target).stat().exists());
}
} test_vdb_unmerger_file_with_spaces;
@@ -174,11 +175,11 @@ namespace test_cases
void main_run()
{
- TEST_CHECK((root_dir / target).is_regular_file());
+ TEST_CHECK((root_dir / target).stat().is_regular_file());
unmerger->unmerge();
- TEST_CHECK(! (root_dir / target).exists());
+ TEST_CHECK(! (root_dir / target).stat().exists());
}
} test_vdb_unmerger_file_with_lots_of_spaces;
@@ -188,11 +189,11 @@ namespace test_cases
void main_run()
{
- TEST_CHECK((root_dir / target).is_regular_file());
+ TEST_CHECK((root_dir / target).stat().is_regular_file());
unmerger->unmerge();
- TEST_CHECK(! (root_dir / target).exists());
+ TEST_CHECK(! (root_dir / target).stat().exists());
}
} test_vdb_unmerger_file_with_trailing_space;
@@ -202,11 +203,11 @@ namespace test_cases
void main_run()
{
- TEST_CHECK((root_dir / target).is_directory());
+ TEST_CHECK((root_dir / target).stat().is_directory());
unmerger->unmerge();
- TEST_CHECK((root_dir / target).is_directory());
+ TEST_CHECK((root_dir / target).stat().is_directory());
}
} test_vdb_unmerger_file_bad_type;
@@ -216,11 +217,11 @@ namespace test_cases
void main_run()
{
- TEST_CHECK((root_dir / target).is_regular_file());
+ TEST_CHECK((root_dir / target).stat().is_regular_file());
unmerger->unmerge();
- TEST_CHECK((root_dir / target).is_regular_file());
+ TEST_CHECK((root_dir / target).stat().is_regular_file());
}
} test_vdb_unmerger_file_bad_md5sum;
@@ -230,11 +231,11 @@ namespace test_cases
void main_run()
{
- TEST_CHECK((root_dir / target).is_regular_file());
+ TEST_CHECK((root_dir / target).stat().is_regular_file());
unmerger->unmerge();
- TEST_CHECK((root_dir / target).is_regular_file());
+ TEST_CHECK((root_dir / target).stat().is_regular_file());
}
} test_vdb_unmerger_file_bad_mtime;
@@ -254,11 +255,11 @@ namespace test_cases
void main_run()
{
- TEST_CHECK((root_dir / target).is_directory());
+ TEST_CHECK((root_dir / target).stat().is_directory());
unmerger->unmerge();
- TEST_CHECK(! (root_dir / target).exists());
+ TEST_CHECK(! (root_dir / target).stat().exists());
}
} test_vdb_unmerger_dir_ok;
@@ -268,11 +269,11 @@ namespace test_cases
void main_run()
{
- TEST_CHECK((root_dir / target).is_directory());
+ TEST_CHECK((root_dir / target).stat().is_directory());
unmerger->unmerge();
- TEST_CHECK(! (root_dir / target).exists());
+ TEST_CHECK(! (root_dir / target).stat().exists());
}
} test_vdb_unmerger_dir_with_spaces;
@@ -282,11 +283,11 @@ namespace test_cases
void main_run()
{
- TEST_CHECK((root_dir / target).is_directory());
+ TEST_CHECK((root_dir / target).stat().is_directory());
unmerger->unmerge();
- TEST_CHECK(! (root_dir / target).exists());
+ TEST_CHECK(! (root_dir / target).stat().exists());
}
} test_vdb_unmerger_dir_with_lots_of_spaces;
@@ -296,11 +297,11 @@ namespace test_cases
void main_run()
{
- TEST_CHECK((root_dir / target).is_regular_file());
+ TEST_CHECK((root_dir / target).stat().is_regular_file());
unmerger->unmerge();
- TEST_CHECK((root_dir / target).is_regular_file());
+ TEST_CHECK((root_dir / target).stat().is_regular_file());
}
} test_vdb_unmerger_dir_bad_type;
@@ -310,11 +311,11 @@ namespace test_cases
void main_run()
{
- TEST_CHECK((root_dir / target).is_directory());
+ TEST_CHECK((root_dir / target).stat().is_directory());
unmerger->unmerge();
- TEST_CHECK((root_dir / target).is_directory());
+ TEST_CHECK((root_dir / target).stat().is_directory());
}
} test_vdb_unmerger_dir_not_empty;
@@ -324,11 +325,11 @@ namespace test_cases
void main_run()
{
- TEST_CHECK((root_dir / target).is_symbolic_link());
+ TEST_CHECK((root_dir / target).stat().is_symlink());
unmerger->unmerge();
- TEST_CHECK(! (root_dir / target).exists());
+ TEST_CHECK(! (root_dir / target).stat().exists());
}
} test_vdb_unmerger_sym_ok;
@@ -338,11 +339,11 @@ namespace test_cases
void main_run()
{
- TEST_CHECK((root_dir / target).is_symbolic_link());
+ TEST_CHECK((root_dir / target).stat().is_symlink());
unmerger->unmerge();
- TEST_CHECK(! (root_dir / target).exists());
+ TEST_CHECK(! (root_dir / target).stat().exists());
}
} test_vdb_unmerger_sym_with_spaces;
@@ -352,11 +353,11 @@ namespace test_cases
void main_run()
{
- TEST_CHECK((root_dir / target).is_symbolic_link());
+ TEST_CHECK((root_dir / target).stat().is_symlink());
unmerger->unmerge();
- TEST_CHECK(! (root_dir / target).exists());
+ TEST_CHECK(! (root_dir / target).stat().exists());
}
} test_vdb_unmerger_sym_with_lots_of_spaces;
@@ -366,11 +367,11 @@ namespace test_cases
void main_run()
{
- TEST_CHECK((root_dir / target).is_symbolic_link());
+ TEST_CHECK((root_dir / target).stat().is_symlink());
unmerger->unmerge();
- TEST_CHECK(! (root_dir / target).exists());
+ TEST_CHECK(! (root_dir / target).stat().exists());
}
} test_vdb_unmerger_sym_with_many_arrows;
@@ -380,11 +381,11 @@ namespace test_cases
void main_run()
{
- TEST_CHECK((root_dir / target).is_regular_file());
+ TEST_CHECK((root_dir / target).stat().is_regular_file());
unmerger->unmerge();
- TEST_CHECK((root_dir / target).is_regular_file());
+ TEST_CHECK((root_dir / target).stat().is_regular_file());
}
} test_vdb_unmerger_sym_bad_type;
@@ -394,12 +395,12 @@ namespace test_cases
void main_run()
{
- TEST_CHECK((root_dir / target).is_symbolic_link());
- TEST_CHECK(! (root_dir / "sym_dst_bad").exists());
+ TEST_CHECK((root_dir / target).stat().is_symlink());
+ TEST_CHECK(! (root_dir / "sym_dst_bad").stat().exists());
unmerger->unmerge();
- TEST_CHECK((root_dir / target).is_symbolic_link());
+ TEST_CHECK((root_dir / target).stat().is_symlink());
}
} test_vdb_unmerger_sym_bad_dst;
@@ -409,11 +410,11 @@ namespace test_cases
void main_run()
{
- TEST_CHECK((root_dir / target).is_symbolic_link());
+ TEST_CHECK((root_dir / target).stat().is_symlink());
unmerger->unmerge();
- TEST_CHECK((root_dir / target).is_symbolic_link());
+ TEST_CHECK((root_dir / target).stat().is_symlink());
}
} test_vdb_unmerger_sym_bad_mtime;
@@ -424,11 +425,11 @@ namespace test_cases
void main_run()
{
- TEST_CHECK((root_dir / target).is_symbolic_link());
+ TEST_CHECK((root_dir / target).stat().is_symlink());
unmerger->unmerge();
- TEST_CHECK((root_dir / target).is_symbolic_link());
+ TEST_CHECK((root_dir / target).stat().is_symlink());
}
} test_vdb_unmerger_sym_bad_entry_1;
@@ -438,11 +439,11 @@ namespace test_cases
void main_run()
{
- TEST_CHECK((root_dir / target).is_symbolic_link());
+ TEST_CHECK((root_dir / target).stat().is_symlink());
unmerger->unmerge();
- TEST_CHECK((root_dir / target).is_symbolic_link());
+ TEST_CHECK((root_dir / target).stat().is_symlink());
}
} test_vdb_unmerger_sym_bad_entry_2;
@@ -452,35 +453,35 @@ namespace test_cases
void main_run()
{
- TEST_CHECK((root_dir / "protected_file").is_regular_file());
- TEST_CHECK((root_dir / "unprotected_file").is_regular_file());
- TEST_CHECK((root_dir / "protected_file_not_really").is_regular_file());
+ TEST_CHECK((root_dir / "protected_file").stat().is_regular_file());
+ TEST_CHECK((root_dir / "unprotected_file").stat().is_regular_file());
+ TEST_CHECK((root_dir / "protected_file_not_really").stat().is_regular_file());
- TEST_CHECK((root_dir / "protected_dir/protected_file").is_regular_file());
- TEST_CHECK((root_dir / "protected_dir/unprotected_file").is_regular_file());
- TEST_CHECK((root_dir / "protected_dir/unprotected_file_not_really").is_regular_file());
+ TEST_CHECK((root_dir / "protected_dir/protected_file").stat().is_regular_file());
+ TEST_CHECK((root_dir / "protected_dir/unprotected_file").stat().is_regular_file());
+ TEST_CHECK((root_dir / "protected_dir/unprotected_file_not_really").stat().is_regular_file());
- TEST_CHECK((root_dir / "protected_dir/unprotected_dir/unprotected_file").is_regular_file());
+ TEST_CHECK((root_dir / "protected_dir/unprotected_dir/unprotected_file").stat().is_regular_file());
- TEST_CHECK((root_dir / "protected_dir/unprotected_dir_not_really/protected_file").is_regular_file());
+ TEST_CHECK((root_dir / "protected_dir/unprotected_dir_not_really/protected_file").stat().is_regular_file());
- TEST_CHECK((root_dir / "protected_dir_not_really/unprotected_file").is_regular_file());
+ TEST_CHECK((root_dir / "protected_dir_not_really/unprotected_file").stat().is_regular_file());
unmerger->unmerge();
- TEST_CHECK((root_dir / "protected_file").exists());
- TEST_CHECK(! (root_dir / "unprotected_file").exists());
- TEST_CHECK(! (root_dir / "protected_file_not_really").exists());
+ TEST_CHECK((root_dir / "protected_file").stat().exists());
+ TEST_CHECK(! (root_dir / "unprotected_file").stat().exists());
+ TEST_CHECK(! (root_dir / "protected_file_not_really").stat().exists());
- TEST_CHECK((root_dir / "protected_dir/protected_file").exists());
- TEST_CHECK(! (root_dir / "protected_dir/unprotected_file").exists());
- TEST_CHECK((root_dir / "protected_dir/unprotected_file_not_really").exists());
+ TEST_CHECK((root_dir / "protected_dir/protected_file").stat().exists());
+ TEST_CHECK(! (root_dir / "protected_dir/unprotected_file").stat().exists());
+ TEST_CHECK((root_dir / "protected_dir/unprotected_file_not_really").stat().exists());
- TEST_CHECK(! (root_dir / "protected_dir/unprotected_dir/unprotected_file").exists());
+ TEST_CHECK(! (root_dir / "protected_dir/unprotected_dir/unprotected_file").stat().exists());
- TEST_CHECK((root_dir / "protected_dir/unprotected_dir_not_really/protected_file").exists());
+ TEST_CHECK((root_dir / "protected_dir/unprotected_dir_not_really/protected_file").stat().exists());
- TEST_CHECK(! (root_dir / "protected_dir_not_really/unprotected_file").exists());
+ TEST_CHECK(! (root_dir / "protected_dir_not_really/unprotected_file").stat().exists());
}
} test_vdb_unmerger_config_protect;
}
diff --git a/paludis/repositories/e/xml_things.cc b/paludis/repositories/e/xml_things.cc
index fc44082..5eb3e9b 100644
--- a/paludis/repositories/e/xml_things.cc
+++ b/paludis/repositories/e/xml_things.cc
@@ -281,7 +281,7 @@ paludis_xml_things_create_glsa_from_xml_file(const std::string & filename)
}
std::shared_ptr<erepository::MetadataXML>
-paludis_xml_things_create_metadata_xml_from_xml_file(const FSEntry & filename)
+paludis_xml_things_create_metadata_xml_from_xml_file(const FSPath & filename)
{
std::shared_ptr<erepository::MetadataXML> result(std::make_shared<erepository::MetadataXML>(
make_named_values<erepository::MetadataXML>(
diff --git a/paludis/repositories/e/xml_things.hh b/paludis/repositories/e/xml_things.hh
index 2d6bcf2..88f90ed 100644
--- a/paludis/repositories/e/xml_things.hh
+++ b/paludis/repositories/e/xml_things.hh
@@ -1,7 +1,7 @@
/* vim: set sw=4 sts=4 et foldmethod=syntax : */
/*
- * Copyright (c) 2006, 2007, 2008 Ciaran McCreesh
+ * Copyright (c) 2006, 2007, 2008, 2010 Ciaran McCreesh
*
* This file is part of the Paludis package manager. Paludis is free software;
* you can redistribute it and/or modify it under the terms of the GNU General
@@ -22,7 +22,6 @@
#include <paludis/repositories/e/glsa.hh>
#include <paludis/repositories/e/metadata_xml.hh>
-#include <paludis/util/fs_entry-fwd.hh>
#include "config.h"
extern "C"
@@ -34,7 +33,7 @@ extern "C"
std::shared_ptr<paludis::GLSA> PALUDIS_VISIBLE paludis_xml_things_create_glsa_from_xml_file(const std::string &);
std::shared_ptr<paludis::erepository::MetadataXML> PALUDIS_VISIBLE paludis_xml_things_create_metadata_xml_from_xml_file(
- const paludis::FSEntry &) PALUDIS_ATTRIBUTE((warn_unused_result));
+ const paludis::FSPath &) PALUDIS_ATTRIBUTE((warn_unused_result));
#endif
}
diff --git a/paludis/repositories/e/xml_things_handle.hh b/paludis/repositories/e/xml_things_handle.hh
index 0346887..af8215e 100644
--- a/paludis/repositories/e/xml_things_handle.hh
+++ b/paludis/repositories/e/xml_things_handle.hh
@@ -24,7 +24,6 @@
#include <paludis/repositories/e/metadata_xml.hh>
#include <paludis/util/pimp.hh>
#include <paludis/util/singleton.hh>
-#include <paludis/util/fs_entry-fwd.hh>
namespace paludis
{
@@ -42,7 +41,7 @@ namespace paludis
public:
typedef std::shared_ptr<GLSA> (* CreateGLSAFromXMLFilePtr) (const std::string &);
- typedef std::shared_ptr<MetadataXML> (* CreateMetadataXMLFromXMLFilePtr) (const FSEntry &);
+ typedef std::shared_ptr<MetadataXML> (* CreateMetadataXMLFromXMLFilePtr) (const FSPath &);
CreateGLSAFromXMLFilePtr create_glsa_from_xml_file() const
PALUDIS_ATTRIBUTE((warn_unused_result));