Commit Graph

5651 Commits

Author SHA1 Message Date
Alexander Larsson
68706eca21 Bump version to 1.6.3 2020-03-30 15:50:20 +02:00
Alexander Larsson
70fe029bc0 Merge pull request #3519 from alexlarsson/flatpak-1.6.x
Bump bubblewrap to 0.4.1
2020-03-30 15:44:38 +02:00
Alexander Larsson
22ed218a8d Bump bubblewrap to 0.4.1 2020-03-30 15:24:11 +02:00
Alexander Larsson
cd1ad17ea4 Merge pull request #3516 from alexlarsson/1.6-backports
1.6.3 backports
2020-03-30 13:59:34 +02:00
Alexander Larsson
4e4b9f936a CI: Run on flatpak-1.6.x branch 2020-03-30 13:35:43 +02:00
Alexander Larsson
3ab23776b3 tests: Fix gpg signature failure checks
It seems recent ostree reports a different error string for signature
check failures.

(cherry picked from commit ab5f2dd7e8)
2020-03-30 12:50:46 +02:00
Matthew Leeds
8185143423 flatpak-utils-http.c: Add retry logic for transient failures
Currently if flatpak is installing an extra data app such as Spotify and
the server with the .deb file fails to complete the request, the
installation fails with a message like "Connection terminated
unexpectedly". This commit makes flatpak instead try 5 times to download
a given URI if the error returned seems like a transient one (so not,
for example, 404 not found). This is analogous to what was done in
libostree in commit 938055392fd455027a69398c441b992ae521aa87, and we use
some code from there.

(cherry picked from commit 5560132ba6)
2020-03-30 11:21:49 +02:00
Matthew Leeds
ad803b9862 flatpak-utils-http.c: Use more specific GIOError codes
Instead of defaulting to G_IO_ERROR_FAILED, use more specific codes when
we can. These were copied from libostree.

(cherry picked from commit 0b25455af1)
2020-03-30 11:21:49 +02:00
Owen W. Taylor
53142f3d6a oci-authenticator: fix failures to clear GError
Fix problems overwriting a GError when we retry multiple times.
One of these was introduced with the recent change
e3f17a89a flatpak-oci-authenticator: try getting a token without credentials
but the other was existing.

Signed-off-by: Owen W. Taylor <otaylor@fishsoup.net>
(cherry picked from commit 425f628263)
2020-03-30 11:21:49 +02:00
Owen W. Taylor
f4f387a509 oci-authenticator: reuse token results when we already have them
When we already have a token for the first repository after probing
for no-auth authenticator or testing user-entered credentials, just
use that, don't request it again in the loop over repositories.

This gives a significant optimization of the prompted-credentials
case for registry.redhat.io, which takes 4-5 seconds to generate a
token, hopefully avoiding the user thinking something has gone wrong.

Signed-off-by: Owen W. Taylor <otaylor@fishsoup.net>
(cherry picked from commit 08636d4729)
2020-03-30 11:21:49 +02:00
Owen W. Taylor
07ed998ea5 flatpak-oci-registry.c: supply a default scope when getting a token
If no scope parameter is supplied in the WWW-Authenticate header,
docker and libpod will make up their own of the form
repository:<reponame>:pull when requesting a bearer token. Match that.

Signed-off-by: Owen W. Taylor <otaylor@fishsoup.net>
(cherry picked from commit f7616a8b3c)
2020-03-30 11:21:49 +02:00
Owen W. Taylor
346d42d90d flatpak-oci-authenticator: try getting a token without credentials
Some registries require getting a token even to download an image
anonymously. So, if no auth has been configured, before prompting
the user for username/password, try without a BasicAuth header.

Signed-off-by: Owen W. Taylor <otaylor@fishsoup.net>
(cherry picked from commit fe3f17a89a)
2020-03-30 11:21:49 +02:00
Alexander Larsson
ad27a7e508 repair: Don't crash if no remotes are configured
If no remotes are configured, ostree_repo_remote_list returns NULL
so don't dereference it.

Fixes: https://github.com/flatpak/flatpak/issues/3436
(cherry picked from commit e2ee3306b7)
2020-03-30 11:21:49 +02:00
Simon McVittie
ceeaa07202 run: Cope with the primary gid not being in the nsswitch database
If it's an opaque integer on the host system, it might as well be an
opaque integer in the container too.

