mirror of
https://github.com/flatpak/flatpak.git
synced 2026-05-19 06:11:47 -04:00
document-unexport: Allow unexporting by docid
If the backing document has been deleted, then looking up the doc-id fails. To work around this, allow specifying the doc-id directly. Closes: #1897
This commit is contained in:
committed by
Alexander Larsson
parent
45c7f5071c
commit
9e090b845a
@@ -37,7 +37,10 @@
|
||||
#include "flatpak-utils-private.h"
|
||||
#include "flatpak-run-private.h"
|
||||
|
||||
static gboolean opt_docid;
|
||||
|
||||
static GOptionEntry options[] = {
|
||||
{ "docid", 0, 0, G_OPTION_ARG_NONE, &opt_docid, N_("Specify the document ID"), NULL },
|
||||
{ NULL }
|
||||
};
|
||||
|
||||
@@ -79,7 +82,9 @@ flatpak_builtin_document_unexport (int argc, char **argv,
|
||||
if (documents == NULL)
|
||||
return FALSE;
|
||||
|
||||
if (!xdp_dbus_documents_call_lookup_sync (documents, file, &doc_id, NULL, error))
|
||||
if (opt_docid)
|
||||
doc_id = g_strdup (file);
|
||||
else if (!xdp_dbus_documents_call_lookup_sync (documents, file, &doc_id, NULL, error))
|
||||
return FALSE;
|
||||
|
||||
if (strcmp (doc_id, "") == 0)
|
||||
|
||||
Reference in New Issue
Block a user