1414 Commits

Author SHA1 Message Date
Alexander Larsson
c4d2d6f0a9 cli: Show branch in eol messages 2020-11-16 11:23:10 +01:00
Alexander Larsson
7eb5f4ddc8 cli-transaction: Better handling of EOL refs
We remember what action we took for EOLs, and for sub-refs (ie .Locale)
we reuse that.

Also, we show if eol:ed refs are pinned (as that makes them not be
auto-uninstalled), and we list the apps that use the eol:ed runtime
ref.

Example run:
```
Looking for updates…
Info: (pinned) org.gnome.Sdk.Compat.i386 is end-of-life, with reason:
   The GNOME 3.34 runtime is no longer supported as of 14th August 2020. Please ask your application developer to migrate to a supported platform.
Info: org.gnome.Platform is end-of-life, with reason:
   The GNOME 3.32 runtime is no longer supported as of 11th March 2020. Please ask your application developer to migrate to a supported platform.
Applications using this runtime:
   org.gnome.HexGL
```
2020-11-16 11:23:10 +01:00
Alexander Larsson
866d471d37 build-repo: Switch order of subset and options columns
The subset column is typically short, while for eol options the
options column can be very long. So, it makes more sense to have the
options at the end.
2020-11-14 11:12:28 +01:00
Alexander Larsson
60caa765de remote-list: Support showing the subset 2020-11-13 10:32:19 +01:00
Alexander Larsson
754e1fb5d4 Allow configuring the subset
This adds support to remote-add, remote-modify and the flatpakrepo file
parser.
2020-11-13 10:32:19 +01:00
Alexander Larsson
a679fd5787 remote-repo: Properly list subset info
We don't user subsummary names, but the highlevel summary names.
2020-11-13 10:32:19 +01:00
Alexander Larsson
bf5329aa69 table-printer: Add append_with_comma_unique
This means we can ensure a flag is only added once
2020-11-13 10:32:19 +01:00
Alexander Larsson
cbe8e8ca36 build-export: Support --subset to add subsets 2020-11-13 10:32:19 +01:00
Alexander Larsson
e4c52df63f build-commit-from: Remove leftover spew 2020-11-13 10:32:19 +01:00
Alexander Larsson
4f793a45c2 Remove some spammy debug spew
as_store_find_app() was constantly spewing things you don't really
need to see.
2020-11-10 14:32:13 +01:00
Alexander Larsson
b111965640 decomposed: Convert flatpak_dir_read/set_active() 2020-11-10 14:32:13 +01:00
Alexander Larsson
adb3b61f0a decomposed: Return FlatpakDecomposed from flatpak_dir_find_remote_ref() 2020-11-10 14:32:13 +01:00
Alexander Larsson
e633fe0d81 Remove last uses of flatpak_decompose_ref() 2020-11-10 14:32:13 +01:00
Alexander Larsson
1159004dc8 Add len argument to flatpak_decomposed_is_arches()
This allows this to be used both with strv (len=-1) and other arrays.
2020-11-10 14:32:13 +01:00
Alexander Larsson
c5b2c60609 decompose: Convert more FlatpakDir functions to use FlatpakDecomposed 2020-11-10 14:32:13 +01:00
Alexander Larsson
409fa1eafc decomposed: Use FlatpakDecomposed in flatpak_run_* 2020-11-10 14:32:13 +01:00
Alexander Larsson
3d8c04db50 CliTransaction: Use the FlatpakDecomposed from the transaction
There is no need to re-split the ref.
2020-11-10 14:32:13 +01:00
Alexander Larsson
8dc9318346 CliTransaction: Only print "partial" in the actual partial case
We used to match the ref id with .Locale and print "partial" in the
transaction status, but that is not right. Sometimes we do other refs
partially and sometimes locales are not partial. We now use the status
of the subpaths to do the right thing here.
2020-11-10 14:32:13 +01:00
Alexander Larsson
b6a1eb8d48 Delete some unused variables 2020-11-10 14:32:13 +01:00
Alexander Larsson
a988ee19d8 decompose: Use FlatpakDecomposed for bundles 2020-11-10 14:32:13 +01:00
Alexander Larsson
a3a2dcb2c5 decomposed: Remove _decomposed prefix on functions
We now converted most of these and removed the non-prefixed functions,
so rename them back.
2020-11-10 14:32:13 +01:00
Alexander Larsson
38a0706e76 decomposed: Return decomposed from find_installed_pref/ref 2020-11-10 14:32:13 +01:00
Alexander Larsson
d8ad979378 repair: Convert to decomposed 2020-11-10 14:32:13 +01:00
Alexander Larsson
6897b8e2ff decomposed: Take decomposed arg in flatpak_dir_load_deployed()
Then convert all callers
2020-11-10 14:32:13 +01:00
Alexander Larsson
48641c05f6 app utils: Add print_aligned_take()
This makes it easy to print a string that came from a strdup() like
return value.
2020-11-10 14:32:13 +01:00
Alexander Larsson
1fc8d540d5 uninstall: Use FlatpakDecomposed 2020-11-10 14:32:13 +01:00
Alexander Larsson
b77c337790 update: Convert to user FlatpakDecomposed 2020-11-10 14:32:13 +01:00
Alexander Larsson
eadf6147ae list: Use decomposed 2020-11-10 14:32:13 +01:00
Alexander Larsson
ee9507a81d remote-ls: Fix regression with -a
During the previous coversion we accidentally dropped
flatpak_make_valid_id_prefix() when getting the "parent"
id of a subid (like `foo.Locale`).
2020-11-10 14:32:13 +01:00
Alexander Larsson
fa1a494566 decomposed: Convert various "current ref" functions to use FlatpakDecomposed 2020-11-10 14:32:13 +01:00
Alexander Larsson
ed192e1044 remote-ls: Add a smarter fallback for names if appstream is missing
Rather than just taking the last element of the name we also
look at known extensions like .Platform, .Sdk, .Debug, .Locale, etc.
2020-11-05 10:43:10 +01:00
Alexander Larsson
e1da8d9455 remote-ls: Use list_decomposed() 2020-11-05 10:43:10 +01:00
Alexander Larsson
a60e2cbe2d Remove some unused variables 2020-10-29 15:30:35 +01:00
Alexander Larsson
7483a98769 utils: Allow passing sizes to more utils
These now take (optional) string length args:
  flatpak_id_has_subref_suffix()
  flatpak_levenshtein_distance()
  flatpak_is_valid_name()
  flatpak_is_valid_branch()
