forked from Mirrors/flatpak-builder
Replace gs_shutil_rm_rf with small helper wrapper over libglnx
parent
8d71a9fc18
commit
9c907c992d
|
@ -136,7 +136,7 @@ flatpak_builtin_build_init (int argc, char **argv, GCancellable *cancellable, GE
|
|||
if (sdk_deploy == NULL)
|
||||
return FALSE;
|
||||
|
||||
if (!gs_shutil_rm_rf (usr_dir, NULL, &my_error))
|
||||
if (!flatpak_rm_rf (usr_dir, NULL, &my_error))
|
||||
{
|
||||
if (!g_error_matches (my_error, G_IO_ERROR, G_IO_ERROR_NOT_FOUND))
|
||||
{
|
||||
|
@ -181,7 +181,7 @@ flatpak_builtin_build_init (int argc, char **argv, GCancellable *cancellable, GE
|
|||
return FALSE;
|
||||
|
||||
/* An extension overrides whatever is there before, so we clean up first */
|
||||
if (!gs_shutil_rm_rf (target, cancellable, error))
|
||||
if (!flatpak_rm_rf (target, cancellable, error))
|
||||
return FALSE;
|
||||
|
||||
if (!flatpak_cp_a (ext_deploy_files, target, FLATPAK_CP_FLAGS_NO_CHOWN, cancellable, error))
|
||||
|
|
|
@ -329,7 +329,7 @@ main (int argc,
|
|||
if (opt_force_clean)
|
||||
{
|
||||
g_print ("Emptying app dir '%s'\n", app_dir_path);
|
||||
if (!gs_shutil_rm_rf (app_dir, NULL, &error))
|
||||
if (!flatpak_rm_rf (app_dir, NULL, &error))
|
||||
{
|
||||
g_printerr ("Couldn't empty app dir '%s': %s",
|
||||
app_dir_path, error->message);
|
||||
|
|
|
@ -1460,7 +1460,7 @@ builder_module_build (BuilderModule *self,
|
|||
return FALSE;
|
||||
}
|
||||
|
||||
if (!gs_shutil_rm_rf (source_dir, NULL, error))
|
||||
if (!flatpak_rm_rf (source_dir, NULL, error))
|
||||
{
|
||||
g_prefix_error (error, "module %s: ", self->name);
|
||||
return FALSE;
|
||||
|
|
|
@ -340,7 +340,7 @@ git_mirror_submodules (const char *repo_location,
|
|||
}
|
||||
}
|
||||
|
||||
if (!gs_shutil_rm_rf (checkout_dir, NULL, error))
|
||||
if (!flatpak_rm_rf (checkout_dir, NULL, error))
|
||||
return FALSE;
|
||||
|
||||
return TRUE;
|
||||
|
|
|
@ -896,7 +896,7 @@ flatpak_dir_ensure_repo (FlatpakDir *self,
|
|||
OSTREE_REPO_MODE_BARE_USER,
|
||||
cancellable, error))
|
||||
{
|
||||
gs_shutil_rm_rf (repodir, cancellable, NULL);
|
||||
flatpak_rm_rf (repodir, cancellable, NULL);
|
||||
goto out;
|
||||
}
|
||||
|
||||
|
@ -955,7 +955,7 @@ flatpak_dir_remove_appstream (FlatpakDir *self,
|
|||
remote_dir = g_file_get_child (appstream_dir, remote);
|
||||
|
||||
if (g_file_query_exists (remote_dir, cancellable) &&
|
||||
!gs_shutil_rm_rf (remote_dir, cancellable, error))
|
||||
!flatpak_rm_rf (remote_dir, cancellable, error))
|
||||
return FALSE;
|
||||
|
||||
return TRUE;
|
||||
|
@ -1092,7 +1092,7 @@ flatpak_dir_deploy_appstream (FlatpakDir *self,
|
|||
g_strcmp0 (old_checksum, new_checksum) != 0)
|
||||
{
|
||||
old_checkout_dir = g_file_get_child (arch_dir, old_checksum);
|
||||
if (!gs_shutil_rm_rf (old_checkout_dir, cancellable, &tmp_error))
|
||||
if (!flatpak_rm_rf (old_checkout_dir, cancellable, &tmp_error))
|
||||
g_warning ("Unable to remove old appstream checkout: %s\n", tmp_error->message);
|
||||
}
|
||||
|
||||
|
@ -1175,9 +1175,8 @@ flatpak_dir_update_appstream (FlatpakDir *self,
|
|||
return FALSE;
|
||||
}
|
||||
|
||||
(void) glnx_shutil_rm_rf_at (AT_FDCWD,
|
||||
gs_file_get_path_cached (ostree_repo_get_path (child_repo)),
|
||||
NULL, NULL);
|
||||
(void) flatpak_rm_rf (ostree_repo_get_path (child_repo),
|
||||
NULL, NULL);
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
@ -2889,7 +2888,7 @@ flatpak_dir_deploy_install (FlatpakDir *self,
|
|||
|
||||
out:
|
||||
if (created_deploy_base && !ret)
|
||||
gs_shutil_rm_rf (deploy_base, cancellable, NULL);
|
||||
flatpak_rm_rf (deploy_base, cancellable, NULL);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
@ -3742,7 +3741,7 @@ flatpak_dir_undeploy (FlatpakDir *self,
|
|||
{
|
||||
GError *tmp_error = NULL;
|
||||
|
||||
if (!gs_shutil_rm_rf (removed_subdir, cancellable, &tmp_error))
|
||||
if (!flatpak_rm_rf (removed_subdir, cancellable, &tmp_error))
|
||||
{
|
||||
g_warning ("Unable to remove old checkout: %s\n", tmp_error->message);
|
||||
g_error_free (tmp_error);
|
||||
|
@ -3785,7 +3784,7 @@ flatpak_dir_undeploy_all (FlatpakDir *self,
|
|||
if (was_deployed)
|
||||
{
|
||||
g_debug ("removing deploy base");
|
||||
if (!gs_shutil_rm_rf (deploy_base, cancellable, error))
|
||||
if (!flatpak_rm_rf (deploy_base, cancellable, error))
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
|
@ -3865,7 +3864,7 @@ flatpak_dir_cleanup_removed (FlatpakDir *self,
|
|||
!dir_is_locked (child))
|
||||
{
|
||||
GError *tmp_error = NULL;
|
||||
if (!gs_shutil_rm_rf (child, cancellable, &tmp_error))
|
||||
if (!flatpak_rm_rf (child, cancellable, &tmp_error))
|
||||
{
|
||||
g_warning ("Unable to remove old checkout: %s\n", tmp_error->message);
|
||||
g_error_free (tmp_error);
|
||||
|
|
|
@ -1587,6 +1587,16 @@ flatpak_mkdir_p (GFile *dir,
|
|||
error);
|
||||
}
|
||||
|
||||
gboolean
|
||||
flatpak_rm_rf (GFile *dir,
|
||||
GCancellable *cancellable,
|
||||
GError **error)
|
||||
{
|
||||
return glnx_shutil_rm_rf_at (AT_FDCWD,
|
||||
gs_file_get_path_cached (dir),
|
||||
cancellable, error);
|
||||
}
|
||||
|
||||
gboolean
|
||||
flatpak_variant_save (GFile *dest,
|
||||
GVariant *variant,
|
||||
|
|
|
@ -278,6 +278,10 @@ gboolean flatpak_mkdir_p (GFile *dir,
|
|||
GCancellable *cancellable,
|
||||
GError **error);
|
||||
|
||||
gboolean flatpak_rm_rf (GFile *dir,
|
||||
GCancellable *cancellable,
|
||||
GError **error);
|
||||
|
||||
#define flatpak_autorm_rf _GLIB_CLEANUP (g_autoptr_cleanup_generic_gfree)
|
||||
|
||||
static inline void
|
||||
|
@ -287,7 +291,7 @@ flatpak_temp_dir_destroy (void *p)
|
|||
|
||||
if (dir)
|
||||
{
|
||||
gs_shutil_rm_rf (dir, NULL, NULL);
|
||||
flatpak_rm_rf (dir, NULL, NULL);
|
||||
g_object_unref (dir);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue