glnx porting: Port away from gs_file_get_basename_cached()

In some cases we use glnx_basename(), in others we already had a
`GFileInfo` around with the name.

Closes: #316
Approved by: jlebon
This commit is contained in:
Colin Walters 2016-05-31 11:35:35 -04:00 committed by Atomic Bot
parent 900c085f21
commit eaea07fe43
4 changed files with 6 additions and 6 deletions

View File

@ -126,8 +126,8 @@ ostree_repo_list_static_delta_names (OstreeRepo *self,
if (g_file_info_get_file_type (file_info2) != G_FILE_TYPE_DIRECTORY)
continue;
name1 = gs_file_get_basename_cached (child);
name2 = gs_file_get_basename_cached (child2);
name1 = g_file_info_get_name (file_info);
name2 = g_file_info_get_name (file_info2);
{
g_autoptr(GFile) meta_path = g_file_get_child (child2, "superblock");

View File

@ -32,7 +32,7 @@ _ostree_sysroot_list_deployment_dirs_for_os (GFile *osdir,
GError **error)
{
gboolean ret = FALSE;
const char *osname = gs_file_get_basename_cached (osdir);
const char *osname = glnx_basename (gs_file_get_path_cached (osdir));
g_autoptr(GFileEnumerator) dir_enum = NULL;
g_autoptr(GFile) osdeploy_dir = NULL;
GError *temp_error = NULL;
@ -370,7 +370,7 @@ cleanup_old_deployments (OstreeSysroot *self,
g_autofree char *osname = NULL;
g_autofree char *bootcsum = NULL;
if (!parse_bootdir_name (gs_file_get_basename_cached (bootdir),
if (!parse_bootdir_name (glnx_basename (gs_file_get_path_cached (bootdir)),
&osname, &bootcsum))
g_assert_not_reached ();

View File

@ -684,7 +684,7 @@ relabel_recursively (OstreeSysroot *sysroot,
if (file_info == NULL)
break;
g_ptr_array_add (path_parts, (char*)gs_file_get_basename_cached (child));
g_ptr_array_add (path_parts, (char*)g_file_info_get_name (file_info));
ftype = g_file_info_get_file_type (file_info);
if (ftype == G_FILE_TYPE_DIRECTORY)

View File

@ -120,7 +120,7 @@ relabel_recursively (OstreeSePolicy *sepolicy,
if (file_info == NULL)
break;
g_ptr_array_add (path_parts, (char*)gs_file_get_basename_cached (child));
g_ptr_array_add (path_parts, (char*)g_file_info_get_name (file_info));
ftype = g_file_info_get_file_type (file_info);
if (ftype == G_FILE_TYPE_DIRECTORY)