[folks] testing: avoid false warning
- From: Patrick Ohly <pohly src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [folks] testing: avoid false warning
- Date: Tue, 26 Mar 2013 15:50:55 +0000 (UTC)
commit f7035a7e21ef37329cf4fea9fb569d94185d5751
Author: Patrick Ohly <patrick ohly intel com>
Date: Mon Mar 25 14:37:26 2013 +0100
testing: avoid false warning
When FOLKS_BACKEND_PATH is set to the build dirs during testing, the
"content type of '%s' appears to be '%s' which looks suspicious. Have
you installed shared-mime-info?" warning gets triggered repeatedly,
because these dirs contain all kinds of files (executables, compiler
dependency files, etc.) which are not expected in the normal install
location.
This is annoying when running a test with "make <test>.gdb" because
gdb stops on a glib trace point for each warning. Therefore disable
the warning when FOLKS_BACKEND_PATH is set. Extending the whitelist
has the drawback that it might not catch all files that can appear
there in the future.
folks/backend-store.vala | 9 +++++++--
1 files changed, 7 insertions(+), 2 deletions(-)
---
diff --git a/folks/backend-store.vala b/folks/backend-store.vala
index d80eceb..e7b5d69 100644
--- a/folks/backend-store.vala
+++ b/folks/backend-store.vala
@@ -632,6 +632,7 @@ public class Folks.BackendStore : Object {
var modules_final = new HashMap<string, File> ();
+ string? _path = Environment.get_variable ("FOLKS_BACKEND_PATH");
foreach (var info in infos)
{
var file = dir.get_child (info.get_name ());
@@ -668,8 +669,12 @@ public class Folks.BackendStore : Object {
"The content type of '%s' could not be determined. Have you installed shared-mime-info?",
file.get_path ());
}
- /* We should have only .la .so and sub-directories */
- else if (mime != "application/x-sharedlib" &&
+ /*
+ * We should have only .la .so and sub-directories, except if FOLKS_BACKEND_PATH is set.
+ * Then we will run into all kinds of files.
+ */
+ else if (_path == null &&
+ mime != "application/x-sharedlib" &&
mime != "application/x-shared-library-la" &&
mime != "inode/directory")
{
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]