aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/clients/accerso/accerso.cc9
-rw-r--r--src/clients/adjutrix/adjutrix.cc28
-rw-r--r--src/clients/adjutrix/display_default_system_resolution.cc1
-rw-r--r--src/clients/adjutrix/downgrade_check.cc15
-rw-r--r--src/clients/appareo/appareo.cc30
-rw-r--r--src/clients/cave/cmd_contents.cc1
-rw-r--r--src/clients/cave/cmd_display_resolution.cc8
-rw-r--r--src/clients/cave/cmd_executables.cc3
-rw-r--r--src/clients/cave/cmd_execute_resolution.cc2
-rw-r--r--src/clients/cave/cmd_fix_linkage.cc5
-rw-r--r--src/clients/cave/cmd_import.cc8
-rw-r--r--src/clients/cave/cmd_info.cc4
-rw-r--r--src/clients/cave/cmd_manage_search_index.cc2
-rw-r--r--src/clients/cave/cmd_match.cc6
-rw-r--r--src/clients/cave/cmd_perform.cc6
-rw-r--r--src/clients/cave/cmd_print_id_contents.cc1
-rw-r--r--src/clients/cave/cmd_print_id_executables.cc3
-rw-r--r--src/clients/cave/cmd_print_sync_protocols.cc16
-rw-r--r--src/clients/cave/cmd_resolve_display_callback.cc3
-rw-r--r--src/clients/cave/cmd_resume.cc5
-rw-r--r--src/clients/cave/cmd_show.cc4
-rw-r--r--src/clients/cave/cmd_update_world.cc1
-rw-r--r--src/clients/cave/cmd_verify.cc34
-rw-r--r--src/clients/cave/colour_formatter.cc2
-rw-r--r--src/clients/cave/colour_formatter.hh6
-rw-r--r--src/clients/cave/command_factory.cc18
-rw-r--r--src/clients/cave/executables_common.cc25
-rw-r--r--src/clients/cave/executables_common.hh4
-rw-r--r--src/clients/cave/format_plain_contents_entry.cc8
-rw-r--r--src/clients/cave/format_plain_metadata_key.cc4
-rw-r--r--src/clients/cave/format_user_config.cc7
-rw-r--r--src/clients/cave/resolve_common.cc2
-rw-r--r--src/clients/cave/script_command.cc8
-rw-r--r--src/clients/cave/script_command.hh4
-rw-r--r--src/clients/cave/select_format_for_spec.cc3
-rw-r--r--src/clients/importare/importare.cc8
-rw-r--r--src/clients/inquisitio/key_extractor.cc7
-rw-r--r--src/clients/instruo/instruo.cc19
-rw-r--r--src/clients/paludis/applets.cc19
-rw-r--r--src/clients/paludis/do_executables.cc16
-rw-r--r--src/clients/paludis/info.cc4
-rw-r--r--src/clients/reconcilio/fix_linkage.cc1
-rw-r--r--src/output/colour_formatter.cc4
-rw-r--r--src/output/colour_formatter.hh8
-rw-r--r--src/output/console_install_task.cc8
-rw-r--r--src/output/console_install_task.hh2
-rw-r--r--src/output/console_query_task.cc4
-rw-r--r--src/output/mask_displayer.cc4
48 files changed, 195 insertions, 195 deletions
diff --git a/src/clients/accerso/accerso.cc b/src/clients/accerso/accerso.cc
index 32587a9b4..072aa6889 100644
--- a/src/clients/accerso/accerso.cc
+++ b/src/clients/accerso/accerso.cc
@@ -26,7 +26,6 @@
#include <paludis/util/system.hh>
#include <paludis/util/join.hh>
#include <paludis/util/log.hh>
-#include <paludis/util/fs_entry.hh>
#include <paludis/util/sequence.hh>
#include <paludis/util/map.hh>
#include <paludis/util/make_named_values.hh>
@@ -89,7 +88,7 @@ main(int argc, char *argv[])
CommandLine::get_instance()->a_write_cache_dir.set_argument("/var/empty");
if (! CommandLine::get_instance()->a_repository_directory.specified())
- CommandLine::get_instance()->a_repository_directory.set_argument(stringify(FSEntry::cwd()));
+ CommandLine::get_instance()->a_repository_directory.set_argument(stringify(FSPath::cwd()));
if (CommandLine::get_instance()->a_version.specified())
{
@@ -106,11 +105,11 @@ main(int argc, char *argv[])
}
else
{
- std::shared_ptr<FSEntrySequence> extra_repository_dirs(std::make_shared<FSEntrySequence>());
+ std::shared_ptr<FSPathSequence> extra_repository_dirs(std::make_shared<FSPathSequence>());
for (args::StringSequenceArg::ConstIterator d(CommandLine::get_instance()->a_extra_repository_dir.begin_args()),
d_end(CommandLine::get_instance()->a_extra_repository_dir.end_args()) ;
d != d_end ; ++d)
- extra_repository_dirs->push_back(*d);
+ extra_repository_dirs->push_back(FSPath(*d));
std::shared_ptr<Map<std::string, std::string> > keys(std::make_shared<Map<std::string, std::string>>());
keys->insert("distdir", CommandLine::get_instance()->a_download_directory.argument());
@@ -210,7 +209,7 @@ main(int argc, char *argv[])
std::shared_ptr<SafeOFStream> outf;
if (CommandLine::get_instance()->a_report_file.specified())
- outf = std::make_shared<SafeOFStream>(FSEntry(CommandLine::get_instance()->a_report_file.argument()));
+ outf = std::make_shared<SafeOFStream>(FSPath(CommandLine::get_instance()->a_report_file.argument()));
std::ostream & out(outf ? *outf : cout);
diff --git a/src/clients/adjutrix/adjutrix.cc b/src/clients/adjutrix/adjutrix.cc
index 05c1b5d5d..1fb7eff7a 100644
--- a/src/clients/adjutrix/adjutrix.cc
+++ b/src/clients/adjutrix/adjutrix.cc
@@ -32,7 +32,7 @@
#include <paludis/about.hh>
#include <paludis/util/join.hh>
#include <paludis/util/log.hh>
-#include <paludis/util/fs_entry.hh>
+#include <paludis/util/fs_stat.hh>
#include <paludis/util/sequence.hh>
#include <paludis/util/make_named_values.hh>
#include <paludis/environments/no_config/no_config_environment.hh>
@@ -47,29 +47,29 @@ using std::endl;
namespace
{
- FSEntry
+ FSPath
get_location_and_add_filters()
{
Context context("When determining tree location:");
if (CommandLine::get_instance()->a_repository_directory.specified())
- return FSEntry(CommandLine::get_instance()->a_repository_directory.argument());
+ return FSPath(CommandLine::get_instance()->a_repository_directory.argument());
- if ((FSEntry::cwd() / "profiles").is_directory())
- return FSEntry::cwd();
- if ((FSEntry::cwd().dirname() / "profiles").is_directory())
+ if ((FSPath::cwd() / "profiles").stat().is_directory())
+ return FSPath::cwd();
+ if ((FSPath::cwd().dirname() / "profiles").stat().is_directory())
{
- CommandLine::get_instance()->a_category.add_argument(FSEntry::cwd().basename());
+ CommandLine::get_instance()->a_category.add_argument(FSPath::cwd().basename());
CommandLine::get_instance()->a_category.set_specified(true);
- return FSEntry::cwd().dirname();
+ return FSPath::cwd().dirname();
}
- if ((FSEntry::cwd().dirname().dirname() / "profiles").is_directory())
+ if ((FSPath::cwd().dirname().dirname() / "profiles").stat().is_directory())
{
- CommandLine::get_instance()->a_package.add_argument(FSEntry::cwd().basename());
+ CommandLine::get_instance()->a_package.add_argument(FSPath::cwd().basename());
CommandLine::get_instance()->a_package.set_specified(true);
- CommandLine::get_instance()->a_category.add_argument(FSEntry::cwd().dirname().basename());
+ CommandLine::get_instance()->a_category.add_argument(FSPath::cwd().dirname().basename());
CommandLine::get_instance()->a_category.set_specified(true);
- return FSEntry::cwd().dirname().dirname();
+ return FSPath::cwd().dirname().dirname();
}
throw ConfigurationError("Cannot find tree location (try specifying --repository-dir)");
@@ -130,11 +130,11 @@ main(int argc, char *argv[])
if (! CommandLine::get_instance()->a_write_cache_dir.specified())
CommandLine::get_instance()->a_write_cache_dir.set_argument("/var/empty");
- std::shared_ptr<FSEntrySequence> extra_repository_dirs(std::make_shared<FSEntrySequence>());
+ std::shared_ptr<FSPathSequence> extra_repository_dirs(std::make_shared<FSPathSequence>());
for (args::StringSequenceArg::ConstIterator d(CommandLine::get_instance()->a_extra_repository_dir.begin_args()),
d_end(CommandLine::get_instance()->a_extra_repository_dir.end_args()) ;
d != d_end ; ++d)
- extra_repository_dirs->push_back(*d);
+ extra_repository_dirs->push_back(FSPath(*d));
NoConfigEnvironment env(make_named_values<no_config_environment::Params>(
n::accept_unstable() = CommandLine::get_instance()->a_unstable.specified(),
diff --git a/src/clients/adjutrix/display_default_system_resolution.cc b/src/clients/adjutrix/display_default_system_resolution.cc
index f14cc95a2..1086f3a02 100644
--- a/src/clients/adjutrix/display_default_system_resolution.cc
+++ b/src/clients/adjutrix/display_default_system_resolution.cc
@@ -24,7 +24,6 @@
#include <paludis/repositories/fake/fake_installed_repository.hh>
#include <paludis/util/log.hh>
#include <paludis/util/tokeniser.hh>
-#include <paludis/util/dir_iterator.hh>
#include <paludis/util/is_file_with_extension.hh>
#include <paludis/util/set.hh>
#include <paludis/util/strip.hh>
diff --git a/src/clients/adjutrix/downgrade_check.cc b/src/clients/adjutrix/downgrade_check.cc
index e2822be90..9ab34cde9 100644
--- a/src/clients/adjutrix/downgrade_check.cc
+++ b/src/clients/adjutrix/downgrade_check.cc
@@ -28,6 +28,7 @@
#include <paludis/util/make_named_values.hh>
#include <paludis/util/safe_ofstream.hh>
#include <paludis/util/safe_ifstream.hh>
+#include <paludis/util/fs_stat.hh>
#include <paludis/package_id.hh>
#include <paludis/user_dep_spec.hh>
#include <paludis/generator.hh>
@@ -141,8 +142,8 @@ do_build_downgrade_check_list(NoConfigEnvironment & env)
{
int exit_status(0);
- FSEntry output_dir(*CommandLine::get_instance()->begin_parameters());
- if (! output_dir.mkdir())
+ FSPath output_dir(*CommandLine::get_instance()->begin_parameters());
+ if (! output_dir.mkdir(0755, { fspmkdo_ok_if_exists }))
throw ConfigurationError("Output directory already exists");
for (int i = 0 ; i < 2 ; ++i)
@@ -162,12 +163,12 @@ do_downgrade_check(NoConfigEnvironment & env)
{
int exit_status(0);
- FSEntry before_dir(*CommandLine::get_instance()->begin_parameters());
- if (! before_dir.is_directory())
+ FSPath before_dir(*CommandLine::get_instance()->begin_parameters());
+ if (! before_dir.stat().is_directory())
throw ConfigurationError("First input directory is not a directory");
- FSEntry after_dir(*next(CommandLine::get_instance()->begin_parameters()));
- if (! after_dir.is_directory())
+ FSPath after_dir(*next(CommandLine::get_instance()->begin_parameters()));
+ if (! after_dir.stat().is_directory())
throw ConfigurationError("Second input directory is not a directory");
std::multimap<std::pair<QualifiedPackageName, std::string>, std::string> results;
@@ -179,7 +180,7 @@ do_downgrade_check(NoConfigEnvironment & env)
std::string f(b ? "unstable" : "stable");
f.append(".txt");
- if ((before_dir / f).exists() && (after_dir / f).exists())
+ if ((before_dir / f).stat().exists() && (after_dir / f).stat().exists())
{
std::cerr << "Checking " << (b ? "unstable" : "stable") << "..." << std::endl;
diff --git a/src/clients/appareo/appareo.cc b/src/clients/appareo/appareo.cc
index 60582ef2c..77255468c 100644
--- a/src/clients/appareo/appareo.cc
+++ b/src/clients/appareo/appareo.cc
@@ -27,7 +27,7 @@
#include <paludis/util/system.hh>
#include <paludis/util/join.hh>
#include <paludis/util/log.hh>
-#include <paludis/util/fs_entry.hh>
+#include <paludis/util/fs_stat.hh>
#include <paludis/util/sequence.hh>
#include <paludis/util/map.hh>
#include <paludis/util/make_named_values.hh>
@@ -60,30 +60,30 @@ namespace
return std::make_shared<StandardOutputManager>();
}
- FSEntry get_location_and_add_filters()
+ FSPath get_location_and_add_filters()
{
Context context("When determining tree location:");
if (CommandLine::get_instance()->a_repository_directory.specified())
- return FSEntry(CommandLine::get_instance()->a_repository_directory.argument());
+ return FSPath(CommandLine::get_instance()->a_repository_directory.argument());
- if ((FSEntry::cwd() / "profiles").is_directory())
- return FSEntry::cwd();
+ if ((FSPath::cwd() / "profiles").stat().is_directory())
+ return FSPath::cwd();
- if ((FSEntry::cwd().dirname() / "profiles").is_directory())
+ if ((FSPath::cwd().dirname() / "profiles").stat().is_directory())
{
- CommandLine::get_instance()->a_category.add_argument(FSEntry::cwd().basename());
+ CommandLine::get_instance()->a_category.add_argument(FSPath::cwd().basename());
CommandLine::get_instance()->a_category.set_specified(true);
- return FSEntry::cwd().dirname();
+ return FSPath::cwd().dirname();
}
- if ((FSEntry::cwd().dirname().dirname() / "profiles").is_directory())
+ if ((FSPath::cwd().dirname().dirname() / "profiles").stat().is_directory())
{
- CommandLine::get_instance()->a_package.add_argument(FSEntry::cwd().basename());
+ CommandLine::get_instance()->a_package.add_argument(FSPath::cwd().basename());
CommandLine::get_instance()->a_package.set_specified(true);
- CommandLine::get_instance()->a_category.add_argument(FSEntry::cwd().dirname().basename());
+ CommandLine::get_instance()->a_category.add_argument(FSPath::cwd().dirname().basename());
CommandLine::get_instance()->a_category.set_specified(true);
- return FSEntry::cwd().dirname().dirname();
+ return FSPath::cwd().dirname().dirname();
}
throw ConfigurationError("Cannot find tree location (try specifying --repository-dir)");
@@ -207,7 +207,7 @@ main(int argc, char *argv[])
CommandLine::get_instance()->a_write_cache_dir.set_argument("/var/empty");
if (! CommandLine::get_instance()->a_repository_directory.specified())
- CommandLine::get_instance()->a_repository_directory.set_argument(stringify(FSEntry::cwd()));
+ CommandLine::get_instance()->a_repository_directory.set_argument(stringify(FSPath::cwd()));
if (CommandLine::get_instance()->a_version.specified())
{
@@ -224,11 +224,11 @@ main(int argc, char *argv[])
}
else
{
- std::shared_ptr<FSEntrySequence> extra_repository_dirs(std::make_shared<FSEntrySequence>());
+ std::shared_ptr<FSPathSequence> extra_repository_dirs(std::make_shared<FSPathSequence>());
for (args::StringSequenceArg::ConstIterator d(CommandLine::get_instance()->a_extra_repository_dir.begin_args()),
d_end(CommandLine::get_instance()->a_extra_repository_dir.end_args()) ;
d != d_end ; ++d)
- extra_repository_dirs->push_back(*d);
+ extra_repository_dirs->push_back(FSPath(*d));
std::shared_ptr<Map<std::string, std::string> > keys(std::make_shared<Map<std::string, std::string>>());
keys->insert("distdir", CommandLine::get_instance()->a_download_directory.argument());
diff --git a/src/clients/cave/cmd_contents.cc b/src/clients/cave/cmd_contents.cc
index 6f772a845..3758143d7 100644
--- a/src/clients/cave/cmd_contents.cc
+++ b/src/clients/cave/cmd_contents.cc
@@ -27,7 +27,6 @@
#include <paludis/contents.hh>
#include <paludis/user_dep_spec.hh>
#include <paludis/util/wrapped_forward_iterator.hh>
-#include <paludis/util/fs_entry.hh>
#include <paludis/util/iterator_funcs.hh>
#include <paludis/util/options.hh>
#include <paludis/util/sequence.hh>
diff --git a/src/clients/cave/cmd_display_resolution.cc b/src/clients/cave/cmd_display_resolution.cc
index b7b815015..c5906c8f2 100644
--- a/src/clients/cave/cmd_display_resolution.cc
+++ b/src/clients/cave/cmd_display_resolution.cc
@@ -851,7 +851,7 @@ namespace
cout << fuc(fs_mask_by_repo_line(), fv<'i'>(indent), fv<'s'>(*l));
}
- void visit(const MetadataValueKey<FSEntry> & k)
+ void visit(const MetadataValueKey<FSPath> & k)
{
cout << fuc(fs_mask_by(), fv<'i'>(indent), fv<'k'>(k.human_name()), fv<'v'>(stringify(k.value())));
}
@@ -868,7 +868,7 @@ namespace
cout << fuc(fs_mask_by(), fv<'i'>(indent), fv<'k'>(k.human_name()), fv<'v'>(stringify(k.pretty_print_flat(formatter))));
}
- void visit(const MetadataCollectionKey<FSEntrySequence> & k)
+ void visit(const MetadataCollectionKey<FSPathSequence> & k)
{
ColourFormatter formatter(0);
cout << fuc(fs_mask_by(), fv<'i'>(indent), fv<'k'>(k.human_name()), fv<'v'>(stringify(k.pretty_print_flat(formatter))));
@@ -981,7 +981,7 @@ namespace
struct Totals
{
- std::set<FSEntry> download_files;
+ std::set<FSPath, FSPathComparator> download_files;
bool download_overflow;
unsigned long download_size;
@@ -1012,7 +1012,7 @@ namespace
{
}
- void will_fetch(const FSEntry & destination, const unsigned long size_in_bytes)
+ void will_fetch(const FSPath & destination, const unsigned long size_in_bytes)
{
if (totals->download_files.end() != totals->download_files.find(destination))
return;
diff --git a/src/clients/cave/cmd_executables.cc b/src/clients/cave/cmd_executables.cc
index 3b32af159..b7e5c3ab2 100644
--- a/src/clients/cave/cmd_executables.cc
+++ b/src/clients/cave/cmd_executables.cc
@@ -26,7 +26,6 @@
#include <paludis/args/args.hh>
#include <paludis/args/do_help.hh>
-#include <paludis/util/fs_entry.hh>
#include <paludis/util/indirect_iterator-impl.hh>
#include <paludis/util/system.hh>
#include <paludis/util/tokeniser.hh>
@@ -70,7 +69,7 @@ namespace
}
};
- void format_fsentry(const FSEntry & f)
+ void format_fsentry(const FSPath & f)
{
cout << fuc(fs_file(), fv<'s'>(stringify(f)));
}
diff --git a/src/clients/cave/cmd_execute_resolution.cc b/src/clients/cave/cmd_execute_resolution.cc
index 5cfdf49c8..362a28777 100644
--- a/src/clients/cave/cmd_execute_resolution.cc
+++ b/src/clients/cave/cmd_execute_resolution.cc
@@ -161,7 +161,7 @@ namespace
if (! cmdline.execution_options.a_resume_file.specified())
return;
- FSEntry resume_file(cmdline.execution_options.a_resume_file.argument());
+ FSPath resume_file(cmdline.execution_options.a_resume_file.argument());
bool success(lists->execute_job_list()->end() == std::find_if(lists->execute_job_list()->begin(),
lists->execute_job_list()->end(), NotASuccess()));
if (success)
diff --git a/src/clients/cave/cmd_fix_linkage.cc b/src/clients/cave/cmd_fix_linkage.cc
index 218a40bfe..936928d62 100644
--- a/src/clients/cave/cmd_fix_linkage.cc
+++ b/src/clients/cave/cmd_fix_linkage.cc
@@ -27,6 +27,7 @@
#include <paludis/util/join.hh>
#include <paludis/util/make_named_values.hh>
#include <paludis/util/make_null_shared_ptr.hh>
+#include <paludis/util/create_iterator-impl.hh>
#include <paludis/broken_linkage_finder.hh>
#include <paludis/package_id.hh>
#include <paludis/name.hh>
@@ -196,7 +197,7 @@ FixLinkageCommand::run(
cout << "* " << **pkg_it << endl;
- std::set<FSEntry> broken_files;
+ std::set<FSPath, FSPathComparator> broken_files;
for (BrokenLinkageFinder::BrokenFileConstIterator file_it(finder->begin_broken_files(*pkg_it)),
file_it_end(finder->end_broken_files(*pkg_it)); file_it_end != file_it; ++file_it)
{
@@ -206,7 +207,7 @@ FixLinkageCommand::run(
finder->end_missing_requirements(*pkg_it, *file_it),
" ") << ")";
std::copy(finder->begin_missing_requirements(*pkg_it, *file_it), finder->end_missing_requirements(*pkg_it, *file_it),
- std::inserter(broken_files, broken_files.end()));
+ create_inserter<FSPath>(std::inserter(broken_files, broken_files.end())));
cout << endl;
}
diff --git a/src/clients/cave/cmd_import.cc b/src/clients/cave/cmd_import.cc
index f1c681ce4..24823c3a1 100644
--- a/src/clients/cave/cmd_import.cc
+++ b/src/clients/cave/cmd_import.cc
@@ -269,12 +269,12 @@ ImportCommand::run(
std::shared_ptr<Map<std::string, std::string> > keys(std::make_shared<Map<std::string, std::string>>());
keys->insert("location", stringify(
cmdline.a_location.specified() ?
- FSEntry(cmdline.a_location.argument()) :
- FSEntry::cwd()));
+ FSPath(cmdline.a_location.argument()) :
+ FSPath::cwd()));
keys->insert("install_under", stringify(
cmdline.a_install_under.specified() ?
- FSEntry(cmdline.a_install_under.argument()) :
- FSEntry("/")));
+ FSPath(cmdline.a_install_under.argument()) :
+ FSPath("/")));
keys->insert("rewrite_ids_over_to_root", stringify(
cmdline.a_rewrite_ids_over_to_root.specified() ?
cmdline.a_rewrite_ids_over_to_root.argument() : -1));
diff --git a/src/clients/cave/cmd_info.cc b/src/clients/cave/cmd_info.cc
index da449eb55..6d84f3961 100644
--- a/src/clients/cave/cmd_info.cc
+++ b/src/clients/cave/cmd_info.cc
@@ -179,7 +179,7 @@ namespace
cout << fuc(fs_metadata(), fv<'h'>(k.human_name()), fv<'i'>(std::string(indent, ' ')), fv<'s'>(k.pretty_print_flat(f)));
}
- void visit(const MetadataCollectionKey<FSEntrySequence> & k)
+ void visit(const MetadataCollectionKey<FSPathSequence> & k)
{
cout << fuc(fs_metadata(), fv<'h'>(k.human_name()), fv<'i'>(std::string(indent, ' ')), fv<'s'>(
join(k.value()->begin(), k.value()->end(), " ")));
@@ -245,7 +245,7 @@ namespace
cout << fuc(fs_metadata(), fv<'h'>(k.human_name()), fv<'i'>(std::string(indent, ' ')), fv<'s'>(stringify(k.value())));
}
- void visit(const MetadataValueKey<FSEntry> & k)
+ void visit(const MetadataValueKey<FSPath> & k)
{
ColourFormatter f(indent);
cout << fuc(fs_metadata(), fv<'h'>(k.human_name()), fv<'i'>(std::string(indent, ' ')), fv<'s'>(stringify(k.value())));
diff --git a/src/clients/cave/cmd_manage_search_index.cc b/src/clients/cave/cmd_manage_search_index.cc
index 8ea9ade01..c48544807 100644
--- a/src/clients/cave/cmd_manage_search_index.cc
+++ b/src/clients/cave/cmd_manage_search_index.cc
@@ -246,7 +246,7 @@ ManageSearchIndexCommand::run(
if (! cmdline.a_create.specified())
throw args::DoHelp("exactly one action must be specified");
- FSEntry index_file(*cmdline.begin_parameters());
+ FSPath index_file(*cmdline.begin_parameters());
index_file.unlink();
{
diff --git a/src/clients/cave/cmd_match.cc b/src/clients/cave/cmd_match.cc
index b7f9ca77b..836d13f03 100644
--- a/src/clients/cave/cmd_match.cc
+++ b/src/clients/cave/cmd_match.cc
@@ -228,7 +228,7 @@ namespace
texts.push_back(stringify(k.value()));
}
- void visit(const MetadataValueKey<FSEntry> & k)
+ void visit(const MetadataValueKey<FSPath> & k)
{
texts.push_back(stringify(k.value()));
}
@@ -317,9 +317,9 @@ namespace
k.value()->top()->accept(m);
}
- void visit(const MetadataCollectionKey<Sequence<FSEntry> > & k)
+ void visit(const MetadataCollectionKey<Sequence<FSPath> > & k)
{
- std::transform(k.value()->begin(), k.value()->end(), std::back_inserter(texts), &stringify<FSEntry>);
+ std::transform(k.value()->begin(), k.value()->end(), std::back_inserter(texts), &stringify<FSPath>);
}
void visit(const MetadataCollectionKey<Sequence<std::string> > & k)
diff --git a/src/clients/cave/cmd_perform.cc b/src/clients/cave/cmd_perform.cc
index 609ed0327..acfcd79cf 100644
--- a/src/clients/cave/cmd_perform.cc
+++ b/src/clients/cave/cmd_perform.cc
@@ -282,7 +282,7 @@ namespace
fv<'i'>(stringify(*id)), fv<'a'>(action_name), fv<'c'>("Completed ")) << std::flush;
}
- bool ignore_nothing(const FSEntry &)
+ bool ignore_nothing(const FSPath &)
{
return false;
}
@@ -359,7 +359,7 @@ namespace
struct OurPretendFetchAction :
PretendFetchAction
{
- std::set<FSEntry> already_downloaded;
+ std::set<FSPath, FSPathComparator> already_downloaded;
unsigned long size;
bool overflow;
@@ -370,7 +370,7 @@ namespace
{
}
- void will_fetch(const FSEntry & destination, const unsigned long size_in_bytes)
+ void will_fetch(const FSPath & destination, const unsigned long size_in_bytes)
{
if (already_downloaded.end() != already_downloaded.find(destination))
return;
diff --git a/src/clients/cave/cmd_print_id_contents.cc b/src/clients/cave/cmd_print_id_contents.cc
index aeeb789e8..416179245 100644
--- a/src/clients/cave/cmd_print_id_contents.cc
+++ b/src/clients/cave/cmd_print_id_contents.cc
@@ -26,7 +26,6 @@
#include <paludis/contents.hh>
#include <paludis/user_dep_spec.hh>
#include <paludis/util/wrapped_forward_iterator.hh>
-#include <paludis/util/fs_entry.hh>
#include <paludis/util/iterator_funcs.hh>
#include <paludis/util/options.hh>
#include <paludis/util/sequence.hh>
diff --git a/src/clients/cave/cmd_print_id_executables.cc b/src/clients/cave/cmd_print_id_executables.cc
index 80b8c8802..4a18af79a 100644
--- a/src/clients/cave/cmd_print_id_executables.cc
+++ b/src/clients/cave/cmd_print_id_executables.cc
@@ -23,7 +23,6 @@
#include <paludis/args/args.hh>
#include <paludis/args/do_help.hh>
-#include <paludis/util/fs_entry.hh>
#include <paludis/util/indirect_iterator-impl.hh>
#include <paludis/util/system.hh>
#include <paludis/util/tokeniser.hh>
@@ -73,7 +72,7 @@ namespace
}
};
- void print_fsentry(const FSEntry & e)
+ void print_fsentry(const FSPath & e)
{
cout << e << endl;
}
diff --git a/src/clients/cave/cmd_print_sync_protocols.cc b/src/clients/cave/cmd_print_sync_protocols.cc
index 9c2f4ed89..97a4a6cb8 100644
--- a/src/clients/cave/cmd_print_sync_protocols.cc
+++ b/src/clients/cave/cmd_print_sync_protocols.cc
@@ -24,8 +24,8 @@
#include <paludis/environment.hh>
#include <paludis/package_database.hh>
#include <paludis/repository.hh>
-#include <paludis/util/dir_iterator.hh>
-#include <paludis/util/fs_entry.hh>
+#include <paludis/util/fs_iterator.hh>
+#include <paludis/util/fs_stat.hh>
#include <cstdlib>
#include <iostream>
@@ -81,21 +81,21 @@ PrintSyncProtocolsCommand::run(
std::set<std::string> syncers;
- std::shared_ptr<const FSEntrySequence> fes(env->syncers_dirs());
+ std::shared_ptr<const FSPathSequence> fes(env->syncers_dirs());
- for (FSEntrySequence::ConstIterator s(fes->begin()), s_end(fes->end());
+ for (FSPathSequence::ConstIterator s(fes->begin()), s_end(fes->end());
s != s_end; ++s)
{
- FSEntry dir(*s);
+ FSPath dir(*s);
- if (! dir.is_directory())
+ if (! dir.stat().is_directory())
continue;
- for (DirIterator f(dir), f_end; f != f_end; ++f)
+ for (FSIterator f(dir, { }), f_end; f != f_end; ++f)
{
std::string name(f->basename());
- if (f->has_permission(fs_ug_owner, fs_perm_execute) && name.compare(0, 2, "do", 0, 2) == 0)
+ if ((0 != (f->stat().permissions() & S_IXUSR)) && name.compare(0, 2, "do", 0, 2) == 0)
{
name.erase(0, 2);
diff --git a/src/clients/cave/cmd_resolve_display_callback.cc b/src/clients/cave/cmd_resolve_display_callback.cc
index dc3e97b68..fbad2c06c 100644
--- a/src/clients/cave/cmd_resolve_display_callback.cc
+++ b/src/clients/cave/cmd_resolve_display_callback.cc
@@ -21,6 +21,7 @@
#include <paludis/notifier_callback.hh>
#include <paludis/util/stringify.hh>
#include <paludis/util/pimp-impl.hh>
+#include <paludis/util/fs_stat.hh>
#include <iostream>
#include <map>
#include <unistd.h>
@@ -123,7 +124,7 @@ DisplayCallback::visit(const NotifierCallbackLinkageStepEvent & e) const
return;
Lock lock(_imp->mutex);
- if (e.location().is_directory_or_symlink_to_directory())
+ if (e.location().stat().is_directory_or_symlink_to_directory())
++_imp->steps.insert(std::make_pair("directories", 0)).first->second;
else
++_imp->steps.insert(std::make_pair("files", 0)).first->second;
diff --git a/src/clients/cave/cmd_resume.cc b/src/clients/cave/cmd_resume.cc
index 6cc4b50fa..6eceb79cf 100644
--- a/src/clients/cave/cmd_resume.cc
+++ b/src/clients/cave/cmd_resume.cc
@@ -39,6 +39,7 @@
#include <paludis/util/wrapped_output_iterator.hh>
#include <paludis/util/string_list_stream.hh>
#include <paludis/util/process.hh>
+#include <paludis/util/fs_stat.hh>
#include <paludis/resolver/job_lists.hh>
#include <paludis/resolver/job.hh>
#include <paludis/resolver/job_list.hh>
@@ -273,8 +274,8 @@ ResumeCommand::run(
std::shared_ptr<ResumeData> data;
{
- FSEntry f(cmdline.execution_options.a_resume_file.argument());
- if (! f.exists())
+ FSPath f(cmdline.execution_options.a_resume_file.argument());
+ if (! f.stat().exists())
throw args::DoHelp("Resume file '" + stringify(f) + "' does not exist");
SafeIFStream deser_stream(f);
Deserialiser deserialiser(env.get(), deser_stream);
diff --git a/src/clients/cave/cmd_show.cc b/src/clients/cave/cmd_show.cc
index bc7ce541f..01dfec8ba 100644
--- a/src/clients/cave/cmd_show.cc
+++ b/src/clients/cave/cmd_show.cc
@@ -398,7 +398,7 @@ namespace
);
}
- void visit(const MetadataCollectionKey<FSEntrySequence> & k)
+ void visit(const MetadataCollectionKey<FSPathSequence> & k)
{
cout << fuc(
(cmdline.a_raw_names.specified() ? fs_metadata_value_raw() : fs_metadata_value_human()),
@@ -576,7 +576,7 @@ namespace
);
}
- void visit(const MetadataValueKey<FSEntry> & k)
+ void visit(const MetadataValueKey<FSPath> & k)
{
cout << fuc(
(cmdline.a_raw_names.specified() ? fs_metadata_value_raw() : fs_metadata_value_human()),
diff --git a/src/clients/cave/cmd_update_world.cc b/src/clients/cave/cmd_update_world.cc
index 4cf257a9f..a5e08a44f 100644
--- a/src/clients/cave/cmd_update_world.cc
+++ b/src/clients/cave/cmd_update_world.cc
@@ -22,7 +22,6 @@
#include <paludis/args/args.hh>
#include <paludis/args/do_help.hh>
#include <paludis/util/wrapped_forward_iterator.hh>
-#include <paludis/util/fs_entry.hh>
#include <paludis/util/iterator_funcs.hh>
#include <paludis/util/options.hh>
#include <paludis/util/sequence.hh>
diff --git a/src/clients/cave/cmd_verify.cc b/src/clients/cave/cmd_verify.cc
index 2910fb7a2..8139be2c8 100644
--- a/src/clients/cave/cmd_verify.cc
+++ b/src/clients/cave/cmd_verify.cc
@@ -31,6 +31,7 @@
#include <paludis/util/safe_ifstream.hh>
#include <paludis/util/simple_visitor_cast.hh>
#include <paludis/util/md5.hh>
+#include <paludis/util/fs_stat.hh>
#include <paludis/environment.hh>
#include <paludis/package_database.hh>
#include <paludis/repository.hh>
@@ -101,7 +102,7 @@ namespace
{
}
- void message(const FSEntry & path, const std::string & text)
+ void message(const FSPath & path, const std::string & text)
{
if (! done_heading)
{
@@ -113,7 +114,7 @@ namespace
cout << fuc(fs_error(), fv<'t'>(text), fv<'p'>(stringify(path)));
}
- bool check_mtime(const ContentsEntry & e, const FSEntry & f)
+ bool check_mtime(const ContentsEntry & e, const FSPath & p, const FSStat & f)
{
ContentsEntry::MetadataConstIterator k(e.find_metadata("mtime"));
if (e.end_metadata() != k)
@@ -121,7 +122,7 @@ namespace
const MetadataTimeKey * kk(simple_visitor_cast<const MetadataTimeKey>(**k));
if (kk && (kk->value().seconds() != f.mtim().seconds()))
{
- message(f, "Modification time changed");
+ message(p, "Modification time changed");
return false;
}
}
@@ -129,7 +130,7 @@ namespace
return true;
}
- bool check_md5(const ContentsEntry & e, const FSEntry & f)
+ bool check_md5(const ContentsEntry & e, const FSPath & f)
{
ContentsEntry::MetadataConstIterator k(e.find_metadata("md5"));
if (e.end_metadata() != k)
@@ -152,32 +153,35 @@ namespace
void visit(const ContentsFileEntry & e)
{
- FSEntry f(e.location_key()->value());
- if (! f.exists())
+ FSPath f(e.location_key()->value());
+ FSStat f_stat(f);
+ if (! f_stat.exists())
message(f, "Does not exist");
- else if (! f.is_regular_file())
+ else if (! f_stat.is_regular_file())
message(f, "Not a regular file");
else
- check_mtime(e, f) && check_md5(e, f);
+ check_mtime(e, f, f_stat) && check_md5(e, f);
}
void visit(const ContentsSymEntry & e)
{
- FSEntry f(e.location_key()->value());
- if (! f.exists())
+ FSPath f(e.location_key()->value());
+ FSStat f_stat(f);
+ if (! f_stat.exists())
message(f, "Does not exist");
- else if (! f.is_symbolic_link())
+ else if (! f_stat.is_symlink())
message(f, "Not a symbolic link");
else
- check_mtime(e, f);
+ check_mtime(e, f, f_stat);
}
void visit(const ContentsDirEntry & e)
{
- FSEntry f(e.location_key()->value());
- if (! f.exists())
+ FSPath f(e.location_key()->value());
+ FSStat f_stat(f);
+ if (! f_stat.exists())
message(f, "Does not exist");
- else if (! f.is_directory())
+ else if (! f_stat.is_directory())
message(f, "Not a directory");
}
diff --git a/src/clients/cave/colour_formatter.cc b/src/clients/cave/colour_formatter.cc
index 2ecca5033..75992c5c2 100644
--- a/src/clients/cave/colour_formatter.cc
+++ b/src/clients/cave/colour_formatter.cc
@@ -253,7 +253,7 @@ ColourFormatter::format(const NamedSetDepSpec & s, const format::Plain &) const
std::string
-ColourFormatter::format(const FSEntry & s, const format::Plain &) const
+ColourFormatter::format(const FSPath & s, const format::Plain &) const
{
return fuc(fs_format_fsentry_plain(), fv<'s'>(stringify(s)));
}
diff --git a/src/clients/cave/colour_formatter.hh b/src/clients/cave/colour_formatter.hh
index 546d69ee8..ef3037ca2 100644
--- a/src/clients/cave/colour_formatter.hh
+++ b/src/clients/cave/colour_formatter.hh
@@ -21,7 +21,7 @@
#define PALUDIS_GUARD_SRC_CLIENTS_CAVE_COLOUR_FORMATTER_HH 1
#include <paludis/util/attributes.hh>
-#include <paludis/util/fs_entry-fwd.hh>
+#include <paludis/util/fs_path-fwd.hh>
#include <paludis/formatter.hh>
namespace paludis
@@ -44,7 +44,7 @@ namespace paludis
public CanFormat<NamedSetDepSpec>,
public CanFormat<PlainTextLabelDepSpec>,
public CanFormat<ChoiceValue>,
- public CanFormat<FSEntry>,
+ public CanFormat<FSPath>,
public CanSpace
{
private:
@@ -103,7 +103,7 @@ namespace paludis
std::string format(const NamedSetDepSpec &, const format::Plain &) const;
- std::string format(const FSEntry &, const format::Plain &) const;
+ std::string format(const FSPath &, const format::Plain &) const;
std::string newline() const;
std::string indent(const int) const;
diff --git a/src/clients/cave/command_factory.cc b/src/clients/cave/command_factory.cc
index bf9c4d52c..f7c18c18b 100644
--- a/src/clients/cave/command_factory.cc
+++ b/src/clients/cave/command_factory.cc
@@ -25,10 +25,12 @@
#include <paludis/util/wrapped_forward_iterator-impl.hh>
#include <paludis/util/member_iterator-impl.hh>
#include <paludis/util/tokeniser.hh>
-#include <paludis/util/dir_iterator.hh>
-#include <paludis/util/fs_entry.hh>
#include <paludis/util/options.hh>
#include <paludis/util/system.hh>
+#include <paludis/util/fs_iterator.hh>
+#include <paludis/util/fs_path.hh>
+#include <paludis/util/fs_stat.hh>
+
#include <functional>
#include <vector>
#include <map>
@@ -106,7 +108,7 @@ namespace
return std::make_shared<T_>();
}
- const std::shared_ptr<ScriptCommand> make_script_command(const std::string & s, const FSEntry & f)
+ const std::shared_ptr<ScriptCommand> make_script_command(const std::string & s, const FSPath & f)
{
return std::make_shared<ScriptCommand>(s, f);
}
@@ -121,14 +123,14 @@ CommandFactory::CommandFactory() :
for (std::vector<std::string>::const_iterator t(paths.begin()), t_end(paths.end()) ;
t != t_end ; ++t)
{
- FSEntry path(*t);
- if (! path.exists())
+ FSPath path(*t);
+ if (! path.stat().exists())
continue;
- for (DirIterator s(path, { dio_inode_sort }), s_end ;
- s != s_end ; ++s)
+ for (FSIterator s(path, { fsio_inode_sort }), s_end ; s != s_end ; ++s)
{
- if (s->is_regular_file_or_symlink_to_regular_file() && s->has_permission(fs_ug_others, fs_perm_execute))
+ FSStat s_star_stat(*s);
+ if (s_star_stat.is_regular_file_or_symlink_to_regular_file() && (0 != (s_star_stat.permissions() & S_IXOTH)))
{
std::string command_name(s->basename());
std::string::size_type p(command_name.rfind('.'));
diff --git a/src/clients/cave/executables_common.cc b/src/clients/cave/executables_common.cc
index 7378214d9..a255a29ea 100644
--- a/src/clients/cave/executables_common.cc
+++ b/src/clients/cave/executables_common.cc
@@ -30,7 +30,9 @@
#include <paludis/package_id.hh>
#include <paludis/selection.hh>
#include <paludis/user_dep_spec.hh>
-#include <paludis/util/fs_entry.hh>
+#include <paludis/util/fs_path.hh>
+#include <paludis/util/fs_error.hh>
+#include <paludis/util/fs_stat.hh>
#include <paludis/util/indirect_iterator-impl.hh>
#include <paludis/util/system.hh>
#include <paludis/util/tokeniser.hh>
@@ -50,19 +52,18 @@ namespace
{
private:
const std::set<std::string> & _paths;
- const std::function<void (const FSEntry &)> _displayer;
+ const std::function<void (const FSPath &)> _displayer;
- bool is_executable_in_path(const FSEntry & file)
+ bool is_executable_in_path(const FSPath & file)
{
try
{
- return file.exists() &&
- (file.has_permission(fs_ug_owner, fs_perm_execute) ||
- file.has_permission(fs_ug_group, fs_perm_execute) ||
- file.has_permission(fs_ug_others, fs_perm_execute)) &&
+ FSStat file_stat(file);
+
+ return file_stat.exists() && (0 != (file_stat.permissions() & (S_IXUSR | S_IXGRP | S_IXOTH))) &&
_paths.end() != _paths.find(stringify(file.dirname()));
}
- catch (const paludis::FSError &)
+ catch (const FSError &)
{
return false;
}
@@ -71,7 +72,7 @@ namespace
public:
ExecutablesDisplayer(
const std::set<std::string> & p,
- const std::function<void (const FSEntry &)> & d) :
+ const std::function<void (const FSPath &)> & d) :
_paths(p),
_displayer(d)
{
@@ -85,8 +86,8 @@ namespace
void visit(const ContentsSymEntry & e)
{
- FSEntry symlink(e.location_key()->value());
- FSEntry real_file(symlink.realpath_if_exists());
+ FSPath symlink(e.location_key()->value());
+ FSPath real_file(symlink.realpath_if_exists());
if (symlink != real_file && is_executable_in_path(symlink))
_displayer(e.location_key()->value());
@@ -106,7 +107,7 @@ int
paludis::cave::executables_common(
const std::shared_ptr<Environment> & env,
const std::string & param,
- const std::function<void (const FSEntry &)> & displayer,
+ const std::function<void (const FSPath &)> & displayer,
const bool all,
const bool best)
{
diff --git a/src/clients/cave/executables_common.hh b/src/clients/cave/executables_common.hh
index e2364d899..e43a030b7 100644
--- a/src/clients/cave/executables_common.hh
+++ b/src/clients/cave/executables_common.hh
@@ -21,7 +21,7 @@
#ifndef PALUDIS_GUARD_SRC_CLIENTS_CAVE_EXECUTABLES_COMMON_HH
#define PALUDIS_GUARD_SRC_CLIENTS_CAVE_EXECUTABLES_COMMON_HH 1
-#include <paludis/util/fs_entry-fwd.hh>
+#include <paludis/util/fs_path-fwd.hh>
#include <paludis/environment-fwd.hh>
#include <string>
#include <functional>
@@ -34,7 +34,7 @@ namespace paludis
int executables_common(
const std::shared_ptr<Environment> & env,
const std::string &,
- const std::function<void (const FSEntry &)> &,
+ const std::function<void (const FSPath &)> &,
const bool all,
const bool best);
}
diff --git a/src/clients/cave/format_plain_contents_entry.cc b/src/clients/cave/format_plain_contents_entry.cc
index 338986af7..2b1efc719 100644
--- a/src/clients/cave/format_plain_contents_entry.cc
+++ b/src/clients/cave/format_plain_contents_entry.cc
@@ -21,7 +21,7 @@
#include "format_string.hh"
#include <paludis/util/wrapped_forward_iterator.hh>
#include <paludis/util/map.hh>
-#include <paludis/util/fs_entry.hh>
+#include <paludis/util/fs_path.hh>
#include <paludis/util/stringify.hh>
#include <paludis/contents.hh>
#include <paludis/metadata_key.hh>
@@ -56,11 +56,11 @@ namespace
}
};
- int number_of_parents(const FSEntry & f)
+ int number_of_parents(const FSPath & f)
{
- FSEntry ff(f);
+ FSPath ff(f);
int result(0);
- while (((ff = ff.dirname())) != FSEntry("/"))
+ while (((ff = ff.dirname())) != FSPath("/"))
++result;
return result;
}
diff --git a/src/clients/cave/format_plain_metadata_key.cc b/src/clients/cave/format_plain_metadata_key.cc
index 3b9a45f86..253c19ca5 100644
--- a/src/clients/cave/format_plain_metadata_key.cc
+++ b/src/clients/cave/format_plain_metadata_key.cc
@@ -68,7 +68,7 @@ namespace
s << *k.value();
}
- void visit(const MetadataValueKey<FSEntry> & k)
+ void visit(const MetadataValueKey<FSPath> & k)
{
s << k.value();
}
@@ -129,7 +129,7 @@ namespace
s << k.pretty_print_flat(f);
}
- void visit(const MetadataCollectionKey<FSEntrySequence> & k)
+ void visit(const MetadataCollectionKey<FSPathSequence> & k)
{
StringifyFormatter f;
s << k.pretty_print_flat(f);
diff --git a/src/clients/cave/format_user_config.cc b/src/clients/cave/format_user_config.cc
index 5f591f5d4..34ca5729c 100644
--- a/src/clients/cave/format_user_config.cc
+++ b/src/clients/cave/format_user_config.cc
@@ -20,7 +20,8 @@
#include "format_user_config.hh"
#include <paludis/util/config_file.hh>
#include <paludis/util/system.hh>
-#include <paludis/util/fs_entry.hh>
+#include <paludis/util/fs_path.hh>
+#include <paludis/util/fs_stat.hh>
#include <paludis/util/singleton-impl.hh>
#include <paludis/util/pimp-impl.hh>
#include <paludis/util/options.hh>
@@ -90,12 +91,12 @@ namespace paludis
template <>
struct Imp<FormatUserConfigFile>
{
- FSEntry path;
+ FSPath path;
KeyValueConfigFile conf;
Imp() :
path(getenv_with_default("CAVE_FORMATS_CONF", getenv_with_default("HOME", "/") + "/.cave/formats.conf")),
- conf(path.exists() ? ConfigFile::Source(path) : ConfigFile::Source(""),
+ conf(path.stat().exists() ? ConfigFile::Source(path) : ConfigFile::Source(""),
{ kvcfo_allow_sections, kvcfo_preserve_whitespace },
&user_config_file_presets,
&KeyValueConfigFile::no_transformation)
diff --git a/src/clients/cave/resolve_common.cc b/src/clients/cave/resolve_common.cc
index 4b0fa66d0..169d61f5e 100644
--- a/src/clients/cave/resolve_common.cc
+++ b/src/clients/cave/resolve_common.cc
@@ -516,7 +516,7 @@ namespace
{
if (arg.argument() == "auto")
{
- if (env->preferred_root_key()->value() == FSEntry("/"))
+ if (env->preferred_root_key()->value() == FSPath("/"))
return dt_install_to_slash;
else
return dt_install_to_chroot;
diff --git a/src/clients/cave/script_command.cc b/src/clients/cave/script_command.cc
index df895d213..fa9c8d54d 100644
--- a/src/clients/cave/script_command.cc
+++ b/src/clients/cave/script_command.cc
@@ -24,9 +24,9 @@
#include <paludis/args/escape.hh>
#include <paludis/util/pimp-impl.hh>
#include <paludis/util/system.hh>
-#include <paludis/util/fs_entry.hh>
#include <paludis/util/stringify.hh>
#include <paludis/util/process.hh>
+#include <paludis/util/fs_path.hh>
#include <iostream>
#include <cstdlib>
@@ -42,16 +42,16 @@ namespace paludis
template <>
struct Imp<ScriptCommand>
{
- const FSEntry executable;
+ const FSPath executable;
- Imp(const FSEntry & e) :
+ Imp(const FSPath & e) :
executable(e)
{
}
};
}
-ScriptCommand::ScriptCommand(const std::string &, const FSEntry & e) :
+ScriptCommand::ScriptCommand(const std::string &, const FSPath & e) :
Pimp<ScriptCommand>(e)
{
}
diff --git a/src/clients/cave/script_command.hh b/src/clients/cave/script_command.hh
index da885c26d..0308fb8e9 100644
--- a/src/clients/cave/script_command.hh
+++ b/src/clients/cave/script_command.hh
@@ -22,7 +22,7 @@
#include "command.hh"
#include <paludis/util/pimp.hh>
-#include <paludis/util/fs_entry-fwd.hh>
+#include <paludis/util/fs_path-fwd.hh>
namespace paludis
{
@@ -33,7 +33,7 @@ namespace paludis
public Command
{
public:
- ScriptCommand(const std::string &, const FSEntry &);
+ ScriptCommand(const std::string &, const FSPath &);
~ScriptCommand();
int run(
diff --git a/src/clients/cave/select_format_for_spec.cc b/src/clients/cave/select_format_for_spec.cc
index 8de7dbb6d..62cbfa101 100644
--- a/src/clients/cave/select_format_for_spec.cc
+++ b/src/clients/cave/select_format_for_spec.cc
@@ -21,7 +21,6 @@
#include "format_user_config.hh"
#include <paludis/environment.hh>
#include <paludis/util/sequence.hh>
-#include <paludis/util/fs_entry.hh>
#include <paludis/selection.hh>
#include <paludis/filter.hh>
#include <paludis/filtered_generator.hh>
@@ -40,7 +39,7 @@ paludis::cave::select_format_for_spec(
const T_ & if_unavailable
)
{
- if (! (*env)[selection::SomeArbitraryVersion(generator::Matches(spec, { }) | filter::InstalledAtRoot(FSEntry("/")))]->empty())
+ if (! (*env)[selection::SomeArbitraryVersion(generator::Matches(spec, { }) | filter::InstalledAtSlash())]->empty())
return if_installed;
if (! (*env)[selection::SomeArbitraryVersion(generator::Matches(spec, { }) | filter::SupportsAction<InstallAction>()
| filter::NotMasked())]->empty())
diff --git a/src/clients/importare/importare.cc b/src/clients/importare/importare.cc
index d7e5a8ea8..b5ad7eb61 100644
--- a/src/clients/importare/importare.cc
+++ b/src/clients/importare/importare.cc
@@ -193,12 +193,12 @@ main(int argc, char *argv[])
std::shared_ptr<Map<std::string, std::string> > keys(std::make_shared<Map<std::string, std::string>>());
keys->insert("location", stringify(
CommandLine::get_instance()->a_location.specified() ?
- FSEntry(CommandLine::get_instance()->a_location.argument()) :
- FSEntry::cwd()));
+ FSPath(CommandLine::get_instance()->a_location.argument()) :
+ FSPath::cwd()));
keys->insert("install_under", stringify(
CommandLine::get_instance()->a_install_under.specified() ?
- FSEntry(CommandLine::get_instance()->a_install_under.argument()) :
- FSEntry("/")));
+ FSPath(CommandLine::get_instance()->a_install_under.argument()) :
+ FSPath("/")));
keys->insert("rewrite_ids_over_to_root", stringify(
CommandLine::get_instance()->a_rewrite_ids_over_to_root.specified() ?
CommandLine::get_instance()->a_rewrite_ids_over_to_root.argument() : -1));
diff --git a/src/clients/inquisitio/key_extractor.cc b/src/clients/inquisitio/key_extractor.cc
index 1dcd1b212..36e273867 100644
--- a/src/clients/inquisitio/key_extractor.cc
+++ b/src/clients/inquisitio/key_extractor.cc
@@ -20,7 +20,6 @@
#include "key_extractor.hh"
#include "matcher.hh"
#include <paludis/util/pimp-impl.hh>
-#include <paludis/util/fs_entry.hh>
#include <paludis/util/stringify.hh>
#include <paludis/util/set.hh>
#include <paludis/util/join.hh>
@@ -240,7 +239,7 @@ namespace
{
}
- void visit(const MetadataValueKey<FSEntry> & s)
+ void visit(const MetadataValueKey<FSPath> & s)
{
result = _m(stringify(s.value()));
}
@@ -310,7 +309,7 @@ namespace
std::bind(&Matcher::operator(), std::cref(_m), _1));
}
- void visit(const MetadataCollectionKey<FSEntrySequence> & s)
+ void visit(const MetadataCollectionKey<FSPathSequence> & s)
{
using namespace std::placeholders;
@@ -318,7 +317,7 @@ namespace
result = _m(join(s.value()->begin(), s.value()->end(), " "));
else
result = s.value()->end() != std::find_if(s.value()->begin(), s.value()->end(),
- std::bind(&Matcher::operator(), std::cref(_m), std::bind(&stringify<FSEntry>, _1)));
+ std::bind(&Matcher::operator(), std::cref(_m), std::bind(&stringify<FSPath>, _1)));
}
void visit(const MetadataCollectionKey<PackageIDSequence> & s)
diff --git a/src/clients/instruo/instruo.cc b/src/clients/instruo/instruo.cc
index 430c59740..d0cda2737 100644
--- a/src/clients/instruo/instruo.cc
+++ b/src/clients/instruo/instruo.cc
@@ -30,7 +30,6 @@
#include <paludis/util/system.hh>
#include <paludis/util/join.hh>
#include <paludis/util/log.hh>
-#include <paludis/util/fs_entry.hh>
#include <paludis/util/sequence.hh>
#include <paludis/util/map.hh>
#include <paludis/util/simple_visitor_cast.hh>
@@ -98,9 +97,9 @@ namespace
const std::shared_ptr<const Contents> & PALUDIS_ATTRIBUTE((unused)) c(k.value());
}
- void visit(const MetadataValueKey<FSEntry> & k)
+ void visit(const MetadataValueKey<FSPath> & k)
{
- const FSEntry & PALUDIS_ATTRIBUTE((unused)) c(k.value());
+ const FSPath & PALUDIS_ATTRIBUTE((unused)) c(k.value());
}
void visit(const MetadataValueKey<std::shared_ptr<const RepositoryMaskInfo> > & k)
@@ -153,9 +152,9 @@ namespace
const std::shared_ptr<const Sequence<std::string> > & PALUDIS_ATTRIBUTE((unused)) s(k.value());
}
- void visit(const MetadataCollectionKey<FSEntrySequence> & k)
+ void visit(const MetadataCollectionKey<FSPathSequence> & k)
{
- const std::shared_ptr<const FSEntrySequence> & PALUDIS_ATTRIBUTE((unused)) s(k.value());
+ const std::shared_ptr<const FSPathSequence> & PALUDIS_ATTRIBUTE((unused)) s(k.value());
}
void visit(const MetadataCollectionKey<KeywordNameSet> & k)
@@ -296,7 +295,7 @@ main(int argc, char *argv[])
throw args::DoHelp("you should specify exactly one action");
if (! CommandLine::get_instance()->a_repository_directory.specified())
- CommandLine::get_instance()->a_repository_directory.set_argument(stringify(FSEntry::cwd()));
+ CommandLine::get_instance()->a_repository_directory.set_argument(stringify(FSPath::cwd()));
if (CommandLine::get_instance()->a_version.specified())
{
@@ -320,13 +319,13 @@ main(int argc, char *argv[])
+ CommandLine::get_instance()->a_output_directory.long_name() + "' must be specified");
if (! CommandLine::get_instance()->a_output_directory.specified())
- CommandLine::get_instance()->a_output_directory.set_argument(stringify(FSEntry::cwd()));
+ CommandLine::get_instance()->a_output_directory.set_argument(stringify(FSPath::cwd()));
- std::shared_ptr<FSEntrySequence> extra_repository_dirs(std::make_shared<FSEntrySequence>());
+ std::shared_ptr<FSPathSequence> extra_repository_dirs(std::make_shared<FSPathSequence>());
for (args::StringSequenceArg::ConstIterator d(CommandLine::get_instance()->a_extra_repository_dir.begin_args()),
d_end(CommandLine::get_instance()->a_extra_repository_dir.end_args()) ;
d != d_end ; ++d)
- extra_repository_dirs->push_back(*d);
+ extra_repository_dirs->push_back(FSPath(*d));
std::shared_ptr<Map<std::string, std::string> > keys(std::make_shared<Map<std::string, std::string>>());
keys->insert("append_repository_name_to_write_cache", "false");
@@ -361,7 +360,7 @@ main(int argc, char *argv[])
std::shared_ptr<SafeOFStream> outf;
if (CommandLine::get_instance()->a_report_file.specified())
- outf = std::make_shared<SafeOFStream>(FSEntry(CommandLine::get_instance()->a_report_file.argument()));
+ outf = std::make_shared<SafeOFStream>(FSPath(CommandLine::get_instance()->a_report_file.argument()));
std::ostream & out(outf ? *outf : cout);
diff --git a/src/clients/paludis/applets.cc b/src/clients/paludis/applets.cc
index a436f65ca..8d962dc36 100644
--- a/src/clients/paludis/applets.cc
+++ b/src/clients/paludis/applets.cc
@@ -24,7 +24,6 @@
#include <iostream>
#include <paludis/paludis.hh>
#include <paludis/util/log.hh>
-#include <paludis/util/dir_iterator.hh>
#include <paludis/util/system.hh>
#include <paludis/util/tokeniser.hh>
#include <paludis/util/timestamp.hh>
@@ -72,7 +71,7 @@ namespace
std::cout << k.value() << std::endl;
}
- void visit(const MetadataValueKey<FSEntry> & k)
+ void visit(const MetadataValueKey<FSPath> & k)
{
std::cout << k.value() << std::endl;
}
@@ -137,7 +136,7 @@ namespace
std::cout << k.pretty_print_flat(f) << std::endl;
}
- void visit(const MetadataCollectionKey<FSEntrySequence> & k)
+ void visit(const MetadataCollectionKey<FSPathSequence> & k)
{
StringifyFormatter f;
std::cout << k.pretty_print_flat(f) << std::endl;
@@ -355,19 +354,19 @@ int do_list_sync_protocols(const std::shared_ptr<Environment> & env)
{
std::map<std::string, std::string> syncers;
- std::shared_ptr<const FSEntrySequence> sd(env->syncers_dirs());
- for (FSEntrySequence::ConstIterator d(sd->begin()),
+ std::shared_ptr<const FSPathSequence> sd(env->syncers_dirs());
+ for (FSPathSequence::ConstIterator d(sd->begin()),
d_end(sd->end()) ; d != d_end ; ++d)
{
- FSEntry dir(*d);
- if (! dir.is_directory())
+ FSPath dir(*d);
+ if (! dir.stat().is_directory())
continue;
- for (DirIterator f(dir), f_end; f != f_end; ++f)
+ for (FSIterator f(dir, { }), f_end; f != f_end; ++f)
{
std::string name(f->basename());
- if (f->has_permission(fs_ug_owner, fs_perm_execute) &&
- 0 == name.compare(0, 2, "do", 0, 2))
+ if ((0 != (f->stat().permissions() & S_IXUSR)) &&
+ 0 == name.compare(0, 2, "do", 0, 2))
{
name.erase(0, 2);
if (syncers.find(name) == syncers.end())
diff --git a/src/clients/paludis/do_executables.cc b/src/clients/paludis/do_executables.cc
index 5a242427f..2b94dd8a9 100644
--- a/src/clients/paludis/do_executables.cc
+++ b/src/clients/paludis/do_executables.cc
@@ -18,7 +18,6 @@
*/
#include "do_executables.hh"
-#include "paludis/util/fs_entry-fwd.hh"
#include "paludis/util/log.hh"
#include "paludis/util/tokeniser.hh"
#include <src/output/colour.hh>
@@ -40,19 +39,20 @@ namespace
private:
const std::list<std::string> _paths;
- bool is_file_in_path(FSEntry file)
+ bool is_file_in_path(FSPath file)
{
try
{
- if (file.exists())
+ FSStat file_stat(file);
+ if (file_stat.exists())
{
- if (file.has_permission(fs_ug_others, fs_perm_execute))
+ if (0 != (file_stat.permissions() & S_IXOTH))
{
- FSEntry dirname(file.dirname());
+ FSPath dirname(file.dirname());
for (std::list<std::string>::const_iterator it(_paths.begin()),
it_end(_paths.end()); it_end != it; ++it)
{
- if (dirname == *it)
+ if (stringify(dirname) == *it)
return true;
}
}
@@ -92,8 +92,8 @@ namespace
void visit(const ContentsSymEntry & e)
{
- FSEntry sym(e.location_key()->value());
- FSEntry real(sym.realpath_if_exists());
+ FSPath sym(e.location_key()->value());
+ FSPath real(sym.realpath_if_exists());
if (sym != real)
if (is_file_in_path(sym))
cout << " " << colour(cl_sym, e.location_key()->value()) << endl;
diff --git a/src/clients/paludis/info.cc b/src/clients/paludis/info.cc
index 7743beb01..7d2679120 100644
--- a/src/clients/paludis/info.cc
+++ b/src/clients/paludis/info.cc
@@ -115,7 +115,7 @@ namespace
cout << std::setw(30) << (indent + k.human_name() + ":") << " " << k.value() << endl;
}
- void visit(const MetadataValueKey<FSEntry> & k)
+ void visit(const MetadataValueKey<FSPath> & k)
{
cout << std::setw(30) << (indent + k.human_name() + ":") << " " << k.value() << endl;
}
@@ -177,7 +177,7 @@ namespace
cout << std::setw(30) << (indent + k.human_name() + ":") << " " << k.pretty_print_flat(f) << endl;
}
- void visit(const MetadataCollectionKey<FSEntrySequence> & k)
+ void visit(const MetadataCollectionKey<FSPathSequence> & k)
{
ColourFormatter f;
cout << std::setw(30) << (indent + k.human_name() + ":") << " " << k.pretty_print_flat(f) << endl;
diff --git a/src/clients/reconcilio/fix_linkage.cc b/src/clients/reconcilio/fix_linkage.cc
index f5507aa7d..6c5152cdb 100644
--- a/src/clients/reconcilio/fix_linkage.cc
+++ b/src/clients/reconcilio/fix_linkage.cc
@@ -21,7 +21,6 @@
#include "fix_linkage.hh"
#include "install.hh"
-#include <paludis/util/fs_entry.hh>
#include <paludis/util/join.hh>
#include <paludis/util/log.hh>
#include <paludis/util/sequence.hh>
diff --git a/src/output/colour_formatter.cc b/src/output/colour_formatter.cc
index 9d4964167..6c36f3f7d 100644
--- a/src/output/colour_formatter.cc
+++ b/src/output/colour_formatter.cc
@@ -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
@@ -243,7 +243,7 @@ ColourFormatter::format(const PackageID & f, const format::Installable &) const
}
std::string
-ColourFormatter::format(const FSEntry & f, const format::Plain &) const
+ColourFormatter::format(const FSPath & f, const format::Plain &) const
{
return stringify(f);
}
diff --git a/src/output/colour_formatter.hh b/src/output/colour_formatter.hh
index 391dc5c1a..75c6fab09 100644
--- a/src/output/colour_formatter.hh
+++ b/src/output/colour_formatter.hh
@@ -1,7 +1,7 @@
/* vim: set sw=4 sts=4 et foldmethod=syntax : */
/*
- * Copyright (c) 2007, 2008, 2009 Ciaran McCreesh
+ * Copyright (c) 2007, 2008, 2009, 2010 Ciaran McCreesh
*
* This file is part of the Paludis package manager. Paludis is free software;
* you can redistribute it and/or modify it under the terms of the GNU General
@@ -23,7 +23,7 @@
#include <paludis/formatter.hh>
#include <paludis/name-fwd.hh>
#include <paludis/dep_spec-fwd.hh>
-#include <paludis/util/fs_entry-fwd.hh>
+#include <paludis/util/fs_path-fwd.hh>
class ColourFormatter :
public paludis::CanFormat<paludis::ChoiceValue>,
@@ -39,7 +39,7 @@ class ColourFormatter :
public paludis::CanFormat<paludis::FetchableURIDepSpec>,
public paludis::CanFormat<paludis::LicenseDepSpec>,
public paludis::CanFormat<paludis::NamedSetDepSpec>,
- public paludis::CanFormat<paludis::FSEntry>,
+ public paludis::CanFormat<paludis::FSPath>,
public paludis::CanFormat<paludis::PackageID>,
public paludis::CanFormat<std::string>,
public paludis::CanSpace
@@ -91,7 +91,7 @@ class ColourFormatter :
std::string format(const paludis::BlockDepSpec &, const paludis::format::Plain &) const;
- std::string format(const paludis::FSEntry &, const paludis::format::Plain &) const;
+ std::string format(const paludis::FSPath &, const paludis::format::Plain &) const;
std::string format(const paludis::PackageID &, const paludis::format::Plain &) const;
std::string format(const paludis::PackageID &, const paludis::format::Installed &) const;
diff --git a/src/output/console_install_task.cc b/src/output/console_install_task.cc
index b08399b05..6110e3879 100644
--- a/src/output/console_install_task.cc
+++ b/src/output/console_install_task.cc
@@ -111,7 +111,7 @@ ConsoleInstallTask::ConsoleInstallTask(Environment * const env,
_download_size(0),
_download_size_overflow(false),
_all_tags(std::make_shared<Set<DepTagEntry, DepTagEntryComparator>>()),
- _already_downloaded(std::make_shared<Set<FSEntry>>()),
+ _already_downloaded(std::make_shared<Set<FSPath, FSPathComparator>>()),
_resolution_finished(false)
{
std::fill_n(_counts, static_cast<int>(last_count), 0);
@@ -1290,11 +1290,11 @@ namespace
struct FindDistfilesSize :
PretendFetchAction
{
- std::shared_ptr<Set<FSEntry> > already_downloaded;
+ std::shared_ptr<Set<FSPath, FSPathComparator> > already_downloaded;
unsigned long size;
bool overflow;
- FindDistfilesSize(const FetchActionOptions & o, const std::shared_ptr<Set<FSEntry> > & a) :
+ FindDistfilesSize(const FetchActionOptions & o, const std::shared_ptr<Set<FSPath, FSPathComparator> > & a) :
PretendFetchAction(o),
already_downloaded(a),
size(0),
@@ -1302,7 +1302,7 @@ namespace
{
}
- void will_fetch(const FSEntry & destination, const unsigned long size_in_bytes)
+ void will_fetch(const FSPath & destination, const unsigned long size_in_bytes)
{
if (already_downloaded->end() != already_downloaded->find(destination))
return;
diff --git a/src/output/console_install_task.hh b/src/output/console_install_task.hh
index 81ba943a8..85ae9b1f0 100644
--- a/src/output/console_install_task.hh
+++ b/src/output/console_install_task.hh
@@ -109,7 +109,7 @@ namespace paludis
unsigned long _download_size;
bool _download_size_overflow;
std::shared_ptr<Set<DepTagEntry, DepTagEntryComparator> > _all_tags;
- std::shared_ptr<Set<FSEntry> > _already_downloaded;
+ std::shared_ptr<Set<FSPath, FSPathComparator> > _already_downloaded;
ChoiceDescriptions _choice_descriptions;
bool _resolution_finished;
diff --git a/src/output/console_query_task.cc b/src/output/console_query_task.cc
index 5b89ea974..94bf3c578 100644
--- a/src/output/console_query_task.cc
+++ b/src/output/console_query_task.cc
@@ -329,7 +329,7 @@ namespace
{
}
- void visit(const MetadataCollectionKey<FSEntrySequence> & k)
+ void visit(const MetadataCollectionKey<FSPathSequence> & k)
{
if (k.type() == type)
{
@@ -692,7 +692,7 @@ namespace
}
}
- void visit(const MetadataValueKey<FSEntry> & k)
+ void visit(const MetadataValueKey<FSPath> & k)
{
if (k.type() == type)
{
diff --git a/src/output/mask_displayer.cc b/src/output/mask_displayer.cc
index 867855bf7..dd0fb1d37 100644
--- a/src/output/mask_displayer.cc
+++ b/src/output/mask_displayer.cc
@@ -121,7 +121,7 @@ namespace
join((*k.value()).comment()->begin(), (*k.value()).comment()->end(), " ");
}
- void visit(const MetadataValueKey<FSEntry> & k)
+ void visit(const MetadataValueKey<FSPath> & k)
{
s << k.value();
}
@@ -138,7 +138,7 @@ namespace
s << k.pretty_print_flat(formatter);
}
- void visit(const MetadataCollectionKey<FSEntrySequence> & k)
+ void visit(const MetadataCollectionKey<FSPathSequence> & k)
{
ColourFormatter formatter;
s << k.pretty_print_flat(formatter);