2020-10-29 15:30:35 +01:00
Alexander Larsson
f147df908a repo: Support indexed summaries in existing code and add new support
If indexes are available we now use those. Also we now allow listing
subsummaries and filtering by subset prefix.
2020-10-29 15:30:35 +01:00
Alexander Larsson
caa1c8c839 table printer: Add some helpers
Allow looking up pre-existing rows (by key) and appending to existing
cells.
2020-10-29 15:30:35 +01:00
Alexander Larsson
0221f5a1fa summaries: Ensure we can support non-default arches W/ indexed summaries
We need to load the ensure the right arch whenever we need it.

Also this restructures the RemoteState handling a bit in general so that
we avoid loading the same remote state multiple times when converting
partial refs to full refs.
2020-10-29 15:30:35 +01:00
Alexander Larsson
0d2cf085af Add option to disable generating summary index
This is mainly useful for the tests
2020-10-29 15:30:35 +01:00
Alexander Larsson
096daf91f2 summary: Implement a new, more efficient, summary format
This drops the deltas from the summary and uses the per-commit
metadata field to add the cache data to avoid the need for the separate
xa.cache and xa.sparse-cache indexes. This way we avoid repeating the
refs in multiple places.

Nothing uses this format yet, but we still pass make check if we enable
it.
2020-10-29 15:30:35 +01:00
Alexander Larsson
97fa217072 build-commit-from: Add --subset option
This sets the xa.subsets property on the commit, which we will later
use to create subsets of the repo.
2020-10-29 15:30:35 +01:00
Alexander Larsson
aec1f62f8f CLI: Ask for transaction confirmation before authentication
If possible, ask for confirmation of the entire transaction before
starting to do the per-ref authentication. We do this by splitting
the current "ready" callback into two parts, one in ready-pre-auth
and the rest in ready.

There is some complexity added because if we do any authentication
between the two signals we can't back-patch the transaction list we
already printed. To handle this we detect this case and re-print the
table if this happens.
2020-10-09 16:57:57 +02:00
Ryan Gonzalez
719eeee461 build-init/finish: Validate extension names
Otherwise, it becomes easy to accidentally create extensions with
invalid names. Ref #3887.
2020-10-08 09:46:49 +02:00
Ryan Gonzalez
9959fd80e9 repair: Add basic and "fancy" verify progress
This change makes repair print the current ref number being verified
and the total number, that way the user can observe the repair progress.
In addition, if fancy output is not disabled, the progress will be
cleanly printed on a single line.

On a dry run, this also will still print the delete messages without
actually performing the operations, to show what actions would be
taken on a non-dry-run.
2020-10-08 09:17:28 +02:00
Alexander Larsson
a5d86b8acb transaction: inject eol status to flatpak_dir_list_unused_refs()
This way we can get the proper eol status for the new to-be-installed
refs, rather than whatever was previously installed. This allows us to
detect when a runtime is updated and the new one is eol, and nothing
uses it, so it can be auto-uninstalled.
2020-10-08 09:14:51 +02:00
Alexander Larsson
05a7bda140 transaction: Simplify add_uninstall_unused_ops()
Rather than trying to figure out which runtimes are affected byt
the current setup of ops we run flatpak_dir_list_unused_refs() twice,
once with and once without the changes the transaction will cause.

Any unused refs after the transaction that were not unused before are
caused by the transaction and we start uninstall ops for those.

Also rename flatpak_dir_list_unused_refs_with_options() to
flatpak_dir_list_unused_refs() as it need not be so long.
2020-10-08 09:14:51 +02:00
Alexander Larsson
e83180e040 install: Add --no-auto-pin option
We want to use this for the test when we test the list unused refs
functions.
2020-10-08 09:14:51 +02:00
Phaedrus Leeds
7691fc77eb app: Remove EOL unused runtimes in update command
In case a runtime becomes unused and then later becomes End-Of-Life, it
is currently not removed. So this commit removes such runtimes in the
update command, as discussed in #2639. A unit test is included.

I am planning to propose to use the FlatpakTransaction API added here in
gnome-software, so that users don't have to use the CLI at all for
runtimes to be cleaned up. KDE Discover already removes unused runtimes
periodically.
2020-10-08 09:14:51 +02:00
Alexander Larsson
aa55d0088f uninstall: Use flatpak_dir_list_unused_refs_with_options()
No need to use the FlatpakInstallation version, because we just
needs the refs as strings, not FlatpakInstalledRef:s
2020-10-08 09:14:51 +02:00
Phaedrus Leeds
55f6abe578 Avoid string duplication in FlatpakRef
Allocate a full ref string once per object rather than once per call.
This is similar to what we do in flatpak_dir_get_name_cached().
2020-10-02 15:30:58 +02:00
Phaedrus Leeds
d7c481aff8 build-commit-from: Fix whitespace 2020-09-15 08:58:49 +02:00