mirror of
https://github.com/flatpak/flatpak.git
synced 2026-10-21 15:15:34 -04:00
builder: Handle absolute paths in command
Don't fail with "not found" in this case because we're checking the absolute path on the host, not in the final sandbox.
This commit is contained in:
1 parent
d7f2bf000e
commit
c7086364be
1 file changed
+12
-3
@@ -2057,10 +2057,19 @@ builder_manifest_finish (BuilderManifest *self,
|
||||
|
||||
if (self->command)
|
||||
{
|
||||
g_autoptr(GFile) bin_dir = g_file_resolve_relative_path (app_dir, "files/bin");
|
||||
g_autoptr(GFile) bin_command = g_file_get_child (bin_dir, self->command);
|
||||
g_autoptr(GFile) files_dir = g_file_resolve_relative_path (app_dir, "files");
|
||||
g_autoptr(GFile) command_file = NULL;
|
||||
|
||||
if (!g_file_query_exists (bin_command, NULL))
|
||||
if (!g_path_is_absolute (self->command))
|
||||
{
|
||||
g_autoptr(GFile) bin_dir = g_file_resolve_relative_path (files_dir, "bin");
|
||||
command_file = g_file_get_child (bin_dir, self->command);
|
||||
}
|
||||
else if (g_str_has_prefix (self->command, "/app/"))
|
||||
command_file = g_file_resolve_relative_path (files_dir, self->command + strlen ("/app/"));
|
||||
|
||||
if (command_file != NULL &&
|
||||
!g_file_query_exists (command_file, NULL))
|
||||
{
|
||||
const char *help = "";
|
||||
|
||||
|
||||
Reference in new issue
Block a user