| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
| |
|
| |
|
|
|
|
| |
This avoids lots of re-splitting and re-validation as well as strdups.
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
|
| |
These now take (optional) string length args:
flatpak_id_has_subref_suffix()
flatpak_levenshtein_distance()
flatpak_is_valid_name()
flatpak_is_valid_branch()
|
|
|
|
|
| |
If indexes are available we now use those. Also we now allow listing
subsummaries and filtering by subset prefix.
|
|
|
|
| |
flatpak_repo_load_digested_summary()
|
|
|
|
|
| |
Allow looking up pre-existing rows (by key) and appending to existing
cells.
|
|
|
|
| |
Also prune old unreferenced subsummaries on each transaction.
|
| |
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
| |
This way its easier to tell exactly what happens.
|
|
|
|
|
|
| |
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.
|
| |
|
|
|
|
| |
This is mainly useful for the tests
|
|
|
|
| |
We first try to download the index, then fall back to the old format.
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
| |
We need to use these from some other files too.
|
| |
|
|
|
|
|
| |
This is in preparation for adding other formats for summary and we
might not want all the arches in the fallback summary format.
|
|
|
|
|
|
| |
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.
|
| |
|
|
|
|
| |
Reads the subset config for the remote, if any.
|
|
|
|
|
| |
This sets the xa.subsets property on the commit, which we will later
use to create subsets of the repo.
|
|
|
|
|
| |
This is meant to fail, so redirect its stderr to get less confusing test
logs.
|
|
|
|
|
|
| |
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.
|
|
|
|
| |
This makes it easier to spot where things go wrong in the logs.
|
|
|
|
|
| |
As we tweak the summary generation code we want to use our code, not
the ostree one.
|
|
|
|
| |
This allows these to run under valgrind when testing in valgrind.
|
|
|
|
| |
This enables the internal checks in the generated variant parser.
|
| |
|
|\
| |
| | |
parental controls: Fail open if accountsservice is missing
|
|/
|
|
|
|
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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>
|
| |
|
|
|
|
|
|
| |
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.
|
|
|
|
|
| |
We were not correctly returning in case of error, which caused
a cascading "owerwrite gerror" problem.
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
| |
Otherwise, it becomes easy to accidentally create extensions with
invalid names. Ref #3887.
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
| |
|
| |
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|