Fixes: #3416
Signed-off-by: Simon McVittie <smcv@collabora.com>
(cherry picked from commit a36e0183b1)
2020-03-30 11:19:02 +02:00
Alexander Larsson
e0dba006be Merge pull request #3508 from alexlarsson/fix-extra-data-size
Fix calculation of extra-data total size
2020-03-30 09:05:44 +02:00
Alexander Larsson
09011d8aea CI: Add python3-pyparsing deps
(cherry picked from commit 966c6e2a25)
2020-03-28 16:47:42 -07:00
Matthew Leeds
91cde831c4 Add .lgtm.yml
Without this, lgtm.com can't successfully build the C code in Flatpak.

(cherry picked from commit 8fb7876305)
2020-03-28 10:30:56 -07:00
Alexander Larsson
e22fcdefde Fix calculation of extra-data total size
This is a bug introduced in b03916f5bd
where we check the extra_data refs against app/ or runtime/ prefix with
arguments in the wrong order.

(cherry picked from commit ed3ba39a06)
2020-03-27 17:41:16 +01:00
AsciiWolf
38cbf76d8f Update Czech translation 2020-03-11 14:26:12 +01:00
Piotr Drąg
a97f3b74c2 Update Polish translation 2020-02-17 15:41:49 +01:00
AsciiWolf
eb6602f2c1 Update Czech translation 2020-02-16 10:27:45 +01:00
Alexander Larsson
c80eae2f91 Update pofiles for release 1.6.2 2020-02-13 15:25:32 +01:00
Alexander Larsson
01a8f5ad2c Update NEWS for 1.6.2 2020-02-13 14:57:36 +01:00
Alexander Larsson
609217650d Bump version to 1.6.2 2020-02-13 14:57:27 +01:00
Alexander Larsson
b03916f5bd setup-extra-data: Avoid extra work for ostree-metadata and appstream branches
We never have extra data for non app/ or runtime/ refs, so lets not
do an unnecessary pull there.
2020-02-13 14:47:00 +01:00
Alexander Larsson
2481207a6f run: Fix uninitialized use warning
This isn't actually used ununitialized, but gcc can't figure that out.
2020-02-13 14:47:00 +01:00
Alexander Larsson
9aecad7f4f p2p: Don't mirror ostree-metadata refs when pulling into the child repo
This breaks Deploy which can't find the ref. It used to work due to
the extra non-mirroring pull in flatpak_dir_setup_extra_data, but
this is not needed here.
2020-02-13 14:47:00 +01:00
Alexander Larsson
b371ef9007 Actually use from-scratch deltas
As noticed in https://github.com/flatpak/flatpak/issues/3412 we
regressed at some point and are no longer using from-scratch deltas.
This is caused by an optimization in ostree where it decides to not
use a from-scratch deltas if theres is *some* version of the ref
locally available.

This conflicts with some code in flatpak that pulls *only* the commit
object in order to look for extra data size information so that we can
get the progress reporting right. Unfortunately the existance of
just the object triggers the above causing us to *never* use from-scratch
deltas.

We fix this by throwing away the partial pull in an aborted ostree
transaction.
2020-02-13 14:47:00 +01:00
Alexander Larsson
087ba2d23f system-helper: Support -vv and --ostree-verbose 2020-02-13 14:47:00 +01:00
Alexander Larsson
30636a508d system-helper: Change debug prefix from F to FH
This makes it easier to see what message comes from where.
2020-02-13 14:47:00 +01:00
Patrick Griffis
1a735f2f1a run: Prevent accidentally running with sudo
It is a common user error to prepend many flatpak commands with sudo
and doing so with run is quite unsafe and can cause issues.

This check simply handles the `sudo flatpak run foo` case and does
not prevent running as root or even running in a shell created by
sudo.

See also #1357
2020-02-13 11:52:56 +01:00
Matthew Leeds
bbd4ee68b4 app: Don't print "< 0 bytes"
Don't imply a download or install uses a negative number of bytes.
2020-02-12 16:45:41 +01:00
Matthew Leeds
5a94edaef3 portal: Add g_autoptr() defines for old GLib versions
We don't need to check for GLib 2.44 (the first release with g_autoptr()
support) since Flatpak requires that version in configure.ac.

