list, uninstall: Add simple output to two commands

Closes: https://github.com/flatpak/flatpak/issues/6197
This commit is contained in:
yu shuoqi
2025-08-06 18:26:51 +08:00
committed by Sebastian Wick
parent 98726a70ee
commit 51452a7bf5
2 changed files with 14 additions and 1 deletions

View File

@@ -67,6 +67,7 @@ print_documents (const char *app_id,
g_autoptr(FlatpakTablePrinter) printer = NULL;
g_autofree char *mountpoint = NULL;
gboolean need_perms = FALSE;
gboolean found_documents_to_print = FALSE;
int i;
if (columns[0].name == NULL)
@@ -148,11 +149,17 @@ print_documents (const char *app_id,
}
flatpak_table_printer_finish_row (printer);
found_documents_to_print = TRUE;
just_perms = TRUE;
} while (have_perms && g_variant_iter_next (iter2, "{&s^a&s}", &app_id2, &perms));
}
if (!found_documents_to_print)
{
g_print (_("No documents found\n"));
return TRUE;
}
flatpak_table_printer_print (printer);
return TRUE;

View File

@@ -561,6 +561,7 @@ flatpak_builtin_uninstall (int argc, char **argv, GCancellable *cancellable, GEr
g_autoptr(GFileEnumerator) enumerator = NULL;
g_autofree char *path = g_build_filename (g_get_home_dir (), ".var", "app", NULL);
g_autoptr(GFile) app_dir = g_file_new_for_path (path);
gboolean found_data_to_delete = FALSE;
enumerator = g_file_enumerate_children (app_dir,
G_FILE_ATTRIBUTE_STANDARD_NAME "," G_FILE_ATTRIBUTE_STANDARD_TYPE,
@@ -588,9 +589,14 @@ flatpak_builtin_uninstall (int argc, char **argv, GCancellable *cancellable, GEr
if (ref)
continue;
found_data_to_delete = TRUE;
if (!flatpak_delete_data (opt_yes, g_file_info_get_name (info), error))
return FALSE;
}
if (!found_data_to_delete)
g_print (_("No app data to delete\n"));
}
return TRUE;