summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* tests: Add some tests for subsummariesscalable-repoAlexander Larsson2020-10-294-0/+263
|
* summaries: Cache subsummaries per-archAlexander Larsson2020-10-293-56/+72
| | | | | | | | | | | | | | | | | We store the cached subsummaries as `$remote-$arch-digest.sub`, this way we can prune everything but the most recent (i.e. highest mtime) rather than looking at the index. This way we don't prune old subsummaries for other arches when we update one arch, which would not let us use deltas for those. Some details: * If mtimes are identical (mtime precision issue) for several subsummaries we keep all. * If we just saved a subsummary in the cache we don't prune that in case there is something wonky with mtimes. The subsets for a remote are pruned every time we write a new cached subsummary.
* CI: Build ostree from git (needed for new summary format)Alexander Larsson2020-10-281-4/+40
|
* Remove some unused variablesAlexander Larsson2020-10-282-2/+0
|
* Use the new FlatpakDecomposed when mathing refsAlexander Larsson2020-10-282-138/+234
| | | | This avoids lots of re-splitting and re-validation as well as strdups.
* utils: Add FlatpakDecomposed helperAlexander Larsson2020-10-283-1/+620
| | | | | | This is a ref-counted version of a ref string that is guaranteed to be in the proper form, and is pre-decomposed for efficient partial matches.
* utils: Allow passing sizes to more utilsAlexander Larsson2020-10-2818-65/+116
| | | | | | | | These now take (optional) string length args: flatpak_id_has_subref_suffix() flatpak_levenshtein_distance() flatpak_is_valid_name() flatpak_is_valid_branch()
* repo: Support indexed summaries in existing code and add new supportAlexander Larsson2020-10-271-20/+242
| | | | | If indexes are available we now use those. Also we now allow listing subsummaries and filtering by subset prefix.
* Export flatpak_repo_load_summary_index() and ↵Alexander Larsson2020-10-272-2/+7
| | | | flatpak_repo_load_digested_summary()
* table printer: Add some helpersAlexander Larsson2020-10-272-5/+71
| | | | | Allow looking up pre-existing rows (by key) and appending to existing cells.
* summaries: Support using summary deltas on clientAlexander Larsson2020-10-275-23/+193
| | | | Also prune old unreferenced subsummaries on each transaction.
* summaries: Generate summary deltas when updating repoAlexander Larsson2020-10-273-30/+817
|
* summaries: Ensure we can support non-default arches W/ indexed summariesAlexander Larsson2020-10-268-87/+216
| | | | | | | | 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.
* summaries: Rework the debug spew for summary/cache loadingAlexander Larsson2020-10-261-7/+15
| | | | This way its easier to tell exactly what happens.
* dir: Make flatpak_transaction_ensure_remote_state non-staticAlexander Larsson2020-10-262-1/+6
| | | | | | This moves it to fatpak-transaction-private.h so that we can use it internally to be able to re-use the remote-states from the transaction outside it.
* tests: Test stuff with the old (non-indexed) summary format tooAlexander Larsson2020-10-265-6/+25
|
* Add option to disable generating summary indexAlexander Larsson2020-10-266-51/+118
| | | | This is mainly useful for the tests
* summary: Enable use of indexed summaries in the clientAlexander Larsson2020-10-264-71/+709
| | | | We first try to download the index, then fall back to the old format.
* build-update-repo: Generate new summary formatAlexander Larsson2020-10-263-137/+578
| | | | | | | | | | In addition to the old summary file we create a summary.idx and a set of per-arch subsummaries (and extra copies of these if any commit specify a subset). These are much smaller, and eventually we will also get deltas for them. We are not yet using these new formats, although the code is there to use them once we start downloading them.
* summary: Implement a new, more efficient, summary formatAlexander Larsson2020-10-265-179/+336
| | | | | | | | | | 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.
* utils: Expose get_compat_arch_reverse() and get_arch_for_ref()Alexander Larsson2020-10-262-2/+4
| | | | We need to use these from some other files too.
* summary: Extract the summary generation code to helperAlexander Larsson2020-10-261-50/+69
|
* summaries: Add support for limiting which arches end up in summaryAlexander Larsson2020-10-261-11/+81
| | | | | This is in preparation for adding other formats for summary and we might not want all the arches in the fallback summary format.
* utils: Reimplement summary generationAlexander Larsson2020-10-261-223/+340
| | | | | | This moves the generation of the summary files completely into flatpak allowing us to (later) customise what goes into it in more detail and generate other forms of summaries.
* Bump ostree requirement to 2020.8 for the new summary featuresAlexander Larsson2020-10-261-1/+1
|
* Add flatpak_dir_get_remote_subset()Alexander Larsson2020-10-232-0/+16
| | | | Reads the subset config for the remote, if any.
* build-commit-from: Add --subset optionAlexander Larsson2020-10-231-0/+39
| | | | | This sets the xa.subsets property on the commit, which we will later use to create subsets of the repo.
* tests: Silence assert_remote_has_no_configAlexander Larsson2020-10-231-1/+1
| | | | | This is meant to fail, so redirect its stderr to get less confusing test logs.
* tests: Fix unnecessary rebuilds of the test platformAlexander Larsson2020-10-232-1/+2
| | | | | | The code to use the pre-generated test platform was buggy so it wasn't used. Also, generate a "stable" branch of it too as that is used by test-run.sh.
* tests: Better logging of which tests are succeedingAlexander Larsson2020-10-231-1/+1
| | | | This makes it easier to spot where things go wrong in the logs.
* tests: Use "flatpak build-update-repo" instead of ostree summary -uAlexander Larsson2020-10-231-2/+2
| | | | | As we tweak the summary generation code we want to use our code, not the ostree one.
* tests: Convert some flatpak calls to $FLATPAKAlexander Larsson2020-10-231-5/+5
| | | | This allows these to run under valgrind when testing in valgrind.
* Add --enable-internal-checks option and use in CIAlexander Larsson2020-10-233-2/+18
| | | | This enables the internal checks in the generated variant parser.
* Update to latest variant-schema-compiler with some fixesAlexander Larsson2020-10-231-0/+0
|
* Merge pull request #3906 from smcv/wip/tolerate-no-accountsservicePhilip Withnall2020-10-152-0/+14
|\ | | | | parental controls: Fail open if accountsservice is missing
| * Skip parental controls checks on ServiceUnknown or NameHasNoOwnerSimon McVittie2020-10-152-0/+14
|/ | | | | | | | | | | | | | If accountsservice isn't available on the system bus, then we can't ask it for the user's parental controls settings, and we also can't ask it whether it even has the malcontent extension. Since this is not a real security boundary, fail open. This can be dropped if we depend on a version of libmalcontent that maps these errors to MCT_APP_FILTER_ERROR_DISABLED. Resolves: https://github.com/flatpak/flatpak/issues/3902 Bug-Debian: https://bugs.debian.org/972138 Signed-off-by: Simon McVittie <smcv@collabora.com>
* http: Return HOST_UNREACHABLE on error 500Philip Withnall2020-10-121-0/+5
| | | | | | | | | | | | | | | | | Sometimes a server might return a HTTP error 500 (this seems to happen sometimes with Microsoft’s VSCode server, for example). Map this to `G_IO_ERROR_HOST_UNREACHABLE` for now, which is a bit more specific than returning `G_IO_ERROR_FAILED`, but without the hassle of introducing a new public error domain which could give more detail. In particular, this should allow gnome-software to show an error message to the user for such failed downloads, rather than hiding the error and logging the following: ``` not handling error failed for action download: While downloading http://packages.microsoft.com/repos/vscode/pool/main/c/code/code_1.45.1-1589445302_amd64.deb: Server returned status 500: Internal Server Error ``` Signed-off-by: Philip Withnall <pwithnall@endlessos.org>
* Update Ukrainian translationYuri Chornoivan2020-10-121-367/+408
|
* oci-authenticator: Fix crash if anon auth fails and no_interaction is setAlexander Larsson2020-10-091-7/+7
| | | | | | We were clearing the error from the anon test, and then not doing any non-anon auth, so error was NULL, causing a crash when returning an error message.
* transaction: Fix error handling in authentication failuresAlexander Larsson2020-10-091-1/+1
| | | | | We were not correctly returning in case of error, which caused a cascading "owerwrite gerror" problem.
* CLI: Ask for transaction confirmation before authenticationAlexander Larsson2020-10-091-1/+42
| | | | | | | | | | | | 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.
* libflatpak: Report available updates for password-protected refs too.Alexander Larsson2020-10-091-1/+1
| | | | | | flatpak_installation_list_installed_refs_for_update() now uses the ready-pre-auth signal instead of the ready signal. This means we will report updates even for refs that require authentication to install.
* Transaction: Add ready-pre-auth signalAlexander Larsson2020-10-092-12/+79
| | | | | | | | | | | | | | | | | This is similar to the ready signal, except it is called before per-ref authentication. Apps can use this if they want to be able to ask for user input on progress before asking for authentication. This is nice to be able to do in general, but it is also required for the implementation of flatpak_installation_list_installed_refs_for_update(), as it doesn't install any authentication handler, so it will never report updates for protected refs if using the ready signal. Note: In special cases we will require authentication even earlier if authenticating is needed during the resolve operation. This happens for instance if you are doing a update to a particular commit (rather than the lastest commit) where we need to get the commit object directly.
* transaction: Don't crash on invalid ref namesRyan Gonzalez2020-10-081-8/+31
| | | | | | | | | | It is very much possible for an invalid ref name to occur, either due to lack of validation on Flatpak creation like #3887, or just any manually-written ref name due to skipping Flatpak tooling or malicious intent. Regardless, this shouldn't crash, so check the names before creating the transaction ops. Fixes #3887.
* build-init/finish: Validate extension namesRyan Gonzalez2020-10-082-0/+9
| | | | | Otherwise, it becomes easy to accidentally create extensions with invalid names. Ref #3887.
* repair: Add basic and "fancy" verify progressRyan Gonzalez2020-10-081-3/+25
| | | | | | | | | | | 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.
* common: Fix docs for FLATPAK_QUERY_FLAGS_ONLY_SIDELOADEDPhaedrus Leeds2020-10-081-1/+2
|
* Fix some clang errorsAlexander Larsson2020-10-082-4/+1
|
* transaction: inject eol status to flatpak_dir_list_unused_refs()Alexander Larsson2020-10-086-12/+31
| | | | | | | 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.
* transaction: Simplify add_uninstall_unused_ops()Alexander Larsson2020-10-086-290/+80
| | | | | | | | | | | | 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.