aboutsummaryrefslogtreecommitdiff
path: root/paludis/environments
diff options
context:
space:
mode:
Diffstat (limited to 'paludis/environments')
-rw-r--r--paludis/environments/no_config/no_config_environment.cc56
-rw-r--r--paludis/environments/no_config/no_config_environment.hh17
-rw-r--r--paludis/environments/no_config/no_config_environment_TEST.cc7
-rw-r--r--paludis/environments/no_config/registration.cc14
-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
-rw-r--r--paludis/environments/portage/portage_environment.cc106
-rw-r--r--paludis/environments/portage/portage_environment.hh22
-rw-r--r--paludis/environments/portage/portage_environment_TEST.cc6
-rw-r--r--paludis/environments/test/test_environment.cc24
-rw-r--r--paludis/environments/test/test_environment.hh10
31 files changed, 317 insertions, 312 deletions
diff --git a/paludis/environments/no_config/no_config_environment.cc b/paludis/environments/no_config/no_config_environment.cc
index 8e3aaf577..7762b28bd 100644
--- a/paludis/environments/no_config/no_config_environment.cc
+++ b/paludis/environments/no_config/no_config_environment.cc
@@ -20,7 +20,6 @@
#include <paludis/environments/no_config/no_config_environment.hh>
#include <paludis/util/tokeniser.hh>
#include <paludis/util/log.hh>
-#include <paludis/util/dir_iterator.hh>
#include <paludis/util/wrapped_forward_iterator.hh>
#include <paludis/util/map-impl.hh>
#include <paludis/util/set.hh>
@@ -35,6 +34,9 @@
#include <paludis/util/hashes.hh>
#include <paludis/util/member_iterator-impl.hh>
#include <paludis/util/sequence-impl.hh>
+#include <paludis/util/fs_path.hh>
+#include <paludis/util/fs_stat.hh>
+#include <paludis/util/fs_iterator.hh>
#include <paludis/standard_output_manager.hh>
#include <paludis/distribution.hh>
#include <paludis/package_database.hh>
@@ -62,8 +64,8 @@ namespace paludis
{
const no_config_environment::Params params;
- const FSEntry top_level_dir;
- const FSEntry write_cache;
+ const FSPath top_level_dir;
+ const FSPath write_cache;
bool accept_unstable;
bool is_vdb;
@@ -76,8 +78,8 @@ namespace paludis
std::shared_ptr<PackageDatabase> package_database;
std::shared_ptr<LiteralMetadataValueKey<std::string> > format_key;
- std::shared_ptr<LiteralMetadataValueKey<FSEntry> > repository_dir_key;
- std::shared_ptr<LiteralMetadataValueKey<FSEntry> > preferred_root_key;
+ std::shared_ptr<LiteralMetadataValueKey<FSPath> > repository_dir_key;
+ std::shared_ptr<LiteralMetadataValueKey<FSPath> > preferred_root_key;
Imp(NoConfigEnvironment * const env, const no_config_environment::Params & params);
void initialise(NoConfigEnvironment * const env);
@@ -88,7 +90,7 @@ namespace paludis
namespace
{
- bool is_vdb_repository(const FSEntry & location, no_config_environment::RepositoryType type)
+ bool is_vdb_repository(const FSPath & location, no_config_environment::RepositoryType type)
{
switch (type)
{
@@ -103,10 +105,10 @@ namespace
Context context("When determining repository type at '" + stringify(location) + "':");
- if (! location.is_directory())
+ if (! location.stat().is_directory())
throw ConfigurationError("Location is not a directory");
- if ((location / "profiles").is_directory())
+ if ((location / "profiles").stat().is_directory())
{
Log::get_instance()->message("no_config_environment.ebuild_detected", ll_debug, lc_context)
<< "Found profiles/, looks like Ebuild format";
@@ -114,18 +116,18 @@ namespace
}
int outer_count(0);
- for (DirIterator d(location), d_end ; d != d_end ; ++d)
+ for (FSIterator d(location, { }), d_end ; d != d_end ; ++d)
{
- if (! d->is_directory())
+ if (! d->stat().is_directory())
continue;
int inner_count(0);
- for (DirIterator e(*d), e_end ; e != e_end ; ++e)
+ for (FSIterator e(*d, { }), e_end ; e != e_end ; ++e)
{
- if (! e->is_directory())
+ if (! e->stat().is_directory())
continue;
- if ((*e / "CONTENTS").exists())
+ if ((*e / "CONTENTS").stat().exists())
{
Log::get_instance()->message("no_config_environment.vdb_detected", ll_debug, lc_context)
<< "Found '" << stringify(*e) << "/CONTENTS', looks like VDB format";
@@ -164,10 +166,10 @@ Imp<NoConfigEnvironment>::Imp(
paludis_command("false"),
package_database(std::make_shared<PackageDatabase>(env)),
format_key(std::make_shared<LiteralMetadataValueKey<std::string>>("format", "Format", mkt_significant, "no_config")),
- repository_dir_key(std::make_shared<LiteralMetadataValueKey<FSEntry>>("repository_dir", "Repository dir",
+ repository_dir_key(std::make_shared<LiteralMetadataValueKey<FSPath>>("repository_dir", "Repository dir",
mkt_normal, p.repository_dir())),
- preferred_root_key(std::make_shared<LiteralMetadataValueKey<FSEntry>>("root", "Root",
- mkt_normal, FSEntry("/")))
+ preferred_root_key(std::make_shared<LiteralMetadataValueKey<FSPath>>("root", "Root",
+ mkt_normal, FSPath("/")))
{
}
@@ -179,12 +181,12 @@ Imp<NoConfigEnvironment>::initialise(NoConfigEnvironment * const env)
if (! is_vdb)
{
/* don't assume these're in initialisable order. */
- std::map<FSEntry, bool> repository_dirs;
+ std::map<FSPath, bool, FSPathComparator> repository_dirs;
RepositoryName main_repository_name("x");
bool ignored_one(false);
repository_dirs.insert(std::make_pair(params.repository_dir(), true));
- for (FSEntrySequence::ConstIterator d(params.extra_repository_dirs()->begin()), d_end(params.extra_repository_dirs()->end()) ;
+ for (FSPathSequence::ConstIterator d(params.extra_repository_dirs()->begin()), d_end(params.extra_repository_dirs()->end()) ;
d != d_end ; ++d)
{
if (params.repository_dir().realpath() == d->realpath())
@@ -201,7 +203,7 @@ Imp<NoConfigEnvironment>::initialise(NoConfigEnvironment * const env)
std::unordered_map<RepositoryName, std::function<std::string (const std::string &)>,
Hash<RepositoryName> > repo_configs;
- for (std::map<FSEntry, bool>::const_iterator r(repository_dirs.begin()), r_end(repository_dirs.end()) ;
+ for (auto r(repository_dirs.begin()), r_end(repository_dirs.end()) ;
r != r_end ; ++r)
{
Context local_context("When reading repository at location '" + stringify(r->first) + "':");
@@ -225,7 +227,7 @@ Imp<NoConfigEnvironment>::initialise(NoConfigEnvironment * const env)
if (r->second && ! params.master_repository_name().empty())
keys->insert("master_repository", params.master_repository_name());
- if ((r->first / "metadata" / "profiles_desc.conf").exists())
+ if ((r->first / "metadata" / "profiles_desc.conf").stat().exists())
keys->insert("layout", "exheres");
std::function<std::string (const std::string &)> repo_func(
@@ -377,7 +379,7 @@ NoConfigEnvironment::~NoConfigEnvironment()
{
}
-FSEntry
+FSPath
NoConfigEnvironment::main_repository_dir() const
{
return _imp->top_level_dir;
@@ -548,10 +550,10 @@ NoConfigEnvironment::perform_hook(
return make_named_values<HookResult>(n::max_exit_status() = 0, n::output() = "");
}
-std::shared_ptr<const FSEntrySequence>
+std::shared_ptr<const FSPathSequence>
NoConfigEnvironment::hook_dirs() const
{
- return std::make_shared<FSEntrySequence>();
+ return std::make_shared<FSPathSequence>();
}
void
@@ -565,13 +567,13 @@ NoConfigEnvironment::format_key() const
return _imp->format_key;
}
-const std::shared_ptr<const MetadataValueKey<FSEntry> >
+const std::shared_ptr<const MetadataValueKey<FSPath> >
NoConfigEnvironment::config_location_key() const
{
- return std::shared_ptr<const MetadataValueKey<FSEntry> >();
+ return std::shared_ptr<const MetadataValueKey<FSPath> >();
}
-const std::shared_ptr<const MetadataValueKey<FSEntry> >
+const std::shared_ptr<const MetadataValueKey<FSPath> >
NoConfigEnvironment::preferred_root_key() const
{
return _imp->preferred_root_key;
@@ -618,7 +620,7 @@ NoConfigEnvironment::populate_sets() const
}
const std::shared_ptr<Repository>
-NoConfigEnvironment::repository_from_new_config_file(const FSEntry &)
+NoConfigEnvironment::repository_from_new_config_file(const FSPath &)
{
throw InternalError(PALUDIS_HERE, "can't create repositories on the fly for NoConfigEnvironment");
}
diff --git a/paludis/environments/no_config/no_config_environment.hh b/paludis/environments/no_config/no_config_environment.hh
index a2b1a31e9..c240a3473 100644
--- a/paludis/environments/no_config/no_config_environment.hh
+++ b/paludis/environments/no_config/no_config_environment.hh
@@ -21,7 +21,6 @@
#define PALUDIS_GUARD_PALUDIS_ENVIRONMENT_NO_CONFIG_NO_CONFIG_ENVIRONMENT_HH 1
#include <paludis/environment_implementation.hh>
-#include <paludis/util/fs_entry.hh>
#include <paludis/util/pimp.hh>
#include <paludis/util/map-fwd.hh>
@@ -58,7 +57,7 @@ namespace paludis
NamedValue<n::disable_metadata_cache, bool> disable_metadata_cache;
NamedValue<n::extra_accept_keywords, std::string> extra_accept_keywords;
NamedValue<n::extra_params, std::shared_ptr<Map<std::string, std::string> > > extra_params;
- NamedValue<n::extra_repository_dirs, std::shared_ptr<const FSEntrySequence> > extra_repository_dirs;
+ NamedValue<n::extra_repository_dirs, std::shared_ptr<const FSPathSequence> > extra_repository_dirs;
NamedValue<n::master_repository_name, std::string> master_repository_name;
/**
@@ -70,9 +69,9 @@ namespace paludis
*/
NamedValue<n::profiles_if_not_auto, std::string> profiles_if_not_auto;
- NamedValue<n::repository_dir, FSEntry> repository_dir;
+ NamedValue<n::repository_dir, FSPath> repository_dir;
NamedValue<n::repository_type, no_config_environment::RepositoryType> repository_type;
- NamedValue<n::write_cache, FSEntry> write_cache;
+ NamedValue<n::write_cache, FSPath> write_cache;
};
}
@@ -110,7 +109,7 @@ namespace paludis
/**
* What is our top level directory for our main repository?
*/
- FSEntry main_repository_dir() const;
+ FSPath main_repository_dir() const;
/**
* Should we accept unstable keywords?
@@ -190,7 +189,7 @@ namespace paludis
virtual bool unmasked_by_user(const PackageID &) 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;
@@ -214,14 +213,14 @@ 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 std::shared_ptr<OutputManager> create_output_manager(
const CreateOutputManagerInfo &) const;
virtual const std::shared_ptr<Repository> repository_from_new_config_file(
- const FSEntry &) PALUDIS_ATTRIBUTE((noreturn));
+ const FSPath &) PALUDIS_ATTRIBUTE((noreturn));
virtual void update_config_files_for_package_move(
const PackageDepSpec &, const QualifiedPackageName &) const;
diff --git a/paludis/environments/no_config/no_config_environment_TEST.cc b/paludis/environments/no_config/no_config_environment_TEST.cc
index 1a987bf9d..b0a09db07 100644
--- a/paludis/environments/no_config/no_config_environment_TEST.cc
+++ b/paludis/environments/no_config/no_config_environment_TEST.cc
@@ -21,7 +21,6 @@
#include <test/test_runner.hh>
#include <test/test_framework.hh>
#include <paludis/util/sequence.hh>
-#include <paludis/util/fs_entry.hh>
#include <paludis/util/make_named_values.hh>
using namespace test;
@@ -40,12 +39,12 @@ namespace test_cases
n::disable_metadata_cache() = false,
n::extra_accept_keywords() = "",
n::extra_params() = std::shared_ptr<Map<std::string, std::string> >(),
- n::extra_repository_dirs() = std::make_shared<FSEntrySequence>(),
+ n::extra_repository_dirs() = std::make_shared<FSPathSequence>(),
n::master_repository_name() = "",
n::profiles_if_not_auto() = "",
- n::repository_dir() = FSEntry("no_config_environment_TEST_dir/repo"),
+ n::repository_dir() = FSPath("no_config_environment_TEST_dir/repo"),
n::repository_type() = no_config_environment::ncer_auto,
- n::write_cache() = FSEntry("/var/empty")
+ n::write_cache() = FSPath("/var/empty")
));
TEST_CHECK(bool(e.package_database()));
diff --git a/paludis/environments/no_config/registration.cc b/paludis/environments/no_config/registration.cc
index d23873f31..0f6f74b25 100644
--- a/paludis/environments/no_config/registration.cc
+++ b/paludis/environments/no_config/registration.cc
@@ -39,9 +39,9 @@ namespace
std::shared_ptr<Map<std::string, std::string> > extra_params(
std::make_shared<Map<std::string, std::string>>());
- FSEntry repository_dir(FSEntry::cwd());
- std::shared_ptr<FSEntrySequence> extra_repository_dirs(std::make_shared<FSEntrySequence>());
- FSEntry write_cache("/var/empty");
+ FSPath repository_dir(FSPath::cwd());
+ std::shared_ptr<FSPathSequence> extra_repository_dirs(std::make_shared<FSPathSequence>());
+ FSPath write_cache("/var/empty");
std::string profile;
std::string master_repository_name;
bool disable_metadata_cache(false);
@@ -56,24 +56,24 @@ namespace
{
std::string::size_type p(t->find('='));
if (std::string::npos == p)
- repository_dir = *t;
+ repository_dir = FSPath(*t);
else
{
std::string key(t->substr(0, p)), value(t->substr(p + 1));
if (key == "write-cache")
- write_cache = value;
+ write_cache = FSPath(value);
else if (key == "master-repository-name")
master_repository_name = value;
else if (key == "master-repository-dir")
throw ConfigurationError("NoConfigEnvironment key master-repository-dir is no longer "
"supported, use master-repository-name and extra-repository-dir");
else if (key == "extra-repository-dir")
- extra_repository_dirs->push_back(value);
+ extra_repository_dirs->push_back(FSPath(value));
else if (key == "profile")
profile = value;
else if (key == "repository-dir")
- repository_dir = value;
+ repository_dir = FSPath(value);
else if (key == "disable-metadata-cache")
disable_metadata_cache = destringify<bool>(value);
else if (key == "accept-unstable")
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;
diff --git a/paludis/environments/portage/portage_environment.cc b/paludis/environments/portage/portage_environment.cc
index e11281d98..04e74a8ff 100644
--- a/paludis/environments/portage/portage_environment.cc
+++ b/paludis/environments/portage/portage_environment.cc
@@ -18,6 +18,7 @@
*/
#include "portage_environment.hh"
+
#include <paludis/util/log.hh>
#include <paludis/util/tokeniser.hh>
#include <paludis/util/system.hh>
@@ -26,7 +27,6 @@
#include <paludis/util/iterator_funcs.hh>
#include <paludis/util/save.hh>
#include <paludis/util/pimp-impl.hh>
-#include <paludis/util/dir_iterator.hh>
#include <paludis/util/wrapped_output_iterator.hh>
#include <paludis/util/strip.hh>
#include <paludis/util/set.hh>
@@ -36,8 +36,12 @@
#include <paludis/util/config_file.hh>
#include <paludis/util/tribool.hh>
#include <paludis/util/make_named_values.hh>
-#include <paludis/standard_output_manager.hh>
#include <paludis/util/safe_ofstream.hh>
+#include <paludis/util/fs_stat.hh>
+#include <paludis/util/fs_iterator.hh>
+#include <paludis/util/fs_error.hh>
+
+#include <paludis/standard_output_manager.hh>
#include <paludis/hooker.hh>
#include <paludis/hook.hh>
#include <paludis/mask.hh>
@@ -52,12 +56,14 @@
#include <paludis/repository_factory.hh>
#include <paludis/choice.hh>
#include <paludis/partially_made_package_dep_spec.hh>
+
#include <functional>
#include <algorithm>
#include <set>
#include <map>
#include <vector>
#include <list>
+
#include "config.h"
using namespace paludis;
@@ -78,7 +84,7 @@ namespace paludis
template<>
struct Imp<PortageEnvironment>
{
- const FSEntry conf_dir;
+ const FSPath conf_dir;
std::string paludis_command;
std::shared_ptr<KeyValueConfigFile> vars;
@@ -99,22 +105,22 @@ namespace paludis
mutable Mutex hook_mutex;
mutable bool done_hooks;
mutable std::shared_ptr<Hooker> hooker;
- mutable std::list<FSEntry> hook_dirs;
+ mutable std::list<FSPath> hook_dirs;
int overlay_importance;
std::shared_ptr<PackageDatabase> package_database;
- const FSEntry world_file;
+ const FSPath world_file;
mutable Mutex world_mutex;
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(Environment * const e, const std::string & s) :
- conf_dir(FSEntry(s.empty() ? "/" : s) / SYSCONFDIR),
+ conf_dir(FSPath(s.empty() ? "/" : s) / SYSCONFDIR),
paludis_command("paludis"),
ignore_all_breaks_portage(false),
done_hooks(false),
@@ -122,18 +128,18 @@ namespace paludis
package_database(std::make_shared<PackageDatabase>(e)),
world_file(s + "/var/lib/portage/world"),
format_key(std::make_shared<LiteralMetadataValueKey<std::string>>("format", "Format", mkt_significant, "portage")),
- config_location_key(std::make_shared<LiteralMetadataValueKey<FSEntry>>("conf_dir", "Config dir", mkt_normal,
+ config_location_key(std::make_shared<LiteralMetadataValueKey<FSPath>>("conf_dir", "Config dir", mkt_normal,
conf_dir)),
- world_file_key(std::make_shared<LiteralMetadataValueKey<FSEntry>>("world_file", "World file", mkt_normal,
+ world_file_key(std::make_shared<LiteralMetadataValueKey<FSPath>>("world_file", "World file", mkt_normal,
world_file))
{
}
- void add_one_hook(const FSEntry & r) const
+ void add_one_hook(const FSPath & r) const
{
try
{
- if (r.is_directory())
+ if (r.stat().is_directory())
{
Log::get_instance()->message("portage_environment.hooks.add_dir", ll_debug, lc_no_context)
<< "Adding hook directory '" << r << "'";
@@ -156,7 +162,7 @@ namespace paludis
if (! done_hooks)
{
if (getenv_with_default("PALUDIS_NO_GLOBAL_HOOKS", "").empty())
- add_one_hook(FSEntry(LIBEXECDIR) / "paludis" / "hooks");
+ add_one_hook(FSPath(LIBEXECDIR) / "paludis" / "hooks");
done_hooks = true;
}
@@ -236,16 +242,16 @@ PortageEnvironment::PortageEnvironment(const std::string & s) :
"functionality. Full support for Portage configuration formats is not "
"guaranteed; issues should be reported via trac.";
- _imp->vars = std::make_shared<KeyValueConfigFile>(FSEntry("/dev/null"), KeyValueConfigFileOptions(),
+ _imp->vars = std::make_shared<KeyValueConfigFile>(FSPath("/dev/null"), KeyValueConfigFileOptions(),
&KeyValueConfigFile::no_defaults, &KeyValueConfigFile::no_transformation);
_load_profile((_imp->conf_dir / "make.profile").realpath());
- if ((_imp->conf_dir / "make.globals").exists())
+ if ((_imp->conf_dir / "make.globals").stat().exists())
_imp->vars = std::make_shared<KeyValueConfigFile>(_imp->conf_dir / "make.globals", KeyValueConfigFileOptions() +
kvcfo_disallow_space_inside_unquoted_values + kvcfo_allow_inline_comments + kvcfo_allow_multiple_assigns_per_line,
std::bind(&predefined, _imp->vars, std::placeholders::_1, std::placeholders::_2),
&do_incremental);
- if ((_imp->conf_dir / "make.conf").exists())
+ if ((_imp->conf_dir / "make.conf").stat().exists())
_imp->vars = std::make_shared<KeyValueConfigFile>(_imp->conf_dir / "make.conf", KeyValueConfigFileOptions() +
kvcfo_disallow_space_inside_unquoted_values + kvcfo_allow_inline_comments + kvcfo_allow_multiple_assigns_per_line,
std::bind(&predefined, _imp->vars, std::placeholders::_1, std::placeholders::_2),
@@ -255,7 +261,7 @@ PortageEnvironment::PortageEnvironment(const std::string & s) :
std::string fixed_root_var(_imp->vars->get("ROOT"));
if (fixed_root_var.empty())
fixed_root_var = "/";
- _imp->preferred_root_key = std::make_shared<LiteralMetadataValueKey<FSEntry>>("root", "Root", mkt_normal, FSEntry(fixed_root_var));
+ _imp->preferred_root_key = std::make_shared<LiteralMetadataValueKey<FSPath>>("root", "Root", mkt_normal, FSPath(fixed_root_var));
}
/* TODO: load USE etc from env? */
@@ -266,11 +272,11 @@ PortageEnvironment::PortageEnvironment(const std::string & s) :
_add_installed_virtuals_repository();
if (_imp->vars->get("PORTDIR").empty())
throw PortageEnvironmentConfigurationError("PORTDIR empty or unset");
- _add_portdir_repository(FSEntry(_imp->vars->get("PORTDIR")));
+ _add_portdir_repository(FSPath(_imp->vars->get("PORTDIR")));
_add_vdb_repository();
- std::list<FSEntry> portdir_overlay;
+ std::list<FSPath> portdir_overlay;
tokenise_whitespace(_imp->vars->get("PORTDIR_OVERLAY"),
- create_inserter<FSEntry>(std::back_inserter(portdir_overlay)));
+ create_inserter<FSPath>(std::back_inserter(portdir_overlay)));
std::for_each(portdir_overlay.begin(), portdir_overlay.end(),
std::bind(std::mem_fn(&PortageEnvironment::_add_portdir_overlay_repository), this, _1));
@@ -319,7 +325,7 @@ PortageEnvironment::PortageEnvironment(const std::string & s) :
m != m_end ; ++m)
_imp->mirrors.insert(std::make_pair("*", *m + "/distfiles/"));
- if ((_imp->conf_dir / "portage" / "mirrors").exists())
+ if ((_imp->conf_dir / "portage" / "mirrors").stat().exists())
{
LineConfigFile m(_imp->conf_dir / "portage" / "mirrors", { lcfo_disallow_continuations });
for (LineConfigFile::ConstIterator line(m.begin()), line_end(m.end()) ;
@@ -356,18 +362,18 @@ PortageEnvironment::PortageEnvironment(const std::string & s) :
template<typename I_>
void
-PortageEnvironment::_load_atom_file(const FSEntry & f, I_ i, const std::string & def_value, const bool reject_additional)
+PortageEnvironment::_load_atom_file(const FSPath & f, I_ i, const std::string & def_value, const bool reject_additional)
{
using namespace std::placeholders;
Context context("When loading '" + stringify(f) + "':");
- if (! f.exists())
+ if (! f.stat().exists())
return;
- if (f.is_directory())
+ if (f.stat().is_directory())
{
- std::for_each(DirIterator(f), DirIterator(), std::bind(
+ std::for_each(FSIterator(f, { }), FSIterator(), std::bind(
&PortageEnvironment::_load_atom_file<I_>, this, _1, i, def_value, reject_additional));
}
else
@@ -409,18 +415,18 @@ PortageEnvironment::_load_atom_file(const FSEntry & f, I_ i, const std::string &
template<typename I_>
void
-PortageEnvironment::_load_lined_file(const FSEntry & f, I_ i)
+PortageEnvironment::_load_lined_file(const FSPath & f, I_ i)
{
using namespace std::placeholders;
Context context("When loading '" + stringify(f) + "':");
- if (! f.exists())
+ if (! f.stat().exists())
return;
- if (f.is_directory())
+ if (f.stat().is_directory())
{
- std::for_each(DirIterator(f), DirIterator(), std::bind(
+ std::for_each(FSIterator(f, { }), FSIterator(), std::bind(
&PortageEnvironment::_load_lined_file<I_>, this, _1, i));
}
else
@@ -435,11 +441,11 @@ PortageEnvironment::_load_lined_file(const FSEntry & f, I_ i)
}
void
-PortageEnvironment::_load_profile(const FSEntry & d)
+PortageEnvironment::_load_profile(const FSPath & d)
{
Context context("When loading profile directory '" + stringify(d) + "':");
- if ((d / "parent").exists())
+ if ((d / "parent").stat().exists())
{
Context context_local("When loading parent profiles:");
@@ -449,7 +455,7 @@ PortageEnvironment::_load_profile(const FSEntry & d)
_load_profile((d / *line).realpath());
}
- if ((d / "make.defaults").exists())
+ if ((d / "make.defaults").stat().exists())
_imp->vars = std::make_shared<KeyValueConfigFile>(d / "make.defaults", KeyValueConfigFileOptions()
+ kvcfo_disallow_source + kvcfo_disallow_space_inside_unquoted_values + kvcfo_allow_inline_comments + kvcfo_allow_multiple_assigns_per_line,
std::bind(&predefined, _imp->vars, std::placeholders::_1, std::placeholders::_2),
@@ -481,21 +487,21 @@ PortageEnvironment::_add_installed_virtuals_repository()
}
void
-PortageEnvironment::_add_portdir_repository(const FSEntry & portdir)
+PortageEnvironment::_add_portdir_repository(const FSPath & portdir)
{
Context context("When creating PORTDIR repository:");
_add_ebuild_repository(portdir, "", _imp->vars->get("SYNC"), 1);
}
void
-PortageEnvironment::_add_ebuild_repository(const FSEntry & portdir, const std::string & master,
+PortageEnvironment::_add_ebuild_repository(const FSPath & portdir, const std::string & master,
const std::string & sync, int importance)
{
std::shared_ptr<Map<std::string, std::string> > keys(std::make_shared<Map<std::string, std::string>>());
keys->insert("root", stringify(preferred_root_key()->value()));
keys->insert("location", stringify(portdir));
keys->insert("profiles", stringify((_imp->conf_dir / "make.profile").realpath()) + " " +
- ((_imp->conf_dir / "portage" / "profile").is_directory() ?
+ ((_imp->conf_dir / "portage" / "profile").stat().is_directory() ?
stringify(_imp->conf_dir / "portage" / "profile") : ""));
keys->insert("format", "e");
keys->insert("names_cache", "/var/empty");
@@ -512,7 +518,7 @@ PortageEnvironment::_add_ebuild_repository(const FSEntry & portdir, const std::s
}
void
-PortageEnvironment::_add_portdir_overlay_repository(const FSEntry & portdir)
+PortageEnvironment::_add_portdir_overlay_repository(const FSPath & portdir)
{
Context context("When creating PORTDIR_OVERLAY repository '" + stringify(portdir) + "':");
_add_ebuild_repository(portdir, "gentoo", "", ++_imp->overlay_importance);
@@ -722,24 +728,24 @@ PortageEnvironment::perform_hook(
return _imp->hooker->perform_hook(hook, optional_output_manager);
}
-std::shared_ptr<const FSEntrySequence>
+std::shared_ptr<const FSPathSequence>
PortageEnvironment::hook_dirs() const
{
Lock l(_imp->hook_mutex);
_imp->need_hook_dirs();
- std::shared_ptr<FSEntrySequence> result(std::make_shared<FSEntrySequence>());
+ std::shared_ptr<FSPathSequence> result(std::make_shared<FSPathSequence>());
std::copy(_imp->hook_dirs.begin(), _imp->hook_dirs.end(), result->back_inserter());
return result;
}
-std::shared_ptr<const FSEntrySequence>
+std::shared_ptr<const FSPathSequence>
PortageEnvironment::bashrc_files() const
{
- std::shared_ptr<FSEntrySequence> result(std::make_shared<FSEntrySequence>());
+ std::shared_ptr<FSPathSequence> result(std::make_shared<FSPathSequence>());
if (! getenv_with_default("PALUDIS_PORTAGE_BASHRC", "").empty())
- result->push_back(FSEntry(getenv_with_default("PALUDIS_PORTAGE_BASHRC", "")).realpath());
+ result->push_back(FSPath(getenv_with_default("PALUDIS_PORTAGE_BASHRC", "")).realpath());
else
- result->push_back(FSEntry(LIBEXECDIR) / "paludis" / "environments" / "portage" / "bashrc");
+ result->push_back(FSPath(LIBEXECDIR) / "paludis" / "environments" / "portage" / "bashrc");
result->push_back(_imp->conf_dir / "make.globals");
result->push_back(_imp->conf_dir / "make.conf");
return result;
@@ -904,7 +910,7 @@ PortageEnvironment::_add_string_to_world(const std::string & s) const
using namespace std::placeholders;
- if (! _imp->world_file.exists())
+ if (! _imp->world_file.stat().exists())
{
try
{
@@ -942,7 +948,7 @@ PortageEnvironment::_remove_string_from_world(const std::string & s) const
using namespace std::placeholders;
- if (_imp->world_file.exists())
+ if (_imp->world_file.stat().exists())
{
SetFile world(make_named_values<SetFileParams>(
n::environment() = this,
@@ -979,13 +985,13 @@ PortageEnvironment::format_key() const
return _imp->format_key;
}
-const std::shared_ptr<const MetadataValueKey<FSEntry> >
+const std::shared_ptr<const MetadataValueKey<FSPath> >
PortageEnvironment::config_location_key() const
{
return _imp->config_location_key;
}
-const std::shared_ptr<const MetadataValueKey<FSEntry> >
+const std::shared_ptr<const MetadataValueKey<FSPath> >
PortageEnvironment::preferred_root_key() const
{
return _imp->preferred_root_key;
@@ -1001,11 +1007,11 @@ namespace
{
std::shared_ptr<const SetSpecTree> make_world_set(
const Environment * const env,
- const FSEntry & f)
+ const FSPath & f)
{
Context context("When loading world from '" + stringify(f) + "':");
- if (! f.exists())
+ if (! f.stat().exists())
{
Log::get_instance()->message("portage_environment.world.does_not_exist", ll_warning, lc_no_context)
<< "World file '" << f << "' doesn't exist";
@@ -1034,7 +1040,7 @@ PortageEnvironment::populate_sets() const
}
const std::shared_ptr<Repository>
-PortageEnvironment::repository_from_new_config_file(const FSEntry &)
+PortageEnvironment::repository_from_new_config_file(const FSPath &)
{
throw InternalError(PALUDIS_HERE, "can't create repositories on the fly for PortageEnvironment");
}
diff --git a/paludis/environments/portage/portage_environment.hh b/paludis/environments/portage/portage_environment.hh
index 09c6fc19a..43940e666 100644
--- a/paludis/environments/portage/portage_environment.hh
+++ b/paludis/environments/portage/portage_environment.hh
@@ -61,20 +61,20 @@ namespace paludis
private:
Pimp<PortageEnvironment>::ImpPtr & _imp;
- void _load_profile(const FSEntry &);
+ void _load_profile(const FSPath &);
void _add_virtuals_repository();
void _add_installed_virtuals_repository();
- void _add_portdir_repository(const FSEntry &);
- void _add_portdir_overlay_repository(const FSEntry &);
- void _add_ebuild_repository(const FSEntry &, const std::string &,
+ void _add_portdir_repository(const FSPath &);
+ void _add_portdir_overlay_repository(const FSPath &);
+ void _add_ebuild_repository(const FSPath &, const std::string &,
const std::string &, int importance);
void _add_vdb_repository();
template<typename I_>
- void _load_lined_file(const FSEntry &, I_);
+ void _load_lined_file(const FSPath &, I_);
template<typename I_>
- void _load_atom_file(const FSEntry &, I_, const std::string &, const bool);
+ void _load_atom_file(const FSPath &, I_, const std::string &, const bool);
bool _add_string_to_world(const std::string &) const;
bool _remove_string_from_world(const std::string &) const;
@@ -112,10 +112,10 @@ namespace paludis
) const
PALUDIS_ATTRIBUTE((warn_unused_result));
- 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> hook_dirs() const
+ virtual std::shared_ptr<const FSPathSequence> hook_dirs() const
PALUDIS_ATTRIBUTE((warn_unused_result));
virtual std::shared_ptr<const MirrorsSequence> mirrors(const std::string &) const
@@ -165,14 +165,14 @@ 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 std::shared_ptr<OutputManager> create_output_manager(
const CreateOutputManagerInfo &) const;
virtual const std::shared_ptr<Repository> repository_from_new_config_file(
- const FSEntry &) PALUDIS_ATTRIBUTE((noreturn));
+ const FSPath &) PALUDIS_ATTRIBUTE((noreturn));
virtual void update_config_files_for_package_move(
const PackageDepSpec &, const QualifiedPackageName &) const;
diff --git a/paludis/environments/portage/portage_environment_TEST.cc b/paludis/environments/portage/portage_environment_TEST.cc
index b8e80670d..28e1fd8fe 100644
--- a/paludis/environments/portage/portage_environment_TEST.cc
+++ b/paludis/environments/portage/portage_environment_TEST.cc
@@ -81,7 +81,7 @@ namespace test_cases
void run()
{
- PortageEnvironment env(stringify(FSEntry("portage_environment_TEST_dir/query_use").realpath()));
+ PortageEnvironment env(stringify(FSPath("portage_environment_TEST_dir/query_use").realpath()));
const std::shared_ptr<const PackageID> idx(*env[selection::RequireExactlyOne(
generator::Matches(PackageDepSpec(parse_user_package_dep_spec("=cat-one/pkg-x-1",
@@ -116,7 +116,7 @@ namespace test_cases
void run()
{
- PortageEnvironment env(stringify(FSEntry("portage_environment_TEST_dir/known_use_expand_names").realpath()));
+ PortageEnvironment env(stringify(FSPath("portage_environment_TEST_dir/known_use_expand_names").realpath()));
const std::shared_ptr<const PackageID> id1(*env[selection::RequireExactlyOne(generator::Matches(
PackageDepSpec(parse_user_package_dep_spec("=cat-one/pkg-one-1",
@@ -195,7 +195,7 @@ namespace test_cases
void run()
{
TestPortageEnvironment env("portage_environment_TEST_dir/world");
- FSEntry w(FSEntry::cwd() / "portage_environment_TEST_dir" / "world" / "var" / "lib" / "portage" / "world");
+ FSPath w(FSPath::cwd() / "portage_environment_TEST_dir" / "world" / "var" / "lib" / "portage" / "world");
env.update_config_files_for_package_move(make_package_dep_spec({ })
.package(QualifiedPackageName("cat/before")),
diff --git a/paludis/environments/test/test_environment.cc b/paludis/environments/test/test_environment.cc
index f9621711d..f263dff28 100644
--- a/paludis/environments/test/test_environment.cc
+++ b/paludis/environments/test/test_environment.cc
@@ -52,28 +52,28 @@ namespace paludis
std::shared_ptr<PackageDatabase> package_database;
std::string paludis_command;
std::unordered_map<std::string, Tribool> override_want_choice_enabled;
- FSEntry root;
+ FSPath root;
Sets sets;
- std::shared_ptr<LiteralMetadataValueKey<FSEntry> > preferred_root_key;
+ std::shared_ptr<LiteralMetadataValueKey<FSPath> > preferred_root_key;
- Imp(Environment * const e, const FSEntry & r) :
+ Imp(Environment * const e, const FSPath & r) :
package_database(std::make_shared<PackageDatabase>(e)),
paludis_command(""),
root(r),
- preferred_root_key(std::make_shared<LiteralMetadataValueKey<FSEntry>>("root", "Root", mkt_normal, root))
+ preferred_root_key(std::make_shared<LiteralMetadataValueKey<FSPath>>("root", "Root", mkt_normal, root))
{
}
};
}
TestEnvironment::TestEnvironment() :
- Pimp<TestEnvironment>(this, FSEntry("/")),
+ Pimp<TestEnvironment>(this, FSPath("/")),
_imp(Pimp<TestEnvironment>::_imp)
{
add_metadata_key(_imp->preferred_root_key);
}
-TestEnvironment::TestEnvironment(const FSEntry & r) :
+TestEnvironment::TestEnvironment(const FSPath & r) :
Pimp<TestEnvironment>(this, r),
_imp(Pimp<TestEnvironment>::_imp)
{
@@ -168,10 +168,10 @@ TestEnvironment::perform_hook(
return make_named_values<HookResult>(n::max_exit_status() = 0, n::output() = "");
}
-std::shared_ptr<const FSEntrySequence>
+std::shared_ptr<const FSPathSequence>
TestEnvironment::hook_dirs() const
{
- return std::make_shared<FSEntrySequence>();
+ return std::make_shared<FSPathSequence>();
}
const std::shared_ptr<const Mask>
@@ -227,13 +227,13 @@ TestEnvironment::format_key() const
return std::shared_ptr<const MetadataValueKey<std::string> >();
}
-const std::shared_ptr<const MetadataValueKey<FSEntry> >
+const std::shared_ptr<const MetadataValueKey<FSPath> >
TestEnvironment::config_location_key() const
{
- return std::shared_ptr<const MetadataValueKey<FSEntry> >();
+ return std::shared_ptr<const MetadataValueKey<FSPath> >();
}
-const std::shared_ptr<const MetadataValueKey<FSEntry> >
+const std::shared_ptr<const MetadataValueKey<FSPath> >
TestEnvironment::preferred_root_key() const
{
return _imp->preferred_root_key;
@@ -305,7 +305,7 @@ TestEnvironment::populate_sets() const
}
const std::shared_ptr<Repository>
-TestEnvironment::repository_from_new_config_file(const FSEntry &)
+TestEnvironment::repository_from_new_config_file(const FSPath &)
{
throw InternalError(PALUDIS_HERE, "can't create repositories on the fly for TestEnvironment");
}
diff --git a/paludis/environments/test/test_environment.hh b/paludis/environments/test/test_environment.hh
index 6db83f08b..a31f035a9 100644
--- a/paludis/environments/test/test_environment.hh
+++ b/paludis/environments/test/test_environment.hh
@@ -55,7 +55,7 @@ namespace paludis
///\{
TestEnvironment();
- TestEnvironment(const FSEntry &);
+ TestEnvironment(const FSPath &);
~TestEnvironment();
@@ -93,7 +93,7 @@ namespace paludis
virtual bool unmasked_by_user(const PackageID &) 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;
@@ -117,8 +117,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> &,
@@ -146,7 +146,7 @@ namespace paludis
void set_want_choice_enabled(const ChoicePrefixName &, const UnprefixedChoiceName &, const Tribool);
virtual const std::shared_ptr<Repository> repository_from_new_config_file(
- const FSEntry &) PALUDIS_ATTRIBUTE((noreturn));
+ const FSPath &) PALUDIS_ATTRIBUTE((noreturn));
virtual void update_config_files_for_package_move(
const PackageDepSpec &, const QualifiedPackageName &) const;