Fixes https://github.com/flatpak/flatpak/issues/3403
2020-02-12 16:43:18 +01:00
Matthew Leeds
5d382f3211 dir: Avoid unnecessary _flatpak_dir_reload_config()
There's no point in reloading the config when it didn't change.
2020-02-12 16:41:06 +01:00
Matthew Leeds
5836de30e3 common: Properly reload config when it changes
In flatpak_dir_create_origin_remote() we reload the repo config after
adding an origin remote to it, but this only applies to the FlatpakDir
object used. In the case of flatpak_transaction_add_ref(), there is
another FlatpakDir object in the installation (priv->installation) which
needs to also be reloaded using flatpak_installation_drop_caches(). So
add a boolean out variable to flatpak_dir_create_origin_remote() and use
it to determine if it's necessary to call
flatpak_installation_drop_caches() (because if the origin remote already
exists we don't create another).

This commit also makes related changes at the other call sites of
create_origin_remote() (some indirectly via
flatpak_dir_ensure_bundle_remote()):
- in flatpak_dir_ensure_bundle_remote(), only set the out variable
  created_remote to TRUE if a new remote was actually created
- in flatpak_installation_install_bundle(), only drop the installation
  caches if a new remote was actually created
- in flatpak_transaction_resolve_bundles(), drop a redundant
  flatpak_dir_recreate_repo() call and only drop installation caches
  when necessary

Without these changes, this unit test failure occurs:
ERROR: testlibrary - Bail out!
flatpak:ERROR:tests/testlibrary.c:3311:test_transaction_install_local:
assertion failed (error == NULL): Remote "hello-origin" not found
(flatpak-error-quark, 7)
2020-02-12 16:41:06 +01:00
Matthew Leeds
8d49baaff9 testlibrary: Account for when origin remote is created
In test_transaction_install_local(), we test that the origin remote
created when installing from a local repo doesn't exist before
flatpak_transaction_run() is executed and does exist afterward. However,
the origin remote is created before the transaction is run; see the
flatpak_dir_create_origin_remote() call in
flatpak_transaction_add_ref(). The only reason this discrepancy has not
caused a test failure is that the FlatpakDir object held by the
FlatpakInstallation object is not reloaded when the origin remote is
added (so it's reading an old copy of the repo config). This issue will
be fixed in the commit following this one.
2020-02-12 16:41:06 +01:00
Matthew Leeds
04757e31d9 transaction: Fix a typo in a g_debug() 2020-02-12 16:41:06 +01:00
Matthew Leeds
3917ef8776 transaction: Fix use of uninitialized variable
This was reported by valgrind.
2020-02-12 16:41:06 +01:00
Patrick Griffis
b8d2271154 run: Fix TMPDIR env var not being passed through suid bwrap
Fixes #2641
Fixes flathub/org.electronjs.Electron2.BaseApp#4
2020-02-12 16:38:53 +01:00
Matthew Leeds
a2bf5da626 Merge pull request #3394 from milotype/milotype-hr-01
Add croatian translation
2020-02-08 18:40:20 -08:00
milotype
bc459a0bc9 po: Add hr.po (croatian translation) 2020-02-08 17:56:13 -08:00
Matthew Leeds
411ffd6e99 Merge pull request #3382 from cho2/l10n
Update Indonesian translation
2020-02-07 17:00:23 -08:00
Matthew Leeds
423a21271c Merge pull request #3374 from smcv/fix-home-host-confusion
exports: Fix a confusingly-named method
2020-02-07 16:47:44 -08:00
Matthew Leeds
00ed995860 Merge pull request #3393 from dwrobel/patch-1
Fix out-of-tree build error
2020-01-31 09:12:36 -08:00
Damian Wrobel
e801959e58 Fix out-of-tree build error
Fixes the missing 'app' directory:

Traceback (most recent call last):
  File "/data/dwrobel1/rdkv/rpi-flutter-3/build-raspberrypirdkhybrefapp/tmp/sysroots/x86_64-linux/usr/bin/gdbus-codegen", line 39, in <module>
      sys.exit(codegen_main.codegen_main())
        File "/data/dwrobel1/rdkv/rpi-flutter-3/build-raspberrypirdkhybrefapp/tmp/sysroots/x86_64-linux/usr/share/glib-2.0/codegen/codegen_main.py", line 186, in codegen_main
            h = open(c_code + '.h', 'w')
            FileNotFoundError: [Errno 2] No such file or directory: './app/flatpak-permission-dbus-generated.h'
            make: *** [app/flatpak-permission-dbus-generated.c] Error 1
            make: *** Waiting for unfinished jobs....
2020-01-31 10:01:11 +01:00
milotype
8cd363a94a Update LINGUAS with "hr" (croatian) 2020-01-30 19:38:48 +01:00
Matthew Leeds
35d8c6afb5 Merge pull request #3375 from smcv/doc-filesystems
doc: Point to flatpak-metadata(5) for the meanings of filesystem keywords
2020-01-27 11:55:00 -08:00
Matthew Leeds
6aa1617e63 Merge pull request #3376 from uajain/uajain/del-blank-line
nitpick: installation: Remove a blank line
2020-01-27 11:51:58 -08:00
Kukuh Syafaat
e04795f440 Update Indonesian translation 2020-01-26 17:15:07 +07:00
Umang Jain
fe8b3c4b33 nitpick: installation: Remove a blank line 2020-01-24 14:08:08 +05:30