Skip to content
Snippets Groups Projects
Commit 18c71f72 authored by Ludovico de Nittis's avatar Ludovico de Nittis
Browse files

Merge branch 'wip/smcv/fix-listing-overrides' into 'master'

Fix listing overrides in system-info with recent pressure-vessel

See merge request !313
parents cf56fd8e 39ff3139
No related branches found
No related tags found
1 merge request!313Fix listing overrides in system-info with recent pressure-vessel
Pipeline #13073 passed
......@@ -281,17 +281,18 @@ _srt_resolve_in_sysroot (int sysroot,
if (!glnx_fstatat (fd, "", &stat_buf, AT_EMPTY_PATH, error))
{
g_prefix_error (error,
"Unable to determine whether \"%s\" "
"Unable to determine whether \"%s/%s\" "
"is a directory",
current_path->str);
current_path->str, next);
return -1;
}
if (!S_ISDIR (stat_buf.st_mode))
{
g_set_error (error, G_IO_ERROR, G_IO_ERROR_NOT_DIRECTORY,
"\"%s\" is not a directory",
current_path->str);
"\"%s/%s\" is not a directory",
current_path->str, next);
return -1;
}
}
......
......@@ -1231,8 +1231,8 @@ ensure_overrides_cached (SrtSystemInfo *self)
if (!self->overrides.have_data)
{
static const char * const paths[] = {
"overrides",
"usr/lib/pressure-vessel/overrides",
"overrides/",
"usr/lib/pressure-vessel/overrides/",
};
g_autoptr(GError) error = NULL;
g_autofree gchar *output = NULL;
......
......@@ -128,11 +128,12 @@ test_resolve_in_sysroot (Fixture *f,
static const ResolveTest tests[] =
{
{ { "a/b/c/d" }, { "a/b/c/d" } },
{ { "a/b/c/d/" }, { "a/b/c/d" } },
{
{ "a/b/c/d", SRT_RESOLVE_FLAGS_NONE, RESOLVE_CALL_FLAGS_IGNORE_PATH },
{ "a/b/c/d" },
},
{ { "a/b/c/d", SRT_RESOLVE_FLAGS_MKDIR_P }, { "a/b/c/d" } },
{ { "a/b/c/d/", SRT_RESOLVE_FLAGS_MKDIR_P }, { "a/b/c/d" } },
{
{ "a/b/c/d", SRT_RESOLVE_FLAGS_MKDIR_P, RESOLVE_CALL_FLAGS_IGNORE_PATH },
{ "a/b/c/d" },
......@@ -150,10 +151,19 @@ test_resolve_in_sysroot (Fixture *f,
{ "a/b/c/d" }
},
{ { "a/b/c/file", SRT_RESOLVE_FLAGS_READABLE }, { "a/b/c/file" } },
{ { "a/b/c/file/" }, { NULL, G_IO_ERROR_NOT_DIRECTORY }},
{
{ "a/b/c/file", SRT_RESOLVE_FLAGS_DIRECTORY },
{ NULL, G_IO_ERROR_NOT_DIRECTORY }
},
{
{ "a/b/c/file/", SRT_RESOLVE_FLAGS_DIRECTORY },
{ NULL, G_IO_ERROR_NOT_DIRECTORY }
},
{
{ "a/b/c/file/", SRT_RESOLVE_FLAGS_READABLE },
{ NULL, G_IO_ERROR_NOT_DIRECTORY }
},
{
{ "a/b/c/file", SRT_RESOLVE_FLAGS_READABLE|SRT_RESOLVE_FLAGS_DIRECTORY },
{ NULL, G_IO_ERROR_NOT_DIRECTORY }
......@@ -161,8 +171,9 @@ test_resolve_in_sysroot (Fixture *f,
{ { "a/b///////.////./././///././c/d" }, { "a/b/c/d" } },
{ { "/a/b///////.////././../b2////././c2/d2" }, { "a/b2/c2/d2" } },
{ { "a/b/c/d/e/f" }, { NULL, G_IO_ERROR_NOT_FOUND } },
{ { "a/b/c/d/e/f/", SRT_RESOLVE_FLAGS_MKDIR_P }, { "a/b/c/d/e/f" } },
{ { "a/b/c/d/e/f", SRT_RESOLVE_FLAGS_MKDIR_P }, { "a/b/c/d/e/f" } },
{ { "a/b/c/d/e/f" }, { "a/b/c/d/e/f" } },
{ { "a/b/c/d/e/f/" }, { "a/b/c/d/e/f" } },
{ { "a/b/c/d/e/f", SRT_RESOLVE_FLAGS_MKDIR_P }, { "a/b/c/d/e/f" } },
{ { "a3/b3/c3" }, { NULL, G_IO_ERROR_NOT_FOUND } },
{ { "a3/b3/c3", SRT_RESOLVE_FLAGS_MKDIR_P }, { "a3/b3/c3" } },
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment