app: also search interpreters executable in $PATH.

Same as we did for binfmt-style lines, if the executable part (for
instance in `pygimp.interp`) is not an absolute path, let's allow
ourselves to find it in the environment $PATH.

(cherry picked from commit f3c5ed55c8)
This commit is contained in:
Jehan 2018-06-16 03:14:43 +02:00
parent 15075932be
commit 0af3ae81ff
1 changed files with 13 additions and 5 deletions

View File

@ -294,14 +294,22 @@ gimp_interpreter_db_add_program (GimpInterpreterDB *db,
if (! g_file_test (program, G_FILE_TEST_IS_EXECUTABLE))
{
g_message (_("Bad interpreter referenced in interpreter file %s: %s"),
gimp_file_get_utf8_name (file),
gimp_filename_to_utf8 (program));
return;
program = g_find_program_in_path (program);
if (! program || ! g_file_test (program, G_FILE_TEST_IS_EXECUTABLE))
{
g_message (_("Bad interpreter referenced in interpreter file %s: %s"),
gimp_file_get_utf8_name (file),
gimp_filename_to_utf8 (program));
if (program)
g_free (program);
return;
}
}
else
program = g_strdup (program);
if (! g_hash_table_lookup (db->programs, name))
g_hash_table_insert (db->programs, g_strdup (name), g_strdup (program));
g_hash_table_insert (db->programs, g_strdup (name), program);
}
static void