aboutsummaryrefslogtreecommitdiff
path: root/src/clients/cave
diff options
context:
space:
mode:
Diffstat (limited to 'src/clients/cave')
-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
30 files changed, 104 insertions, 99 deletions
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())