aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAvatar Richard Brown <rbrown@exherbo.org> 2009-03-14 07:12:27 +0000
committerAvatar Richard Brown <rbrown@exherbo.org> 2009-03-14 07:12:27 +0000
commitd57d0952051724d80b00b49270008be48b638922 (patch)
tree26da8e62fccd992fdf0741407f78bf41a216c2d5
parent58228fc869b5e1c0772a60b3b9b8d69066eba18d (diff)
downloadpaludis-d57d0952051724d80b00b49270008be48b638922.tar.gz
paludis-d57d0952051724d80b00b49270008be48b638922.tar.xz
Make paludis --executables warn if a file does not exist
-rw-r--r--src/clients/paludis/do_executables.cc20
1 files changed, 14 insertions, 6 deletions
diff --git a/src/clients/paludis/do_executables.cc b/src/clients/paludis/do_executables.cc
index 9ecafe1..c7902ad 100644
--- a/src/clients/paludis/do_executables.cc
+++ b/src/clients/paludis/do_executables.cc
@@ -19,6 +19,7 @@
#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>
#include "command_line.hh"
@@ -41,15 +42,22 @@ namespace
bool is_file_in_path(FSEntry file)
{
- if (file.has_permission(fs_ug_others, fs_perm_execute))
+ if (file.exists())
{
- FSEntry dirname(file.dirname());
- for (std::list<std::string>::const_iterator it(_paths.begin()),
- it_end(_paths.end()); it_end != it; ++it)
+ if (file.has_permission(fs_ug_others, fs_perm_execute))
{
- if (dirname == *it)
- return true;
+ FSEntry dirname(file.dirname());
+ for (std::list<std::string>::const_iterator it(_paths.begin()),
+ it_end(_paths.end()); it_end != it; ++it)
+ {
+ if (dirname == *it)
+ return true;
+ }
}
+ } else {
+ Context context("When checking permissions on '" + stringify(file) + "'");
+ Log::get_instance()->message("do_executables.file_does_not_exist", ll_warning, lc_context)
+ << "'" << stringify(file) << "' is listed as installed but does not exist";
}
return false;
}