Commit Graph

5620 Commits

Author SHA1 Message Date
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
Simon McVittie
851a34b355 doc: Point to flatpak-metadata(5) for the meanings of filesystem keywords
Signed-off-by: Simon McVittie <smcv@collabora.com>
2020-01-23 18:40:01 +00:00
Simon McVittie
1f9dc50e33 exports: Fix a confusingly-named method
It was called flatpak_exports_add_home_expose(), but it actually
exposed the entire host filesystem, to the extent possible.
Rename it to flatpak_exports_add_host_expose() to reflect that.

Signed-off-by: Simon McVittie <smcv@collabora.com>
2020-01-23 18:33:57 +00:00
Alexander Larsson
400a3358ec Update pofiles for release 1.6.1 2020-01-23 14:00:01 +01:00
Alexander Larsson
68d814bd01 Update NEWS for release 2020-01-23 13:48:55 +01:00
Alexander Larsson
50fc19daf1 Bump version to 1.6.1 2020-01-23 13:35:25 +01:00
Alexander Larsson
b3bd501978 update-portal: Limit which filesystem access additions we allow
Don't allow adding access to things like ~/foo xdg-foo/bar or similar
things just because you used to have home access, because such files
may be outside the homedir (for instance, if they are symlinks or configured
via xdg-user-dirs).
2020-01-23 13:34:20 +01:00
Alexander Larsson
3c6c51f46b build-commit-from: Fix generation of download-size
In flatpak-builtins-build-commit-from.c we call flatpak_repo_collect_sizes()
without initializing the passed in download size to zero, which mean
we sum with sizes with some random value as the start.

This is fixed by having flatpak_repo_collect_sizes() always initialize
the counters to 0 at the start.

Fixes https://github.com/flatpak/flatpak/issues/3362
2020-01-23 09:04:29 +01:00
Alexander Larsson
b735344644 Correct filename in docs 2020-01-17 11:47:04 +01:00
Alexander Larsson
39903eab40 Add --device=shm permission
This new permission exposes the host /dev, which is normally not visible
even with --device=all, as it is not really a device node but rather
a bunch of shared memory blocks available on the host.

This access is needed by jack, as explained at:
https://github.com/flatpak/flatpak/issues/1509

Long term I think a better solution for pro audio (like pipewire) is
a better solution, but for now we should at least allow jack apps to work.
2020-01-17 11:47:04 +01:00
Matthew Leeds
c8df96a79e Merge pull request #3363 from uajain/uajain/fix-gs-crash
Fix a gnome-software crash
2020-01-16 10:51:04 -08:00
Umang Jain
56787325ed dir: Return empty array instead of NULL while querying related-refs
Initialize the related-refs array with empty GPtrArray so that if
the remote has 'url= ' (for e.g., in case of flatpak bundle's remotes),
a empty array is returned instead of NULL.

(NULL mostly implies a operation has failed and error is set)

Also, this syncs the implementation of `if (*url == 0)` with
that of  flatak_dir_find_remote_related_for_metadata function.
2020-01-16 19:30:09 +05:30
Umang Jain
18626add02 dir: Return NULL instead of boolean when querying related refs
The related refs are returned as GPtrArray, hence return NULL
instead of FALSE on error paths.
2020-01-16 19:15:01 +05:30
Alexander Larsson
d46483f578 Sandbox: Allow share-gpu also if caller has device=all
This fixes https://github.com/flatpak/flatpak/issues/3330
2020-01-15 08:57:15 +01:00
Philip Withnall
aa97d1da8c flatpak.pc: Move ostree-1 from Requires.private to Requires
While flatpak carefully doesn’t expose any OSTree symbols in its C API,
it does sometimes return GErrors with the domain `OSTREE_GPG_ERROR`.
Applications can happily link against flatpak and receive such errors,
but won’t be able to understand them without also linking against
OSTree.

OSTree is a hard dependency of flatpak, so we might as well move it to
`Requires` rather than `Requires.private` to ensure that clients link
against it.

See https://gitlab.gnome.org/GNOME/gnome-software/merge_requests/336/diffs#note_650999

Signed-off-by: Philip Withnall <withnall@endlessm.com>
2020-01-15 08:57:03 +01:00
scootergrisen
2e293c978a Update danish translation 2020-01-15 08:56:26 +01:00
scootergrisen
25d33adcec Update danish translation 2020-01-15 08:56:26 +01:00
Matthias Clasen
77a341fd34 Merge pull request #3349 from frandieguez/master
Update Galician translations
2020-01-09 09:46:22 -05:00
Matthias Clasen
11fe1b813c Merge pull request #3358 from yurchor/master
Ukrainian translation update
2020-01-09 09:46:05 -05:00
Yuri Chornoivan
50fa0b1673 Ukrainian translation update 2020-01-09 14:28:53 +02:00
Fran Dieguez
6741d970e9 Update Galician translations
aplicativo -> aplicación
2019-12-28 12:01:01 +01:00
Rafael Fontenelle
9cd84747fb Update Brazilian Portuguese translation 2019-12-27 11:08:24 +01:00
Alexander Larsson
5cfccaad39 CI: Test build with old glib (xenial) 2019-12-23 11:30:45 +01:00
Matthias Clasen
3d11992dd1 Merge pull request #3331 from piotrdrag/pl-update-191221
Update Polish translation 191221
2019-12-22 23:33:03 -05:00
Piotr Drąg
c963b27277 Update Polish translation 2019-12-21 15:32:50 +01:00
Matthias Clasen
1a17f60613 Merge pull request #3327 from AsciiWolf/l10n
Update Czech translation
2019-12-21 08:33:30 -05:00
AsciiWolf
d9273e205e Update Czech translation 2019-12-20 16:04:18 +01:00
Alexander Larsson
ba7b9c30d6 tests: add some missing includes 2019-12-20 13:45:37 +01:00
Alexander Larsson
a98d655f4f Fix build on older glib
Don't use G_VARIANT_BUILDER_INIT() which is glib 2.50 only
2019-12-20 13:25:20 +01:00
Alexander Larsson
722e20dfbb Update pofiles for release 1.6.0 2019-12-20 11:54:19 +01:00
Alexander Larsson
c048bdc941 Update NEWS 2019-12-20 11:33:18 +01:00
Matthias Clasen
6e45ff6d0f portal: Don't poll for updates on metered networks
Stop polling for updates on metered networks. Allow
overriding this with the new --poll-when-metered
option.

Fixes: https://github.com/flatpak/flatpak/issues/3286
2019-12-20 11:32:40 +01:00