diff options
| author | Phaedrus Leeds <mwleeds@protonmail.com> | 2021-10-28 12:37:51 -0700 |
|---|---|---|
| committer | Simon McVittie <smcv@debian.org> | 2022-02-08 18:57:25 +0000 |
| commit | caae698495b160d1330d9d35e2b9a544b78d07cf (patch) | |
| tree | f67f9f0bd635e55346af03999f4a81c13382bf9a | |
| parent | 5e4e8c6e4ba65d2d52e986a0604782eb5ee6a95f (diff) | |
| download | flatpak-caae698495b160d1330d9d35e2b9a544b78d07cf.tar.gz | |
history: Fix exclusion of temp repos
Without this change there are history entries showing pulls into
temporary repos which we don't want.
(cherry picked from commit 2f13aabad6d9ac1aea9af5f7bf94abf4fbbc679a)
| -rw-r--r-- | app/flatpak-builtins-history.c | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/app/flatpak-builtins-history.c b/app/flatpak-builtins-history.c index b4ccd5ac..7786a626 100644 --- a/app/flatpak-builtins-history.c +++ b/app/flatpak-builtins-history.c @@ -161,6 +161,7 @@ print_history (GPtrArray *dirs, (!reverse && sd_journal_next (j) > 0)) { g_autofree char *ref_str = NULL; + g_autofree char *remote = NULL; /* determine whether to skip this entry */ @@ -174,14 +175,19 @@ print_history (GPtrArray *dirs, if (ref_str && ref_str[0] && g_str_has_prefix (ref_str, "appstream")) continue; + remote = get_field (j, "REMOTE", error); + if (*error) + return FALSE; + + /* Exclude pull to temp repo */ + if (remote && remote[0] == '/') + continue; + if (dirs) { gboolean include = FALSE; g_autofree char *installation = get_field (j, "INSTALLATION", NULL); - if (installation && installation[0] == '/') - include = TRUE; /* pull to a temp repo */ - for (i = 0; i < dirs->len && !include; i++) { g_autofree char *name = flatpak_dir_get_name (dirs->pdata[i]); @@ -268,9 +274,6 @@ print_history (GPtrArray *dirs, } else if (strcmp (columns[k].name, "remote") == 0) { - g_autofree char *remote = get_field (j, "REMOTE", error); - if (*error) - return FALSE; flatpak_table_printer_add_column (printer, remote); } else if (strcmp (columns[k].name, "commit") == 0) |
