aboutsummaryrefslogtreecommitdiff
path: root/paludis/environments/paludis
diff options
context:
space:
mode:
Diffstat (limited to 'paludis/environments/paludis')
-rw-r--r--paludis/environments/paludis/bashable_conf.cc7
-rw-r--r--paludis/environments/paludis/bashable_conf.hh8
-rw-r--r--paludis/environments/paludis/keywords_conf.cc2
-rw-r--r--paludis/environments/paludis/keywords_conf.hh4
-rw-r--r--paludis/environments/paludis/licenses_conf.cc2
-rw-r--r--paludis/environments/paludis/licenses_conf.hh4
-rw-r--r--paludis/environments/paludis/mirrors_conf.cc2
-rw-r--r--paludis/environments/paludis/mirrors_conf.hh2
-rw-r--r--paludis/environments/paludis/output_conf.cc2
-rw-r--r--paludis/environments/paludis/output_conf.hh4
-rw-r--r--paludis/environments/paludis/package_mask_conf.cc2
-rw-r--r--paludis/environments/paludis/package_mask_conf.hh4
-rw-r--r--paludis/environments/paludis/paludis_config.cc179
-rw-r--r--paludis/environments/paludis/paludis_config.hh5
-rw-r--r--paludis/environments/paludis/paludis_environment.cc83
-rw-r--r--paludis/environments/paludis/paludis_environment.hh14
-rw-r--r--paludis/environments/paludis/paludis_environment_TEST.cc11
-rw-r--r--paludis/environments/paludis/use_conf.cc3
-rw-r--r--paludis/environments/paludis/use_conf.hh4
-rw-r--r--paludis/environments/paludis/world.cc16
-rw-r--r--paludis/environments/paludis/world.hh6
-rw-r--r--paludis/environments/paludis/world_TEST.cc3
22 files changed, 183 insertions, 184 deletions
diff --git a/paludis/environments/paludis/bashable_conf.cc b/paludis/environments/paludis/bashable_conf.cc
index 5c6bf24af..4095e9ff2 100644
--- a/paludis/environments/paludis/bashable_conf.cc
+++ b/paludis/environments/paludis/bashable_conf.cc
@@ -19,7 +19,6 @@
#include "bashable_conf.hh"
#include <paludis/util/config_file.hh>
-#include <paludis/util/fs_entry.hh>
#include <paludis/util/is_file_with_extension.hh>
#include <paludis/util/stringify.hh>
#include <paludis/util/log.hh>
@@ -27,6 +26,8 @@
#include <paludis/util/process.hh>
#include <paludis/util/map.hh>
#include <paludis/util/wrapped_forward_iterator.hh>
+#include <paludis/util/options.hh>
+#include <paludis/util/fs_path.hh>
#include <functional>
using namespace paludis;
@@ -44,7 +45,7 @@ std::string defined_vars_to_kv_func(
}
std::shared_ptr<LineConfigFile>
-paludis::paludis_environment::make_bashable_conf(const FSEntry & f, const LineConfigFileOptions & o)
+paludis::paludis_environment::make_bashable_conf(const FSPath & f, const LineConfigFileOptions & o)
{
Context context("When making a config file out of '" + stringify(f) + "':");
@@ -77,7 +78,7 @@ paludis::paludis_environment::make_bashable_conf(const FSEntry & f, const LineCo
}
std::shared_ptr<KeyValueConfigFile>
-paludis::paludis_environment::make_bashable_kv_conf(const FSEntry & f,
+paludis::paludis_environment::make_bashable_kv_conf(const FSPath & f,
const std::shared_ptr<const Map<std::string, std::string> > & predefined_variables,
const KeyValueConfigFileOptions & o)
{
diff --git a/paludis/environments/paludis/bashable_conf.hh b/paludis/environments/paludis/bashable_conf.hh
index 372753d7f..650cdd953 100644
--- a/paludis/environments/paludis/bashable_conf.hh
+++ b/paludis/environments/paludis/bashable_conf.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
@@ -20,7 +20,7 @@
#ifndef PALUDIS_GUARD_PALUDIS_ENVIRONMENTS_PALUDIS_BASHABLE_CONF_HH
#define PALUDIS_GUARD_PALUDIS_ENVIRONMENTS_PALUDIS_BASHABLE_CONF_HH 1
-#include <paludis/util/fs_entry-fwd.hh>
+#include <paludis/util/fs_path-fwd.hh>
#include <paludis/util/config_file-fwd.hh>
#include <paludis/util/map-fwd.hh>
#include <memory>
@@ -31,11 +31,11 @@ namespace paludis
namespace paludis_environment
{
std::shared_ptr<LineConfigFile> make_bashable_conf(
- const FSEntry &,
+ const FSPath &,
const LineConfigFileOptions &);
std::shared_ptr<KeyValueConfigFile> make_bashable_kv_conf(
- const FSEntry &,
+ const FSPath &,
const std::shared_ptr<const Map<std::string, std::string> > &,
const KeyValueConfigFileOptions &);
}
diff --git a/paludis/environments/paludis/keywords_conf.cc b/paludis/environments/paludis/keywords_conf.cc
index ea26d40e6..d40bc4e44 100644
--- a/paludis/environments/paludis/keywords_conf.cc
+++ b/paludis/environments/paludis/keywords_conf.cc
@@ -83,7 +83,7 @@ KeywordsConf::~KeywordsConf()
}
void
-KeywordsConf::add(const FSEntry & filename)
+KeywordsConf::add(const FSPath & filename)
{
Context context("When adding source '" + stringify(filename) + "' as a keywords file:");
diff --git a/paludis/environments/paludis/keywords_conf.hh b/paludis/environments/paludis/keywords_conf.hh
index 4ac8e962e..4e6328686 100644
--- a/paludis/environments/paludis/keywords_conf.hh
+++ b/paludis/environments/paludis/keywords_conf.hh
@@ -21,7 +21,7 @@
#define PALUDIS_GUARD_PALUDIS_ENVIRONMENTS_PALUDIS_KEYWORDS_CONF_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>
@@ -55,7 +55,7 @@ namespace paludis
/**
* Add another file.
*/
- void add(const FSEntry &);
+ void add(const FSPath &);
/**
* Query a collection of keywords.
diff --git a/paludis/environments/paludis/licenses_conf.cc b/paludis/environments/paludis/licenses_conf.cc
index d40322e5b..2ebaeac5e 100644
--- a/paludis/environments/paludis/licenses_conf.cc
+++ b/paludis/environments/paludis/licenses_conf.cc
@@ -82,7 +82,7 @@ LicensesConf::~LicensesConf()
}
void
-LicensesConf::add(const FSEntry & filename)
+LicensesConf::add(const FSPath & filename)
{
Context context("When adding source '" + stringify(filename) + "' as a licenses file:");
diff --git a/paludis/environments/paludis/licenses_conf.hh b/paludis/environments/paludis/licenses_conf.hh
index 7935cc773..2071ad19f 100644
--- a/paludis/environments/paludis/licenses_conf.hh
+++ b/paludis/environments/paludis/licenses_conf.hh
@@ -21,7 +21,7 @@
#define PALUDIS_GUARD_PALUDIS_PALUDIS_ENVIRONMENTS_PALUDIS_LICENSES_CONF_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>
@@ -55,7 +55,7 @@ namespace paludis
/**
* Add another file.
*/
- void add(const FSEntry &);
+ void add(const FSPath &);
/**
* Query a particular license.
diff --git a/paludis/environments/paludis/mirrors_conf.cc b/paludis/environments/paludis/mirrors_conf.cc
index 56394eaab..7d20df103 100644
--- a/paludis/environments/paludis/mirrors_conf.cc
+++ b/paludis/environments/paludis/mirrors_conf.cc
@@ -65,7 +65,7 @@ MirrorsConf::~MirrorsConf()
}
void
-MirrorsConf::add(const FSEntry & filename)
+MirrorsConf::add(const FSPath & filename)
{
Context context("When adding source '" + stringify(filename) + "' as a mirrors file:");
diff --git a/paludis/environments/paludis/mirrors_conf.hh b/paludis/environments/paludis/mirrors_conf.hh
index ae9f5a663..89fc86b62 100644
--- a/paludis/environments/paludis/mirrors_conf.hh
+++ b/paludis/environments/paludis/mirrors_conf.hh
@@ -55,7 +55,7 @@ namespace paludis
/**
* Add another file.
*/
- void add(const FSEntry &);
+ void add(const FSPath &);
/**
* Query a mirror.
diff --git a/paludis/environments/paludis/output_conf.cc b/paludis/environments/paludis/output_conf.cc
index ac68155a3..dc5834e6f 100644
--- a/paludis/environments/paludis/output_conf.cc
+++ b/paludis/environments/paludis/output_conf.cc
@@ -328,7 +328,7 @@ namespace
}
void
-OutputConf::add(const FSEntry & filename)
+OutputConf::add(const FSPath & filename)
{
Context context("When adding source '" + stringify(filename) + "' as an output file:");
diff --git a/paludis/environments/paludis/output_conf.hh b/paludis/environments/paludis/output_conf.hh
index 9abd31543..684b7a472 100644
--- a/paludis/environments/paludis/output_conf.hh
+++ b/paludis/environments/paludis/output_conf.hh
@@ -21,7 +21,7 @@
#define PALUDIS_GUARD_PALUDIS_ENVIRONMENTS_PALUDIS_OUTPUT_CONF_HH 1
#include <paludis/util/pimp.hh>
-#include <paludis/util/fs_entry-fwd.hh>
+#include <paludis/util/fs_path-fwd.hh>
#include <paludis/output_manager-fwd.hh>
#include <paludis/create_output_manager_info-fwd.hh>
#include <memory>
@@ -50,7 +50,7 @@ namespace paludis
/**
* Add another file.
*/
- void add(const FSEntry &);
+ void add(const FSPath &);
const std::shared_ptr<OutputManager> create_output_manager(
const CreateOutputManagerInfo &) const;
diff --git a/paludis/environments/paludis/package_mask_conf.cc b/paludis/environments/paludis/package_mask_conf.cc
index 49df819a4..220640546 100644
--- a/paludis/environments/paludis/package_mask_conf.cc
+++ b/paludis/environments/paludis/package_mask_conf.cc
@@ -73,7 +73,7 @@ PackageMaskConf::~PackageMaskConf()
}
void
-PackageMaskConf::add(const FSEntry & filename)
+PackageMaskConf::add(const FSPath & filename)
{
Context context("When adding source '" + stringify(filename) + "' as a package mask or unmask file:");
diff --git a/paludis/environments/paludis/package_mask_conf.hh b/paludis/environments/paludis/package_mask_conf.hh
index 01409effa..feaa51edf 100644
--- a/paludis/environments/paludis/package_mask_conf.hh
+++ b/paludis/environments/paludis/package_mask_conf.hh
@@ -21,7 +21,7 @@
#define PALUDIS_GUARD_PALUDIS_ENVIRONMENTS_PALUDIS_PACKAGE_MASK_CONF_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>
@@ -56,7 +56,7 @@ namespace paludis
/**
* Add another file.
*/
- void add(const FSEntry &);
+ void add(const FSPath &);
/**
* Query a mask.
diff --git a/paludis/environments/paludis/paludis_config.cc b/paludis/environments/paludis/paludis_config.cc
index a670173d0..8d50b1865 100644
--- a/paludis/environments/paludis/paludis_config.cc
+++ b/paludis/environments/paludis/paludis_config.cc
@@ -30,8 +30,6 @@
#include <paludis/util/config_file.hh>
#include <paludis/util/destringify.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/stringify.hh>
@@ -49,6 +47,9 @@
#include <paludis/util/graph-impl.hh>
#include <paludis/util/member_iterator-impl.hh>
#include <paludis/util/process.hh>
+#include <paludis/util/fs_iterator.hh>
+#include <paludis/util/fs_stat.hh>
+#include <paludis/util/fs_error.hh>
#include <paludis/distribution.hh>
#include <paludis/repository_factory.hh>
@@ -171,7 +172,7 @@ namespace paludis
std::string config_dir;
mutable Mutex distribution_mutex;
mutable std::string distribution;
- std::shared_ptr<FSEntrySequence> bashrc_files;
+ std::shared_ptr<FSPathSequence> bashrc_files;
Repos repos;
std::function<std::string (const std::string &)> predefined_conf_vars_func;
@@ -207,7 +208,7 @@ namespace paludis
env(e),
paludis_command("paludis"),
config_dir("(unset)"),
- bashrc_files(std::make_shared<FSEntrySequence>()),
+ bashrc_files(std::make_shared<FSPathSequence>()),
keywords_conf(std::make_shared<KeywordsConf>(e)),
use_conf(std::make_shared<UseConf>(e)),
licenses_conf(std::make_shared<LicensesConf>(e)),
@@ -233,7 +234,7 @@ namespace paludis
Context context("When loading general.conf:");
std::shared_ptr<KeyValueConfigFile> kv;
- std::shared_ptr<FSEntry> world_file;
+ std::shared_ptr<FSPath> world_file;
commandline_environment->insert("root", root);
commandline_environment->insert("ROOT", root);
@@ -246,18 +247,18 @@ namespace paludis
std::placeholders::_1,
std::placeholders::_2);
- if ((FSEntry(config_dir) / "general.conf").exists())
+ if ((FSPath(config_dir) / "general.conf").stat().exists())
{
kv = std::make_shared<KeyValueConfigFile>(
- FSEntry(config_dir) / "general.conf",
+ FSPath(config_dir) / "general.conf",
KeyValueConfigFileOptions(),
def_predefined,
&KeyValueConfigFile::no_transformation);
}
- else if ((FSEntry(config_dir) / "general.bash").exists())
+ else if ((FSPath(config_dir) / "general.bash").stat().exists())
{
std::stringstream s;
- Process process(ProcessCommand({ "bash", stringify(FSEntry(config_dir) / "general.bash") }));
+ Process process(ProcessCommand({ "bash", stringify(FSPath(config_dir) / "general.bash") }));
process
.setenv("PALUDIS_LOG_LEVEL", stringify(Log::get_instance()->log_level()))
.setenv("PALUDIS_EBUILD_DIR", getenv_with_default("PALUDIS_EBUILD_DIR", LIBEXECDIR "/paludis"))
@@ -273,31 +274,31 @@ namespace paludis
if (exit_status != 0)
{
Log::get_instance()->message("paludis_environment.general.bash.failure", ll_warning, lc_context)
- << "Script '" << (FSEntry(config_dir) / "general.bash") <<
+ << "Script '" << (FSPath(config_dir) / "general.bash") <<
"' returned non-zero exit status '" << exit_status << "'";
kv.reset();
}
}
- else if ((FSEntry(config_dir) / "environment.conf").exists())
+ else if ((FSPath(config_dir) / "environment.conf").stat().exists())
{
Log::get_instance()->message("paludis_environment.general.rename", ll_warning, lc_context)
- << "The file '" << (FSEntry(config_dir) / "environment.conf") << "' should be renamed to '"
- << (FSEntry(config_dir) / "general.conf") << "'.";
+ << "The file '" << (FSPath(config_dir) / "environment.conf") << "' should be renamed to '"
+ << (FSPath(config_dir) / "general.conf") << "'.";
kv = std::make_shared<KeyValueConfigFile>(
- FSEntry(config_dir) / "environment.conf",
+ FSPath(config_dir) / "environment.conf",
KeyValueConfigFileOptions(),
def_predefined,
&KeyValueConfigFile::no_transformation);
}
- else if ((FSEntry(config_dir) / "environment.bash").exists())
+ else if ((FSPath(config_dir) / "environment.bash").stat().exists())
{
Log::get_instance()->message("paludis_environment.general.rename", ll_warning, lc_context)
- << "The file '" << (FSEntry(config_dir) / "environment.bash") << "' should be renamed to '"
- << (FSEntry(config_dir) / "general.bash") << "'.";
+ << "The file '" << (FSPath(config_dir) / "environment.bash") << "' should be renamed to '"
+ << (FSPath(config_dir) / "general.bash") << "'.";
std::stringstream s;
- Process process(ProcessCommand({ "bash", stringify(FSEntry(config_dir) / "environment.bash") }));
+ Process process(ProcessCommand({ "bash", stringify(FSPath(config_dir) / "environment.bash") }));
process
.setenv("PALUDIS_LOG_LEVEL", stringify(Log::get_instance()->log_level()))
.setenv("PALUDIS_EBUILD_DIR", getenv_with_default("PALUDIS_EBUILD_DIR", LIBEXECDIR "/paludis"))
@@ -313,7 +314,7 @@ namespace paludis
if (exit_status != 0)
{
Log::get_instance()->message("paludis_environment.general.bash.failure", ll_warning, lc_context)
- << "Script '" << (FSEntry(config_dir) / "general.bash") <<
+ << "Script '" << (FSPath(config_dir) / "general.bash") <<
"' returned non-zero exit status '" << exit_status << "'";
kv.reset();
}
@@ -356,12 +357,12 @@ namespace paludis
distribution = kv->get("distribution");
if (! kv->get("world").empty())
- world_file = std::make_shared<FSEntry>(kv->get("world"));
+ world_file = std::make_shared<FSPath>(kv->get("world"));
if (! world_file)
Log::get_instance()->message("paludis_environment.world.no_world", ll_warning, lc_context)
<< "No world file specified. You should specify 'world = /path/to/world/file' in "
- << (FSEntry(config_dir) / "general.conf")
+ << (FSPath(config_dir) / "general.conf")
<< ". Any attempted updates to world will not be saved.";
world = std::make_shared<World>(env, world_file);
@@ -410,22 +411,22 @@ PaludisConfig::PaludisConfig(PaludisEnvironment * const e, const std::string & s
}
}
- FSEntry local_config_dir(FSEntry(getenv_with_default("PALUDIS_HOME", getenv_or_error("HOME"))) /
+ FSPath local_config_dir(FSPath(getenv_with_default("PALUDIS_HOME", getenv_or_error("HOME"))) /
(".paludis" + local_config_suffix)), old_config_dir(local_config_dir);
try
{
- if (! local_config_dir.exists())
- local_config_dir = (FSEntry(SYSCONFDIR) / ("paludis" + local_config_suffix));
+ if (! local_config_dir.stat().exists())
+ local_config_dir = (FSPath(SYSCONFDIR) / ("paludis" + local_config_suffix));
}
catch (const FSError &)
{
- local_config_dir = (FSEntry(SYSCONFDIR) / ("paludis" + local_config_suffix));
+ local_config_dir = (FSPath(SYSCONFDIR) / ("paludis" + local_config_suffix));
}
if (_imp->commandline_environment->end() == _imp->commandline_environment->find("root"))
{
- if (! local_config_dir.exists())
+ if (! local_config_dir.stat().exists())
throw PaludisConfigNoDirectoryError("Can't find configuration directory (tried '"
+ stringify(old_config_dir) + "', '" + stringify(local_config_dir) + "')");
@@ -441,7 +442,7 @@ PaludisConfig::PaludisConfig(PaludisEnvironment * const e, const std::string & s
std::placeholders::_1,
std::placeholders::_2);
- if ((local_config_dir / "specpath.conf").exists())
+ if ((local_config_dir / "specpath.conf").stat().exists())
{
specpath = std::make_shared<KeyValueConfigFile>(
local_config_dir / "specpath.conf",
@@ -468,10 +469,10 @@ PaludisConfig::PaludisConfig(PaludisEnvironment * const e, const std::string & s
local_config_suffix.insert(0, "-");
}
- if (! _imp->root_prefix.empty() && stringify(FSEntry(_imp->root_prefix).realpath()) != "/")
+ if (! _imp->root_prefix.empty() && stringify(FSPath(_imp->root_prefix).realpath()) != "/")
{
- local_config_dir = FSEntry(_imp->root_prefix) / SYSCONFDIR / ("paludis" + local_config_suffix);
- if (! local_config_dir.exists())
+ local_config_dir = FSPath(_imp->root_prefix) / SYSCONFDIR / ("paludis" + local_config_suffix);
+ if (! local_config_dir.stat().exists())
throw PaludisConfigError("Can't find configuration directory under root ("
"tried '" + stringify(local_config_dir) + "' and couldn't find any "
"specpath variables on the commandline");
@@ -525,7 +526,7 @@ PaludisConfig::PaludisConfig(PaludisEnvironment * const e, const std::string & s
{
/* add normal repositories. start by getting defaults for config files... */
- if ((local_config_dir / (dist->repository_defaults_filename_part() + ".conf")).exists())
+ if ((local_config_dir / (dist->repository_defaults_filename_part() + ".conf")).stat().exists())
{
_imp->predefined_conf_vars_func = std::bind(&from_kv, std::make_shared<KeyValueConfigFile>(
local_config_dir / (dist->repository_defaults_filename_part() + ".conf"), KeyValueConfigFileOptions(),
@@ -533,7 +534,7 @@ PaludisConfig::PaludisConfig(PaludisEnvironment * const e, const std::string & s
&KeyValueConfigFile::no_transformation),
std::placeholders::_1);
}
- else if ((local_config_dir / (dist->repository_defaults_filename_part() + ".bash")).exists())
+ else if ((local_config_dir / (dist->repository_defaults_filename_part() + ".bash")).stat().exists())
{
std::stringstream s;
Process process(ProcessCommand({ "bash", stringify(local_config_dir / (dist->repository_defaults_filename_part() + ".bash")) + "'" }));
@@ -555,26 +556,26 @@ PaludisConfig::PaludisConfig(PaludisEnvironment * const e, const std::string & s
}
/* find candidate config directories */
- std::list<FSEntry> dirs;
+ std::list<FSPath> dirs;
dirs.push_back(local_config_dir / dist->repositories_directory());
/* find repo config files */
- std::list<FSEntry> repo_files;
- for (std::list<FSEntry>::const_iterator dir(dirs.begin()), dir_end(dirs.end()) ;
+ std::list<FSPath> repo_files;
+ for (std::list<FSPath>::const_iterator dir(dirs.begin()), dir_end(dirs.end()) ;
dir != dir_end ; ++dir)
{
- if (! dir->exists())
+ if (! dir->stat().exists())
continue;
- std::remove_copy_if(DirIterator(*dir), DirIterator(), std::back_inserter(repo_files),
+ std::remove_copy_if(FSIterator(*dir, { }), FSIterator(), std::back_inserter(repo_files),
std::bind(std::logical_not<bool>(), std::bind(&is_file_with_extension, _1, ".conf", IsFileWithOptions())));
- std::remove_copy_if(DirIterator(*dir), DirIterator(), std::back_inserter(repo_files),
+ std::remove_copy_if(FSIterator(*dir, { }), FSIterator(), std::back_inserter(repo_files),
std::bind(std::logical_not<bool>(), std::bind(&is_file_with_extension, _1, ".bash", IsFileWithOptions())));
}
/* get a mapping from repository name to key function, so we can work out the order */
std::unordered_map<RepositoryName, std::function<std::string (const std::string &)>, Hash<RepositoryName> > repo_configs;
- for (std::list<FSEntry>::const_iterator repo_file(repo_files.begin()), repo_file_end(repo_files.end()) ;
+ for (std::list<FSPath>::const_iterator repo_file(repo_files.begin()), repo_file_end(repo_files.end()) ;
repo_file != repo_file_end ; ++repo_file)
{
Context local_context("When reading repository file '" + stringify(*repo_file) + "':");
@@ -661,23 +662,23 @@ PaludisConfig::PaludisConfig(PaludisEnvironment * const e, const std::string & s
/* keywords */
{
- std::list<FSEntry> files;
+ std::list<FSPath> files;
files.push_back(local_config_dir / (dist->keywords_filename_part() + ".conf"));
files.push_back(local_config_dir / (dist->keywords_filename_part() + ".bash"));
- if ((local_config_dir / (dist->keywords_filename_part() + ".conf.d")).exists())
+ if ((local_config_dir / (dist->keywords_filename_part() + ".conf.d")).stat().exists())
{
- std::remove_copy_if(DirIterator(local_config_dir / (dist->keywords_filename_part() + ".conf.d")), DirIterator(), std::back_inserter(files),
+ std::remove_copy_if(FSIterator(local_config_dir / (dist->keywords_filename_part() + ".conf.d"), { }), FSIterator(), std::back_inserter(files),
std::bind(std::logical_not<bool>(), std::bind(&is_file_with_extension, _1, ".conf", IsFileWithOptions())));
- std::remove_copy_if(DirIterator(local_config_dir / (dist->keywords_filename_part() + ".conf.d")), DirIterator(), std::back_inserter(files),
+ std::remove_copy_if(FSIterator(local_config_dir / (dist->keywords_filename_part() + ".conf.d"), { }), FSIterator(), std::back_inserter(files),
std::bind(std::logical_not<bool>(), std::bind(&is_file_with_extension, _1, ".bash", IsFileWithOptions())));
}
- for (std::list<FSEntry>::const_iterator file(files.begin()), file_end(files.end()) ;
+ for (std::list<FSPath>::const_iterator file(files.begin()), file_end(files.end()) ;
file != file_end ; ++file)
{
Context local_context("When reading keywords file '" + stringify(*file) + "':");
- if (! file->exists())
+ if (! file->stat().exists())
continue;
_imp->keywords_conf->add(*file);
@@ -686,26 +687,26 @@ PaludisConfig::PaludisConfig(PaludisEnvironment * const e, const std::string & s
/* output */
{
- std::list<FSEntry> files;
+ std::list<FSPath> files;
files.push_back(local_config_dir / (dist->output_filename_part() + ".conf"));
files.push_back(local_config_dir / (dist->output_filename_part() + ".bash"));
- files.push_back(getenv_with_default("PALUDIS_DEFAULT_OUTPUT_CONF",
- SHAREDIR "/paludis/environments/paludis/default_output.conf"));
- if ((local_config_dir / (dist->output_filename_part() + ".conf.d")).exists())
+ files.push_back(FSPath(getenv_with_default("PALUDIS_DEFAULT_OUTPUT_CONF",
+ SHAREDIR "/paludis/environments/paludis/default_output.conf")));
+ if ((local_config_dir / (dist->output_filename_part() + ".conf.d")).stat().exists())
{
- std::remove_copy_if(DirIterator(local_config_dir / (dist->output_filename_part() + ".conf.d")), DirIterator(), std::back_inserter(files),
+ std::remove_copy_if(FSIterator(local_config_dir / (dist->output_filename_part() + ".conf.d"), { }), FSIterator(), std::back_inserter(files),
std::bind(std::logical_not<bool>(), std::bind(&is_file_with_extension, _1, ".conf", IsFileWithOptions())));
- std::remove_copy_if(DirIterator(local_config_dir / (dist->output_filename_part() + ".conf.d")), DirIterator(), std::back_inserter(files),
+ std::remove_copy_if(FSIterator(local_config_dir / (dist->output_filename_part() + ".conf.d"), { }), FSIterator(), std::back_inserter(files),
std::bind(std::logical_not<bool>(), std::bind(&is_file_with_extension, _1, ".bash", IsFileWithOptions())));
}
bool any(false);
- for (std::list<FSEntry>::const_iterator file(files.begin()), file_end(files.end()) ;
+ for (std::list<FSPath>::const_iterator file(files.begin()), file_end(files.end()) ;
file != file_end ; ++file)
{
Context local_context("When reading output file '" + stringify(*file) + "':");
- if (! file->exists())
+ if (! file->stat().exists())
continue;
_imp->output_conf->add(*file);
@@ -718,23 +719,23 @@ PaludisConfig::PaludisConfig(PaludisEnvironment * const e, const std::string & s
/* use */
{
- std::list<FSEntry> files;
+ std::list<FSPath> files;
files.push_back(local_config_dir / (dist->use_filename_part() + ".conf"));
files.push_back(local_config_dir / (dist->use_filename_part() + ".bash"));
- if ((local_config_dir / (dist->use_filename_part() + ".conf.d")).exists())
+ if ((local_config_dir / (dist->use_filename_part() + ".conf.d")).stat().exists())
{
- std::remove_copy_if(DirIterator(local_config_dir / (dist->use_filename_part() + ".conf.d")), DirIterator(), std::back_inserter(files),
+ std::remove_copy_if(FSIterator(local_config_dir / (dist->use_filename_part() + ".conf.d"), { }), FSIterator(), std::back_inserter(files),
std::bind(std::logical_not<bool>(), std::bind(&is_file_with_extension, _1, ".conf", IsFileWithOptions())));
- std::remove_copy_if(DirIterator(local_config_dir / (dist->use_filename_part() + ".conf.d")), DirIterator(), std::back_inserter(files),
+ std::remove_copy_if(FSIterator(local_config_dir / (dist->use_filename_part() + ".conf.d"), { }), FSIterator(), std::back_inserter(files),
std::bind(std::logical_not<bool>(), std::bind(&is_file_with_extension, _1, ".bash", IsFileWithOptions())));
}
- for (std::list<FSEntry>::const_iterator file(files.begin()), file_end(files.end()) ;
+ for (std::list<FSPath>::const_iterator file(files.begin()), file_end(files.end()) ;
file != file_end ; ++file)
{
Context local_context("When reading use file '" + stringify(*file) + "':");
- if (! file->exists())
+ if (! file->stat().exists())
continue;
_imp->use_conf->add(*file);
@@ -743,23 +744,23 @@ PaludisConfig::PaludisConfig(PaludisEnvironment * const e, const std::string & s
/* licenses */
{
- std::list<FSEntry> files;
+ std::list<FSPath> files;
files.push_back(local_config_dir / (dist->licenses_filename_part() + ".conf"));
files.push_back(local_config_dir / (dist->licenses_filename_part() + ".bash"));
- if ((local_config_dir / (dist->licenses_filename_part() + ".conf.d")).exists())
+ if ((local_config_dir / (dist->licenses_filename_part() + ".conf.d")).stat().exists())
{
- std::remove_copy_if(DirIterator(local_config_dir / (dist->licenses_filename_part() + ".conf.d")), DirIterator(), std::back_inserter(files),
+ std::remove_copy_if(FSIterator(local_config_dir / (dist->licenses_filename_part() + ".conf.d"), { }), FSIterator(), std::back_inserter(files),
std::bind(std::logical_not<bool>(), std::bind(&is_file_with_extension, _1, ".conf", IsFileWithOptions())));
- std::remove_copy_if(DirIterator(local_config_dir / (dist->licenses_filename_part() + ".conf.d")), DirIterator(), std::back_inserter(files),
+ std::remove_copy_if(FSIterator(local_config_dir / (dist->licenses_filename_part() + ".conf.d"), { }), FSIterator(), std::back_inserter(files),
std::bind(std::logical_not<bool>(), std::bind(&is_file_with_extension, _1, ".bash", IsFileWithOptions())));
}
- for (std::list<FSEntry>::const_iterator file(files.begin()), file_end(files.end()) ;
+ for (std::list<FSPath>::const_iterator file(files.begin()), file_end(files.end()) ;
file != file_end ; ++file)
{
Context local_context("When reading licenses file '" + stringify(*file) + "':");
- if (! file->exists())
+ if (! file->stat().exists())
continue;
_imp->licenses_conf->add(*file);
@@ -768,25 +769,25 @@ PaludisConfig::PaludisConfig(PaludisEnvironment * const e, const std::string & s
/* user mask */
{
- std::list<FSEntry> files;
+ std::list<FSPath> files;
files.push_back(local_config_dir / (dist->package_mask_filename_part() + ".conf"));
files.push_back(local_config_dir / (dist->package_mask_filename_part() + ".bash"));
- if ((local_config_dir / (dist->package_mask_filename_part() + ".conf.d")).exists())
+ if ((local_config_dir / (dist->package_mask_filename_part() + ".conf.d")).stat().exists())
{
- std::remove_copy_if(DirIterator(local_config_dir / (dist->package_mask_filename_part() + ".conf.d")),
- DirIterator(), std::back_inserter(files),
+ std::remove_copy_if(FSIterator(local_config_dir / (dist->package_mask_filename_part() + ".conf.d"), { }),
+ FSIterator(), std::back_inserter(files),
std::bind(std::logical_not<bool>(), std::bind(&is_file_with_extension, _1, ".conf", IsFileWithOptions())));
- std::remove_copy_if(DirIterator(local_config_dir / (dist->package_mask_filename_part() + ".conf.d")),
- DirIterator(), std::back_inserter(files),
+ std::remove_copy_if(FSIterator(local_config_dir / (dist->package_mask_filename_part() + ".conf.d"), { }),
+ FSIterator(), std::back_inserter(files),
std::bind(std::logical_not<bool>(), std::bind(&is_file_with_extension, _1, ".bash", IsFileWithOptions())));
}
- for (std::list<FSEntry>::const_iterator file(files.begin()), file_end(files.end()) ;
+ for (std::list<FSPath>::const_iterator file(files.begin()), file_end(files.end()) ;
file != file_end ; ++file)
{
Context local_context("When reading package_mask file '" + stringify(*file) + "':");
- if (! file->exists())
+ if (! file->stat().exists())
continue;
_imp->package_mask_conf->add(*file);
@@ -795,25 +796,25 @@ PaludisConfig::PaludisConfig(PaludisEnvironment * const e, const std::string & s
/* user unmask */
{
- std::list<FSEntry> files;
+ std::list<FSPath> files;
files.push_back(local_config_dir / (dist->package_unmask_filename_part() + ".conf"));
files.push_back(local_config_dir / (dist->package_unmask_filename_part() + ".bash"));
- if ((local_config_dir / (dist->package_unmask_filename_part() + ".conf.d")).exists())
+ if ((local_config_dir / (dist->package_unmask_filename_part() + ".conf.d")).stat().exists())
{
- std::remove_copy_if(DirIterator(local_config_dir / (dist->package_unmask_filename_part() + ".conf.d")),
- DirIterator(), std::back_inserter(files),
+ std::remove_copy_if(FSIterator(local_config_dir / (dist->package_unmask_filename_part() + ".conf.d"), { }),
+ FSIterator(), std::back_inserter(files),
std::bind(std::logical_not<bool>(), std::bind(&is_file_with_extension, _1, ".conf", IsFileWithOptions())));
- std::remove_copy_if(DirIterator(local_config_dir / (dist->package_unmask_filename_part() + ".conf.d")),
- DirIterator(), std::back_inserter(files),
+ std::remove_copy_if(FSIterator(local_config_dir / (dist->package_unmask_filename_part() + ".conf.d"), { }),
+ FSIterator(), std::back_inserter(files),
std::bind(std::logical_not<bool>(), std::bind(&is_file_with_extension, _1, ".bash", IsFileWithOptions())));
}
- for (std::list<FSEntry>::const_iterator file(files.begin()), file_end(files.end()) ;
+ for (std::list<FSPath>::const_iterator file(files.begin()), file_end(files.end()) ;
file != file_end ; ++file)
{
Context local_context("When reading package_unmask file '" + stringify(*file) + "':");
- if (! file->exists())
+ if (! file->stat().exists())
continue;
_imp->package_unmask_conf->add(*file);
@@ -822,23 +823,23 @@ PaludisConfig::PaludisConfig(PaludisEnvironment * const e, const std::string & s
/* mirrors */
{
- std::list<FSEntry> files;
+ std::list<FSPath> files;
files.push_back(local_config_dir / (dist->mirrors_filename_part() + ".conf"));
files.push_back(local_config_dir / (dist->mirrors_filename_part() + ".bash"));
- if ((local_config_dir / (dist->mirrors_filename_part() + ".conf.d")).exists())
+ if ((local_config_dir / (dist->mirrors_filename_part() + ".conf.d")).stat().exists())
{
- std::remove_copy_if(DirIterator(local_config_dir / (dist->mirrors_filename_part() + ".conf.d")), DirIterator(), std::back_inserter(files),
+ std::remove_copy_if(FSIterator(local_config_dir / (dist->mirrors_filename_part() + ".conf.d"), { }), FSIterator(), std::back_inserter(files),
std::bind(std::logical_not<bool>(), std::bind(&is_file_with_extension, _1, ".conf", IsFileWithOptions())));
- std::remove_copy_if(DirIterator(local_config_dir / (dist->mirrors_filename_part() + ".conf.d")), DirIterator(), std::back_inserter(files),
+ std::remove_copy_if(FSIterator(local_config_dir / (dist->mirrors_filename_part() + ".conf.d"), { }), FSIterator(), std::back_inserter(files),
std::bind(std::logical_not<bool>(), std::bind(&is_file_with_extension, _1, ".bash", IsFileWithOptions())));
}
- for (std::list<FSEntry>::const_iterator file(files.begin()), file_end(files.end()) ;
+ for (std::list<FSPath>::const_iterator file(files.begin()), file_end(files.end()) ;
file != file_end ; ++file)
{
Context local_context("When reading mirrors file '" + stringify(*file) + "':");
- if (! file->exists())
+ if (! file->stat().exists())
continue;
_imp->mirrors_conf->add(*file);
@@ -853,7 +854,7 @@ PaludisConfig::~PaludisConfig()
}
const std::function<std::string (const std::string &)>
-PaludisConfig::repo_func_from_file(const FSEntry & repo_file)
+PaludisConfig::repo_func_from_file(const FSPath & repo_file)
{
std::shared_ptr<KeyValueConfigFile> kv;
if (is_file_with_extension(repo_file, ".bash", { }))
@@ -890,7 +891,7 @@ PaludisConfig::repo_func_from_file(const FSEntry & repo_file)
return repo_func;
}
-std::shared_ptr<const FSEntrySequence>
+std::shared_ptr<const FSPathSequence>
PaludisConfig::bashrc_files() const
{
return _imp->bashrc_files;
diff --git a/paludis/environments/paludis/paludis_config.hh b/paludis/environments/paludis/paludis_config.hh
index 468948c64..d319f45a3 100644
--- a/paludis/environments/paludis/paludis_config.hh
+++ b/paludis/environments/paludis/paludis_config.hh
@@ -28,7 +28,6 @@
#include <paludis/util/map-fwd.hh>
#include <paludis/util/wrapped_forward_iterator-fwd.hh>
#include <paludis/util/named_value.hh>
-#include <paludis/util/fs_entry-fwd.hh>
#include <string>
@@ -134,14 +133,14 @@ namespace paludis
RepositoryConstIterator end_repositories() const;
- const std::function<std::string (const std::string &)> repo_func_from_file(const FSEntry &);
+ const std::function<std::string (const std::string &)> repo_func_from_file(const FSPath &);
///\}
/**
* Our bashrc files.
*/
- std::shared_ptr<const FSEntrySequence> bashrc_files() const;
+ std::shared_ptr<const FSPathSequence> bashrc_files() const;
/**
* The ROOT.
diff --git a/paludis/environments/paludis/paludis_environment.cc b/paludis/environments/paludis/paludis_environment.cc
index cde353f29..c7ed4e74b 100644
--- a/paludis/environments/paludis/paludis_environment.cc
+++ b/paludis/environments/paludis/paludis_environment.cc
@@ -38,11 +38,11 @@
#include <paludis/user_dep_spec.hh>
#include <paludis/literal_metadata_key.hh>
#include <paludis/repository_factory.hh>
+#include <paludis/standard_output_manager.hh>
#include <paludis/util/wrapped_forward_iterator.hh>
#include <paludis/util/log.hh>
#include <paludis/util/system.hh>
-#include <paludis/util/dir_iterator.hh>
#include <paludis/util/pimp-impl.hh>
#include <paludis/util/is_file_with_extension.hh>
#include <paludis/util/save.hh>
@@ -55,7 +55,9 @@
#include <paludis/util/options.hh>
#include <paludis/util/tribool.hh>
#include <paludis/util/make_named_values.hh>
-#include <paludis/standard_output_manager.hh>
+#include <paludis/util/fs_stat.hh>
+#include <paludis/util/fs_iterator.hh>
+#include <paludis/util/fs_error.hh>
#include <functional>
#include <algorithm>
@@ -73,7 +75,7 @@ namespace paludis
mutable Mutex hook_mutex;
mutable bool done_hooks;
mutable std::shared_ptr<Hooker> hooker;
- mutable std::list<std::pair<FSEntry, bool> > hook_dirs;
+ mutable std::list<std::pair<FSPath, bool> > hook_dirs;
std::shared_ptr<PaludisConfig> config;
std::string paludis_command;
@@ -84,9 +86,9 @@ namespace paludis
mutable std::map<SetName, std::shared_ptr<const SetSpecTree> > sets;
std::shared_ptr<LiteralMetadataValueKey<std::string> > format_key;
- std::shared_ptr<LiteralMetadataValueKey<FSEntry> > config_location_key;
- std::shared_ptr<LiteralMetadataValueKey<FSEntry> > world_file_key;
- std::shared_ptr<LiteralMetadataValueKey<FSEntry> > preferred_root_key;
+ std::shared_ptr<LiteralMetadataValueKey<FSPath> > config_location_key;
+ std::shared_ptr<LiteralMetadataValueKey<FSPath> > world_file_key;
+ std::shared_ptr<LiteralMetadataValueKey<FSPath> > preferred_root_key;
Imp(PaludisEnvironment * const e, std::shared_ptr<PaludisConfig> c) :
done_hooks(false),
@@ -94,21 +96,21 @@ namespace paludis
paludis_command("paludis"),
package_database(std::make_shared<PackageDatabase>(e)),
format_key(std::make_shared<LiteralMetadataValueKey<std::string>>("format", "Format", mkt_significant, "paludis")),
- config_location_key(std::make_shared<LiteralMetadataValueKey<FSEntry>>("conf_dir", "Config dir", mkt_normal,
- config->config_dir())),
- world_file_key(config->world()->location_if_set() ? std::make_shared<LiteralMetadataValueKey<FSEntry>>("world_file", "World file", mkt_normal,
+ config_location_key(std::make_shared<LiteralMetadataValueKey<FSPath>>("conf_dir", "Config dir", mkt_normal,
+ FSPath(config->config_dir()))),
+ world_file_key(config->world()->location_if_set() ? std::make_shared<LiteralMetadataValueKey<FSPath>>("world_file", "World file", mkt_normal,
*config->world()->location_if_set())
- : std::shared_ptr<LiteralMetadataValueKey<FSEntry> >()),
- preferred_root_key(std::make_shared<LiteralMetadataValueKey<FSEntry>>("root", "Root", mkt_normal,
- config->root()))
+ : std::shared_ptr<LiteralMetadataValueKey<FSPath> >()),
+ preferred_root_key(std::make_shared<LiteralMetadataValueKey<FSPath>>("root", "Root", mkt_normal,
+ FSPath(config->root())))
{
}
- void add_one_hook(const FSEntry & r, const bool v) const
+ void add_one_hook(const FSPath & r, const bool v) const
{
try
{
- if (r.is_directory())
+ if (r.stat().is_directory())
{
Log::get_instance()->message("paludis_environment.hooks.add_dir", ll_debug, lc_no_context)
<< "Adding hook directory '" << r << "'";
@@ -126,16 +128,16 @@ namespace paludis
}
}
- void need_hook_dirs(const FSEntry & c) const
+ void need_hook_dirs(const FSPath & c) const
{
if (! done_hooks)
{
add_one_hook(c / "hooks", true);
if (getenv_with_default("PALUDIS_NO_GLOBAL_HOOKS", "").empty())
{
- add_one_hook(FSEntry(LIBEXECDIR) / "paludis" / "hooks", false);
- add_one_hook(FSEntry(DATADIR) / "paludis" / "hooks", true);
- add_one_hook(FSEntry(LIBDIR) / "paludis" / "hooks", true);
+ add_one_hook(FSPath(LIBEXECDIR) / "paludis" / "hooks", false);
+ add_one_hook(FSPath(DATADIR) / "paludis" / "hooks", true);
+ add_one_hook(FSPath(LIBDIR) / "paludis" / "hooks", true);
}
done_hooks = true;
}
@@ -192,7 +194,7 @@ PaludisEnvironment::unmasked_by_user(const PackageID & d) const
return _imp->config->package_unmask_conf()->query(d);
}
-std::shared_ptr<const FSEntrySequence>
+std::shared_ptr<const FSPathSequence>
PaludisEnvironment::bashrc_files() const
{
return _imp->config->bashrc_files();
@@ -219,9 +221,9 @@ PaludisEnvironment::perform_hook(
if (! _imp->hooker)
{
- _imp->need_hook_dirs(_imp->config->config_dir());
+ _imp->need_hook_dirs(FSPath(_imp->config->config_dir()));
_imp->hooker = std::make_shared<Hooker>(this);
- for (std::list<std::pair<FSEntry, bool> >::const_iterator h(_imp->hook_dirs.begin()),
+ for (std::list<std::pair<FSPath, bool> >::const_iterator h(_imp->hook_dirs.begin()),
h_end(_imp->hook_dirs.end()) ; h != h_end ; ++h)
_imp->hooker->add_dir(h->first, h->second);
}
@@ -229,46 +231,46 @@ PaludisEnvironment::perform_hook(
return _imp->hooker->perform_hook(hook, optional_output_manager);
}
-std::shared_ptr<const FSEntrySequence>
+std::shared_ptr<const FSPathSequence>
PaludisEnvironment::hook_dirs() const
{
Lock lock(_imp->hook_mutex);
- _imp->need_hook_dirs(_imp->config->config_dir());
+ _imp->need_hook_dirs(FSPath(_imp->config->config_dir()));
- std::shared_ptr<FSEntrySequence> result(std::make_shared<FSEntrySequence>());
+ std::shared_ptr<FSPathSequence> result(std::make_shared<FSPathSequence>());
std::transform(_imp->hook_dirs.begin(), _imp->hook_dirs.end(), result->back_inserter(),
- std::mem_fn(&std::pair<FSEntry, bool>::first));
+ std::mem_fn(&std::pair<FSPath, bool>::first));
return result;
}
-std::shared_ptr<const FSEntrySequence>
+std::shared_ptr<const FSPathSequence>
PaludisEnvironment::fetchers_dirs() const
{
- std::shared_ptr<FSEntrySequence> result(std::make_shared<FSEntrySequence>());
+ std::shared_ptr<FSPathSequence> result(std::make_shared<FSPathSequence>());
- result->push_back(FSEntry(_imp->config->config_dir()) / "fetchers");
+ result->push_back(FSPath(_imp->config->config_dir()) / "fetchers");
if (getenv_with_default("PALUDIS_NO_GLOBAL_FETCHERS", "").empty())
{
- std::shared_ptr<const FSEntrySequence> r(EnvironmentImplementation::fetchers_dirs());
+ std::shared_ptr<const FSPathSequence> r(EnvironmentImplementation::fetchers_dirs());
std::copy(r->begin(), r->end(), result->back_inserter());
}
return result;
}
-std::shared_ptr<const FSEntrySequence>
+std::shared_ptr<const FSPathSequence>
PaludisEnvironment::syncers_dirs() const
{
- std::shared_ptr<FSEntrySequence> result(std::make_shared<FSEntrySequence>());
+ std::shared_ptr<FSPathSequence> result(std::make_shared<FSPathSequence>());
- result->push_back(FSEntry(_imp->config->config_dir()) / "syncers");
+ result->push_back(FSPath(_imp->config->config_dir()) / "syncers");
if (getenv_with_default("PALUDIS_NO_GLOBAL_SYNCERS", "").empty())
{
- std::shared_ptr<const FSEntrySequence> r(EnvironmentImplementation::syncers_dirs());
+ std::shared_ptr<const FSPathSequence> r(EnvironmentImplementation::syncers_dirs());
std::copy(r->begin(), r->end(), result->back_inserter());
}
@@ -443,13 +445,13 @@ PaludisEnvironment::format_key() const
return _imp->format_key;
}
-const std::shared_ptr<const MetadataValueKey<FSEntry> >
+const std::shared_ptr<const MetadataValueKey<FSPath> >
PaludisEnvironment::config_location_key() const
{
return _imp->config_location_key;
}
-const std::shared_ptr<const MetadataValueKey<FSEntry> >
+const std::shared_ptr<const MetadataValueKey<FSPath> >
PaludisEnvironment::preferred_root_key() const
{
return _imp->preferred_root_key;
@@ -499,7 +501,7 @@ namespace
std::shared_ptr<const SetSpecTree> make_set(
const Environment * const env,
- const FSEntry & f,
+ const FSPath & f,
const SetName & n,
SetFileSetOperatorMode mode,
SetFileType type)
@@ -527,14 +529,13 @@ PaludisEnvironment::populate_sets() const
Lock lock(_imp->sets_mutex);
add_set(SetName("world"), SetName("world::environment"), std::bind(&make_world_set, _imp->config->world()), true);
- FSEntry sets_dir(FSEntry(_imp->config->config_dir()) / "sets");
+ FSPath sets_dir(FSPath(_imp->config->config_dir()) / "sets");
Context context("When looking in sets directory '" + stringify(sets_dir) + "':");
- if (! sets_dir.exists())
+ if (! sets_dir.stat().exists())
return;
- for (DirIterator d(sets_dir, { dio_inode_sort }), d_end ;
- d != d_end ; ++d)
+ for (FSIterator d(sets_dir, { fsio_inode_sort }), d_end ; d != d_end ; ++d)
{
if (is_file_with_extension(*d, ".bash", { }))
{
@@ -556,7 +557,7 @@ PaludisEnvironment::populate_sets() const
}
const std::shared_ptr<Repository>
-PaludisEnvironment::repository_from_new_config_file(const FSEntry & f)
+PaludisEnvironment::repository_from_new_config_file(const FSPath & f)
{
const std::function<std::string (const std::string &)> repo_func(_imp->config->repo_func_from_file(f));
if (! repo_func)
diff --git a/paludis/environments/paludis/paludis_environment.hh b/paludis/environments/paludis/paludis_environment.hh
index c5829238b..04eb5c60a 100644
--- a/paludis/environments/paludis/paludis_environment.hh
+++ b/paludis/environments/paludis/paludis_environment.hh
@@ -76,16 +76,16 @@ namespace paludis
///\}
- virtual std::shared_ptr<const FSEntrySequence> bashrc_files() const
+ virtual std::shared_ptr<const FSPathSequence> bashrc_files() const
PALUDIS_ATTRIBUTE((warn_unused_result));
- virtual std::shared_ptr<const FSEntrySequence> syncers_dirs() const
+ virtual std::shared_ptr<const FSPathSequence> syncers_dirs() const
PALUDIS_ATTRIBUTE((warn_unused_result));
- virtual std::shared_ptr<const FSEntrySequence> fetchers_dirs() const
+ virtual std::shared_ptr<const FSPathSequence> fetchers_dirs() const
PALUDIS_ATTRIBUTE((warn_unused_result));
- virtual std::shared_ptr<const FSEntrySequence> hook_dirs() const
+ virtual std::shared_ptr<const FSPathSequence> hook_dirs() const
PALUDIS_ATTRIBUTE((warn_unused_result));
virtual uid_t reduced_uid() const
@@ -140,8 +140,8 @@ namespace paludis
virtual bool remove_from_world(const SetName &) const;
virtual const std::shared_ptr<const MetadataValueKey<std::string> > format_key() const;
- virtual const std::shared_ptr<const MetadataValueKey<FSEntry> > config_location_key() const;
- virtual const std::shared_ptr<const MetadataValueKey<FSEntry> > preferred_root_key() const;
+ virtual const std::shared_ptr<const MetadataValueKey<FSPath> > config_location_key() const;
+ virtual const std::shared_ptr<const MetadataValueKey<FSPath> > preferred_root_key() const;
virtual const Tribool want_choice_enabled(
const std::shared_ptr<const PackageID> &,
@@ -167,7 +167,7 @@ namespace paludis
const CreateOutputManagerInfo &) const;
virtual const std::shared_ptr<Repository> repository_from_new_config_file(
- const FSEntry &) PALUDIS_ATTRIBUTE((warn_unused_result));
+ const FSPath &) PALUDIS_ATTRIBUTE((warn_unused_result));
virtual void update_config_files_for_package_move(
const PackageDepSpec &, const QualifiedPackageName &) const;
diff --git a/paludis/environments/paludis/paludis_environment_TEST.cc b/paludis/environments/paludis/paludis_environment_TEST.cc
index f045eeb57..787e471be 100644
--- a/paludis/environments/paludis/paludis_environment_TEST.cc
+++ b/paludis/environments/paludis/paludis_environment_TEST.cc
@@ -19,7 +19,6 @@
#include "paludis_environment.hh"
#include "paludis_config.hh"
-#include <paludis/util/fs_entry.hh>
#include <paludis/util/sequence.hh>
#include <paludis/util/set.hh>
#include <paludis/util/wrapped_forward_iterator.hh>
@@ -58,7 +57,7 @@ namespace test_cases
void run()
{
- setenv("PALUDIS_HOME", stringify(FSEntry::cwd() / "paludis_environment_TEST_dir" / "home1").c_str(), 1);
+ setenv("PALUDIS_HOME", stringify(FSPath::cwd() / "paludis_environment_TEST_dir" / "home1").c_str(), 1);
unsetenv("PALUDIS_SKIP_CONFIG");
std::shared_ptr<Environment> env(std::make_shared<PaludisEnvironment>(""));
@@ -91,7 +90,7 @@ namespace test_cases
void run()
{
- setenv("PALUDIS_HOME", stringify(FSEntry::cwd() / "paludis_environment_TEST_dir" / "home5").c_str(), 1);
+ setenv("PALUDIS_HOME", stringify(FSPath::cwd() / "paludis_environment_TEST_dir" / "home5").c_str(), 1);
unsetenv("PALUDIS_SKIP_CONFIG");
std::shared_ptr<Environment> env(std::make_shared<PaludisEnvironment>(""));
@@ -117,7 +116,7 @@ namespace test_cases
void run()
{
- setenv("PALUDIS_HOME", stringify(FSEntry::cwd() / "paludis_environment_TEST_dir" / "home2").c_str(), 1);
+ setenv("PALUDIS_HOME", stringify(FSPath::cwd() / "paludis_environment_TEST_dir" / "home2").c_str(), 1);
unsetenv("PALUDIS_SKIP_CONFIG");
std::shared_ptr<Environment> env(std::make_shared<PaludisEnvironment>(""));
@@ -150,7 +149,7 @@ namespace test_cases
void run()
{
- setenv("PALUDIS_HOME", stringify(FSEntry::cwd() / "paludis_environment_TEST_dir" / "home3").c_str(), 1);
+ setenv("PALUDIS_HOME", stringify(FSPath::cwd() / "paludis_environment_TEST_dir" / "home3").c_str(), 1);
unsetenv("PALUDIS_SKIP_CONFIG");
std::shared_ptr<Environment> env(std::make_shared<PaludisEnvironment>(""));
@@ -183,7 +182,7 @@ namespace test_cases
void run()
{
- setenv("PALUDIS_HOME", stringify(FSEntry::cwd() / "paludis_environment_TEST_dir" / "home4").c_str(), 1);
+ setenv("PALUDIS_HOME", stringify(FSPath::cwd() / "paludis_environment_TEST_dir" / "home4").c_str(), 1);
unsetenv("PALUDIS_SKIP_CONFIG");
std::shared_ptr<Environment> env(std::make_shared<PaludisEnvironment>(""));
diff --git a/paludis/environments/paludis/use_conf.cc b/paludis/environments/paludis/use_conf.cc
index e67127208..8cf21b781 100644
--- a/paludis/environments/paludis/use_conf.cc
+++ b/paludis/environments/paludis/use_conf.cc
@@ -21,7 +21,6 @@
#include <paludis/environments/paludis/paludis_environment.hh>
#include <paludis/environments/paludis/bashable_conf.hh>
#include <paludis/util/pimp-impl.hh>
-#include <paludis/util/fs_entry.hh>
#include <paludis/util/make_named_values.hh>
#include <paludis/util/tribool.hh>
#include <paludis/paludislike_options_conf.hh>
@@ -60,7 +59,7 @@ UseConf::~UseConf()
}
void
-UseConf::add(const FSEntry & filename)
+UseConf::add(const FSPath & filename)
{
Context context("When adding source '" + stringify(filename) + "' as a use file:");
diff --git a/paludis/environments/paludis/use_conf.hh b/paludis/environments/paludis/use_conf.hh
index 6ce0a634c..f945e4f29 100644
--- a/paludis/environments/paludis/use_conf.hh
+++ b/paludis/environments/paludis/use_conf.hh
@@ -21,7 +21,7 @@
#define PALUDIS_GUARD_PALUDIS_PALUDIS_ENVIRONMENTS_PALUDIS_USE_CONF_HH 1
#include <paludis/util/pimp.hh>
-#include <paludis/util/fs_entry-fwd.hh>
+#include <paludis/util/fs_path-fwd.hh>
#include <paludis/util/tribool-fwd.hh>
#include <paludis/choice-fwd.hh>
#include <paludis/name-fwd.hh>
@@ -57,7 +57,7 @@ namespace paludis
/**
* Add another file.
*/
- void add(const FSEntry &);
+ void add(const FSPath &);
const Tribool want_choice_enabled(
const std::shared_ptr<const PackageID> &,
diff --git a/paludis/environments/paludis/world.cc b/paludis/environments/paludis/world.cc
index 714f185e0..79e865da1 100644
--- a/paludis/environments/paludis/world.cc
+++ b/paludis/environments/paludis/world.cc
@@ -19,12 +19,12 @@
#include <paludis/environments/paludis/world.hh>
#include <paludis/util/pimp-impl.hh>
-#include <paludis/util/fs_entry.hh>
#include <paludis/util/mutex.hh>
#include <paludis/util/stringify.hh>
#include <paludis/util/log.hh>
#include <paludis/util/make_named_values.hh>
#include <paludis/util/safe_ofstream.hh>
+#include <paludis/util/fs_stat.hh>
#include <paludis/set_file.hh>
#include <paludis/user_dep_spec.hh>
#include <paludis/dep_tag.hh>
@@ -40,10 +40,10 @@ namespace paludis
struct Imp<World>
{
const Environment * const env;
- const std::shared_ptr<const FSEntry> maybe_world_file;
+ const std::shared_ptr<const FSPath> maybe_world_file;
mutable Mutex mutex;
- Imp(const Environment * const e, const std::shared_ptr<const FSEntry> & m) :
+ Imp(const Environment * const e, const std::shared_ptr<const FSPath> & m) :
env(e),
maybe_world_file(m)
{
@@ -51,7 +51,7 @@ namespace paludis
};
}
-World::World(const Environment * const e, const std::shared_ptr<const FSEntry> & f) :
+World::World(const Environment * const e, const std::shared_ptr<const FSPath> & f) :
Pimp<World>(e, f)
{
}
@@ -102,7 +102,7 @@ World::_add_string_to_world(const std::string & n) const
Context context("When adding '" + n + "' to world file '" + stringify(*_imp->maybe_world_file) + "':");
- if (! _imp->maybe_world_file->exists())
+ if (! _imp->maybe_world_file->stat().exists())
{
try
{
@@ -147,7 +147,7 @@ World::_remove_string_from_world(const std::string & n) const
Context context("When removing '" + n + "' from world file '" + stringify(*_imp->maybe_world_file) + "':");
- if (_imp->maybe_world_file->exists())
+ if (_imp->maybe_world_file->stat().exists())
{
SetFile world(make_named_values<SetFileParams>(
n::environment() = _imp->env,
@@ -181,7 +181,7 @@ World::world_set() const
if (_imp->maybe_world_file)
{
- if (_imp->maybe_world_file->exists())
+ if (_imp->maybe_world_file->stat().exists())
{
SetFile world(make_named_values<SetFileParams>(
n::environment() = _imp->env,
@@ -201,7 +201,7 @@ World::world_set() const
return std::make_shared<SetSpecTree>(std::make_shared<AllDepSpec>());
}
-std::shared_ptr<const FSEntry>
+std::shared_ptr<const FSPath>
World::location_if_set() const
{
return _imp->maybe_world_file;
diff --git a/paludis/environments/paludis/world.hh b/paludis/environments/paludis/world.hh
index 1915e5960..9a0a27b99 100644
--- a/paludis/environments/paludis/world.hh
+++ b/paludis/environments/paludis/world.hh
@@ -21,7 +21,7 @@
#define PALUDIS_GUARD_PALUDIS_ENVIRONMENTS_PALUDIS_WORLD_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/spec_tree.hh>
#include <paludis/environment-fwd.hh>
@@ -40,7 +40,7 @@ namespace paludis
bool _remove_string_from_world(const std::string &) const;
public:
- World(const Environment * const, const std::shared_ptr<const FSEntry> &);
+ World(const Environment * const, const std::shared_ptr<const FSPath> &);
~World();
const std::shared_ptr<const SetSpecTree> world_set() const PALUDIS_ATTRIBUTE((warn_unused_result));
@@ -51,7 +51,7 @@ namespace paludis
bool remove_from_world(const SetName &) const;
bool remove_from_world(const QualifiedPackageName &) const;
- std::shared_ptr<const FSEntry> location_if_set() const;
+ std::shared_ptr<const FSPath> location_if_set() const;
void update_config_files_for_package_move(
const PackageDepSpec &, const QualifiedPackageName &) const;
diff --git a/paludis/environments/paludis/world_TEST.cc b/paludis/environments/paludis/world_TEST.cc
index 181f3bb50..56bef9da4 100644
--- a/paludis/environments/paludis/world_TEST.cc
+++ b/paludis/environments/paludis/world_TEST.cc
@@ -19,7 +19,6 @@
#include <paludis/environments/paludis/world.hh>
#include <paludis/environments/test/test_environment.hh>
-#include <paludis/util/fs_entry.hh>
#include <paludis/util/safe_ifstream.hh>
#include <paludis/util/options.hh>
#include <paludis/partially_made_package_dep_spec.hh>
@@ -39,7 +38,7 @@ namespace test_cases
void run()
{
- std::shared_ptr<FSEntry> w(std::make_shared<FSEntry>(FSEntry::cwd() / "world_TEST_dir" / "world"));
+ std::shared_ptr<FSPath> w(std::make_shared<FSPath>(FSPath::cwd() / "world_TEST_dir" / "world"));
{
TestEnvironment env;