diff options
author | Matthias Clasen <mclasen@redhat.com> | 2018-10-07 19:49:06 -0400 |
---|---|---|
committer | Alexander Larsson <alexander.larsson@gmail.com> | 2022-01-10 09:40:40 +0100 |
commit | 9e090b845a8668c9cb8d3f8ca77dea2ef205bad8 (patch) | |
tree | c5cef2570a3eb32d61330ab4cb93d923f7446ee5 | |
parent | 45c7f5071c5341ce895c3b90268d97d08b032820 (diff) | |
download | flatpak-9e090b845a8668c9cb8d3f8ca77dea2ef205bad8.tar.gz |
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
-rw-r--r-- | app/flatpak-builtins-document-unexport.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/app/flatpak-builtins-document-unexport.c b/app/flatpak-builtins-document-unexport.c index 0b108c82..402544ab 100644 --- a/app/flatpak-builtins-document-unexport.c +++ b/app/flatpak-builtins-document-unexport.c @@ -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) |