From 7ade0d07fea67d9494e47d5e575b17cf5be45356 Mon Sep 17 00:00:00 2001 From: Matthias Clasen Date: Sun, 23 Dec 2018 13:09:30 -0500 Subject: [PATCH] repair: Do some basic check for remotes We should point out if refs in the repo refer to missing or disabled remotes, this is useful information. Closes: #2473 Approved by: alexlarsson --- app/flatpak-builtins-repair.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/app/flatpak-builtins-repair.c b/app/flatpak-builtins-repair.c index e46ed5d0..8f169e43 100644 --- a/app/flatpak-builtins-repair.c +++ b/app/flatpak-builtins-repair.c @@ -396,6 +396,20 @@ flatpak_builtin_repair (int argc, char **argv, GCancellable *cancellable, GError } } + GLNX_HASH_TABLE_FOREACH_KV (all_refs, const char *, refspec, const char *, checksum) + { + g_autofree char *remote = NULL; + g_autofree char *ref_name = NULL; + + if (!ostree_parse_refspec (refspec, &remote, &ref_name, error)) + return FALSE; + + if (!flatpak_dir_has_remote (dir, remote, NULL)) + g_print (_("Remote %s for ref %s is missing\n"), remote, ref_name); + else if (flatpak_dir_get_remote_disabled (dir, remote)) + g_print (_("Remote %s for ref %s is disabled\n"), remote, ref_name); + } + if (opt_dry_run) return TRUE;