Skip to content
Snippets Groups Projects

Auto-detect path to expectations

Merged Simon McVittie requested to merge wip/smcv/auto-expectations into master
All threads resolved!
Files
2
@@ -202,6 +202,7 @@ srt_system_info_finalize (GObject *object)
g_clear_pointer (&self->abis, g_ptr_array_unref);
g_free (self->expectations);
g_strfreev (self->env);
G_OBJECT_CLASS (srt_system_info_parent_class)->finalize (object);
}
@@ -451,0+452,0 @@
{
g_debug ("An error occurred while opening the symbols directory: %s", error->message);
g_clear_error (&error);
ret = SRT_LIBRARY_ISSUES_UNKNOWN_EXPECTATIONS;
goto out;
}
while ((filename = g_dir_read_name (dir)))
{
char *line = NULL;
@@ -588,59 +591,56 @@ srt_system_info_check_library (SrtSystemInfo *self,
}
}
if (dir != NULL)
while (dir != NULL && (filename = g_dir_read_name (dir)))
{
while ((filename = g_dir_read_name (dir)))
{
if (!g_str_has_suffix (filename, ".symbols"))
continue;
if (!g_str_has_suffix (filename, ".symbols"))
continue;
symbols_file = g_build_filename (dir_path, filename, NULL);
fp = fopen(symbols_file, "r");
symbols_file = g_build_filename (dir_path, filename, NULL);
fp = fopen(symbols_file, "r");
if (fp == NULL)
{
int saved_errno = errno;
g_debug ("Error reading \"%s\": %s\n", symbols_file, strerror (saved_errno));
goto out;
}
if (fp == NULL)
{
int saved_errno = errno;
g_debug ("Error reading \"%s\": %s\n", symbols_file, strerror (saved_errno));
goto out;
}
while ((chars = getline(&line, &len, fp)) != -1)
{
char *pointer_into_line = line;
if (line[chars - 1] == '\n')
line[chars - 1] = '\0';
while ((chars = getline(&line, &len, fp)) != -1)
{
char *pointer_into_line = line;
if (line[chars - 1] == '\n')
line[chars - 1] = '\0';
if (line[0] == '\0')
continue;
if (line[0] == '\0')
continue;
if (line[0] != '#' && line[0] != '*' && line[0] != '|' && line[0] != ' ')
if (line[0] != '#' && line[0] != '*' && line[0] != '|' && line[0] != ' ')
{
/* This line introduces a new SONAME, which might
* be the one we are interested in. */
char *soname_found = g_strdup (strsep (&pointer_into_line, " \t"));
if (g_strcmp0 (soname_found, soname) == 0)
{
/* This line introduces a new SONAME, which might
* be the one we are interested in. */
char *soname_found = g_strdup (strsep (&pointer_into_line, " \t"));
if (g_strcmp0 (soname_found, soname) == 0)
{
issues = srt_check_library_presence (soname_found,
multiarch_tuple,
symbols_file,
SRT_LIBRARY_SYMBOLS_FORMAT_DEB_SYMBOLS,
&library);
g_hash_table_insert (abi->cached_results, soname_found, library);
abi->cached_combined_issues |= issues;
if (more_details_out != NULL)
*more_details_out = g_object_ref (library);
free (line);
ret = issues;
goto out;
}
free (soname_found);
issues = srt_check_library_presence (soname_found,
multiarch_tuple,
symbols_file,
SRT_LIBRARY_SYMBOLS_FORMAT_DEB_SYMBOLS,
&library);
g_hash_table_insert (abi->cached_results, soname_found, library);
abi->cached_combined_issues |= issues;
if (more_details_out != NULL)
*more_details_out = g_object_ref (library);
free (line);
ret = issues;
goto out;
}
free (soname_found);
}
g_clear_pointer (&symbols_file, g_free);
g_clear_pointer (&line, g_free);
g_clear_pointer (&fp, fclose);
}
g_clear_pointer (&symbols_file, g_free);
g_clear_pointer (&line, g_free);
g_clear_pointer (&fp, fclose);
}
/* The SONAME's symbols file is not available.
Loading