summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* dir: Verify subsummary checksum from disk cachedouble-verify-summary-checksumPhaedrus Leeds2021-11-161-5/+34
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Currently we verify the checksum of indexed summary files (which have .sub file names) before writing them to the on-disk cache, so in theory as long as the disk I/O is successful the data integrity should be intact when we use it via the flatpak-variant-impl-private.h helpers generated by variant-schema-compiler. However in practice people sometimes hit assertion failures which are what you would expect to see if the data is corrupt, since GVariant stores some metadata such as the "offset size" toward the end of the data, and if we read this from serialized user data instead it will obviously be incorrect. In one case I was able to acquire the flathub.idx, flathub.idx.sig, and flathub-x86_64-fad08cfb10713e749f02a0e894b5d577b7e9c4931fdf9d2fdc50364c002bc925.sub files which reproduce one of the assertion failures, and the sub file appears to be incomplete, like the writing of it was interrupted. We use g_file_replace_contents() when saving these to the disk, and when not replacing an existing file that function writes directly to the final filename, so if interrupted it would be expected to leave an incomplete file. This commit changes the summary file handling so that we verify the checksum of any indexed subsummary again after reading it from disk. If it doesn't match we delete the on-disk cache and try fetching from the network. Fixes #4127
* Merge pull request #4583 from flatpak/make-test-logs-prettierPhaedrus Leeds2021-11-162-7/+11
|\ | | | | Make test suite logs prettier
| * Make test suite logs prettierPhaedrus Leeds2021-11-162-7/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | This fixes a few issues with the unit test logs that make them ugly: 1. Currently some lines of output from a command will appear after the line from xtrace which has the next command, since the command was printing to stdout and xtrace uses stderr. E.g. "Installation complete." will appear after "+ flatpak --user install -y ..." but it is from the previous install command. 2. Lines of output have many spaces after them to pad them to the table width but this is not needed for non-fancy output. 3. Lines of output are mixed with output from httpd since they don't end with a newline character, e.g. "Installing… ▊ 4%127.0.0.1 - - [16/Nov/2021 00:18:24] "GET /..."
* | tests: Use ${FLATPAK} not flatpakPhaedrus Leeds2021-11-163-16/+16
|/ | | | | This way the flatpak command is more consistently run under valgrind when that is enabled.
* Merge pull request #4574 from gostsdmitry/patch-2Phaedrus Leeds2021-11-151-39/+39
|\ | | | | Update hi.po
| * Update hi.poDmitry2021-11-151-39/+39
| |
* | Merge pull request #4520 from flatpak/fix-4200-configure-polkit-prompt-option-2Phaedrus Leeds2021-11-155-49/+63
|\ \ | | | | | | Change how automatic pinning is implemented (option 2)
| * | Change how automatic pinning is implementedPhaedrus Leeds2021-11-155-49/+63
|/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This commit re-works how we automatically "pin" runtimes that are explicitly installed, to prevent them from being removed automatically. In this implementation we do the update to the config as part of the deploy, which has the following advantages: (1) It ensures that there's never a confusing polkit prompt about configuring the software installation when the user asked for a runtime to be installed (https://github.com/flatpak/flatpak/issues/4200) (2) It means we don't have to rely on the code on the error path of flatpak_transaction_real_run() to un-pin the runtime in case something went wrong with the installation, since we pin it almost atomically with the deploy. Fixes #4200
* | Don't use app title from flatpakref as remote titlePhaedrus Leeds2021-11-153-12/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | On two different code paths we were using the "Title" field in flatpakref files as the title of a remote, which is incorrect. In most cases, the remote added via the RuntimeRepo key will be the same as the remote the app is from, so when the remote is added for the runtime, its title will be correctly set using the Title value from the flatpakrepo file and the app will therefore have an origin remote with a title set. This is not currently true for flatpakref files that use SuggestRemoteName=, see https://github.com/flatpak/flatpak/pull/4513 For flatpakref files that use a different remote than the RuntimeRepo, we don't currently have a way for the title to be set automatically; perhaps we should (https://github.com/flatpak/flatpak/issues/4512). Fixes https://github.com/flatpak/flatpak/issues/4499
* | tests: Test appdata installationGuido Günther2021-11-152-3/+6
| | | | | | | | Signed-off-by: Guido Günther <agx@sigxcpu.org>
* | build-finish: Export appstream metainfo into a single directoryGuido Günther2021-11-153-0/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | This is similar to what is done for desktop files and allows applications to use a flatpak's metainfo to retrieve e.g. required input controllers or the supported screen sizes. Similar to what can be done for non-flatpak'ed apps by looking at /usr/share/{metainfo,appdata}. Since flatpak moves the metadata from metainfo/ to appdata/ during build we only need to export files from that single directory. Signed-off-by: Guido Günther <agx@sigxcpu.org>
* | transaction: Utilize runtime repo info for origin remotePhaedrus Leeds2021-11-155-65/+120
| | | | | | | | | | | | | | | | | | | | | | | | | | Many of the fields allowed in flatpakrepo files are not allowed in flatpakref files, e.g. Comment, Description, Homepage, etc. So there is no straightforward way to ensure those are set correctly when the user installs something with a flatpakref file. However in most cases the repo specified by the RuntimeRepo key is also the repo providing the main ref, so in those cases it makes sense to utilize all the metadata provided in the flatpakrepo file when creating a remote to provide updates for the app being installed. We were already doing this when the SuggestRemoteName key was unset; this commit makes it so that we utilize that metadata also when SuggestRemoteName is present.
* | Ensure refs are updated from their originPhaedrus Leeds2021-11-155-20/+154
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | It can happen that a related ref is installed from a different remote than the thing it's related to. We always want to update things from their origin remote. However as of now FlatpakTransaction resolves the commit of a related ref to the one available from the main ref origin, and later sets the remote for the operation to the installed origin (see commit 6793d90b8). In case there is a newer commit in the main ref origin than the installed origin, this leads to an update operation being erroneously created, only to then error out with an HTTP 404 error, because the commit from the main ref origin is being pulled from the installed ref origin. For specific steps to reproduce see https://github.com/flatpak/flatpak/issues/3128#issuecomment-948948040 So, ensure that when a FLATPAK_TRANSACTION_OPERATION_INSTALL_OR_UPDATE operation is created for something that's installed, whether it's a related ref or something else, the remote used is always the origin. And ensure that the remote is set correctly before the stage where the op is resolved to a commit, to avoid the situation described above. This is essentially a re-implementation of the fix in commit 6793d90b8. Also, add a unit test for this behavior. This commit also makes a few changes to documentation to make it clear that this related-ref-different-origin situation is possible. Fixes #3128
* | app: Fix behavior when installing end-of-life-rebased refPhaedrus Leeds2021-11-152-5/+32
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Currently if the user specifies a ref to install that has been renamed via the end-of-life-rebased mechanism, for example "flatpak install com.visualstudio.code.oss", Flatpak erroneously tries to install both the old and new versions of the app. This happens because the code handling end-of-life-rebase conditions is written assuming the rebased app is being updated rather than installed for the first time. Specifically, in FlatpakCliTransaction and FlatpakQuietTransaction, in end_of_lifed_with_rebase(), we treat a failure of flatpak_transaction_add_uninstall() as fatal and return FALSE from the signal handler, which means that the install operation that triggered the signal will not be skipped (see the docs for FlatpakTransaction::end-of-lifed-with-rebase). So, instead check for the FLATPAK_ERROR_NOT_INSTALLED error code and ignore it, so that the installation of the old version of the renamed app will be properly cancelled. Fixes https://github.com/flatpak/flatpak/issues/3754
* | Re-enable HTTP compressionPatrick Griffis2021-11-151-1/+3
| | | | | | | | | | | | | | | | | | The original commit (9865ed8989befe9653fb3cd919fb5518b09274d2) disabling it claimed it fixed OCI downloads. This no longer seems to be a problem. This has also exposed new bugs as some servers will send gzip compressed data when the client does not send Accept-Encoding. If we leave this enabled that issue goes away.
* | tests: Assert that XDG_foo_HOME directories are all createdSimon McVittie2021-11-151-0/+4
| | | | | | | | Signed-off-by: Simon McVittie <smcv@collabora.com>
* | run: Always create .local/state directorySimon McVittie2021-11-151-0/+4
| | | | | | | | | | | | | | This is placed at the same location that would be used by the --persist=.local/state option. Signed-off-by: Simon McVittie <smcv@collabora.com>
* | tests: Check that we handle XDG_foo_HOME as intendedSimon McVittie2021-11-151-1/+35
| | | | | | | | Signed-off-by: Simon McVittie <smcv@collabora.com>
* | doc: Mention how to get a compatible ~/.local/state with older versionsSimon McVittie2021-11-151-0/+6
| | | | | | | | Signed-off-by: Simon McVittie <smcv@collabora.com>
* | doc: Mention that setting XDG_STATE_HOME is a new featureSimon McVittie2021-11-151-2/+2
| | | | | | | | Signed-off-by: Simon McVittie <smcv@collabora.com>
* | run: Mention why we're using .local/stateSimon McVittie2021-11-151-0/+3
| | | | | | | | Signed-off-by: Simon McVittie <smcv@collabora.com>
* | Add XDG_STATE_HOME and HOST_XDG_STATE_HOME env variablesLionir2021-11-155-0/+21
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This gives new support for the new XDG_STATE_HOME addition to XDG_BASE_DIRS which allows applications to use this without breaking because they would assume $HOME/.local/state which may be unavailable to the flatpak This adds it as .local/state as to make --persist=.local/state the same behaviour as in new flatpak. This in turn means that the transition should be seamless between old and new flatpak. This also has the benefit of working if the application doesn't follow XDG spec thanks to --persist=.local/state. This fixes https://github.com/flatpak/flatpak/issues/4477 [smcv: Don't call nonexistent g_get_user_state_dir(); fix a reference to XDG_STATE_DIR]
* | build-update-repo: Don't try to generate deltas of unknown refsPhaedrus Leeds2021-11-151-1/+1
| | | | | | | | | | Spotted this by code inspection. Ignoring such refs was clearly the intended behavior based on the comment.
* | Add a profile script for FishRyan Gonzalez2021-11-152-0/+21
| | | | | | | | | | | | | | | | | | | | Technically, Fish users can already make this work using https://github.com/edc/bass, but it's also nice to have this working on an out-of-the-box Flatpak installation. Fixes #3109. Signed-off-by: Ryan Gonzalez <ryan.gonzalez@collabora.com>
* | app: Don't use carriage return for non-fancy outputPhaedrus Leeds2021-11-151-5/+5
| | | | | | | | | | | | | | | | | | flatpak_fancy_output() determines whether the output we write is intended for e.g. a tty or e.g. a log file, the latter being "not fancy". Currently we write carriage return characters in the not fancy case, but change that to new lines, which are interpreted correctly by editors such as vim (whereas a carriage return shows up as ^M since it is not the correct newline character on Unixy operating systems).
* | transaction: Fix signal Since annotationsPhaedrus Leeds2021-11-151-1/+5
| |
* | search: Use <bundle> ID to determine flatpak app IDPhaedrus Leeds2021-11-151-16/+28
| | | | | | | | | | | | The <bundle> element in the appstream data unambiguously provides the full four-part flatpak ref, so use it to determine the app ID. But fall back to using the <id> element, since that is required to be present.
* | search: Don't strip .desktop suffix overzealouslyPhaedrus Leeds2021-11-151-2/+29
| | | | | | | | | | | | | | | | This commit changes the search command to properly output the app ID for IDs that end in .desktop, e.g. to print org.telegram.desktop rather than org.telegram. Fixes https://github.com/flatpak/flatpak/issues/4535
* | dir: Fix an issue with fetch_remote_ref_sync()Phaedrus Leeds2021-11-151-2/+6
|/ | | | | | | | | | | | | | | This commit is a follow-up to "Fix implementation of xa.noenumerate remote option" since that turned out to break flatpak_installation_fetch_remote_ref_sync() in some cases. I didn't see it at the time, but flatpak_decomposed_get_collection_id() explains that the collection ID shouldn't be set on FlatpakDecomposed objects, even when the remote has a collection ID set, unless they are being used to enumerate refs from a file:// URI rather than a configured remote. So this commit changes list_remote_refs() and list_all_remote_refs() to keep the xa.noenumerate implementation working and to get fetch_remote_ref_sync() working again (since the latter uses flatpak_decomposed_new_from_parts() and thus doesn't set a collection ID on the FlatpakDecomposed object used for comparison).
* dir: Fix typos in a warningPhaedrus Leeds2021-11-121-1/+1
|
* run: Document shortcomings of PulseAudio server string parsingWill Thompson2021-11-111-0/+6
| | | | These are just based on a cursory reading of the spec.
* run: Add link to PulseAudio server string documentationWill Thompson2021-11-111-0/+5
|
* run: Support PulseAudio socket path without unix: prefixWill Thompson2021-11-111-0/+3
| | | | | | | | | | | | | | https://www.freedesktop.org/wiki/Software/PulseAudio/Documentation/User/ServerStrings/ says: > If the string starts with / or unix: the remaining address string is taken as > UNIX socket name. but previously the string was only taken to be a UNIX socket name if it began with "unix:". This is an issue in practice with WSLg <https://github.com/microsoft/wslg> which sets $PULSE_SERVER to "/mnt/wslg/PulseServer", without a "unix:" prefix.
* Merge pull request #4563 from gostsdmitry/patch-1Phaedrus Leeds2021-11-111-18/+19
|\ | | | | Update hi.po
| * Update hi.poDmitry2021-11-111-18/+19
|/
* Merge pull request #4560 from gostsdmitry/patch-1Phaedrus Leeds2021-11-101-18/+15
|\ | | | | Update hi.po
| * Update hi.poDmitry2021-11-111-18/+15
|/ | | | Fixing errors and correcting them. Correction of translation for the interface.
* SECURITY.md: Update supported branchesPhaedrus Leeds2021-11-101-5/+5
|
* Merge pull request #4556 from flatpak/drop-superfluous-cflagsPhaedrus Leeds2021-11-091-3/+3
|\ | | | | tests: Drop some unneeded CFLAGS/LDADD
| * tests: Drop some unneeded CFLAGS/LDADDPhaedrus Leeds2021-11-091-3/+3
|/
* Merge pull request #4555 from gostsdmitry/patch-1Phaedrus Leeds2021-11-091-11/+11
|\ | | | | Update hi.po
| * Update hi.poDmitry2021-11-101-11/+11
|/ | | Corrections.
* Merge pull request #4553 from gostsdmitry/patch-1Phaedrus Leeds2021-11-091-8/+3
|\ | | | | Update hi.po
| * Update hi.poDmitry2021-11-091-8/+3
|/ | | Minor fixes
* Merge pull request #4548 from flatpak/hi-translationPhaedrus Leeds2021-11-082-0/+5726
|\ | | | | Add Hindi translation
| * Add Hindi translationhi-translationgostsdmitry2021-11-082-0/+5726
|/
* Merge pull request #4546 from flatpak/issue-template-mention-flathub-reposPhaedrus Leeds2021-11-081-0/+2
|\ | | | | Add checkbox to issue template
| * Add checkbox to issue templateissue-template-mention-flathub-reposPhaedrus Leeds2021-11-081-0/+2
|/
* dir: Fix a return of FALSE rather than NULLPhaedrus Leeds2021-11-051-1/+1
|
* Merge pull request #4487 from flatpak/dont-mask-noenumerate-main-refsPhilip Withnall2021-11-022-18/+312
|\ | | | | dir: Don't mask the main ref of a noenumerate remote