Commit Graph

1956 Commits (7018717ce2abe7503ce6ba3f8b4e219a915b95fb)
 

Author SHA1 Message Date
Simon McVittie a5d70667b2 test_install_launch_uninstall: consistently check for GError first
An assertion failure that says res is FALSE is a lot less useful
than an assertion failure that says we got a specific GError.

Signed-off-by: Simon McVittie <smcv@debian.org>
2016-09-07 17:01:35 +01:00
Alexander Larsson 5bf37574f1 flatpak-info: Flatten the metadata to make it more easy to parse
The info file is always standalone, as it never needs to stack on top
of another context. This means we can remove all "negative" attributes
such as "shared=!network", making it easier to parse this file.
2016-09-07 14:32:10 +02:00
Alexander Larsson e1ad3a7a3c flatpak-info: Add application branch info
Note: This is only available in flatpak run, not flatpak build, where
this info is not available.
2016-09-07 12:31:56 +02:00
Alexander Larsson 0fc06022c8 flatpak-info: Add runtime path 2016-09-07 12:19:13 +02:00
Alexander Larsson 32c571ae79 Move $XDG_RUNTIME_DIR/flatpak-info to /.flatpak-info and make it read-only
The old location keeps working because we create a symlink.

The interesting part of this is that the sandbox now can't modify,
remove or replace the file, and it is in a fixed position. This means
that given a sandboxed pid, we can find this file as
"/proc/$pid/root/.flatpak-info".

This is very nice for two reasons:
 * We can use this instead of the cgroup to find out if a pid is
   sandboxed or not. This means we can drop the dependency on
   systemd --user for this.
 * We can get more information about the peer process that the
   app id. For instance, we can see what permissions the sandboxed
   app has.
2016-09-07 11:53:05 +02:00
Alexander Larsson edb2749e3e Update bubblewrap to latest git with --ro-bind-data support 2016-09-07 11:46:19 +02:00
Alexander Larsson e256bf7570 remote-add: Make internal function static 2016-09-06 15:40:11 +02:00
Alexander Larsson 41443313ca session-helper: Move HostCommand to its own interface 2016-09-06 15:30:38 +02:00
Alexander Larsson 983b2a5db1 lib: Look for "bwrap" in PATH when launching from libflatpak
We forgot to look in the path, which made it fail when using
the system bwrap and not passing a full path.
2016-09-06 15:29:36 +02:00
Alexander Larsson e6a85a7fdd utils: Fix support for old glib without g_autoptr 2016-09-06 09:26:02 +02:00
Alexander Larsson fbca999cc9 Create /app/(.updated|.removed) file after update/uninstall
This way running apps can easily detect this and restart themselves.
2016-09-06 09:16:04 +02:00
Alexander Larsson e792686892 builder: Propagate build-args to shell sources
This way you can e.g. do network i/o in them.
Thats not a recommended way to do it though, as you work around
a lot of the feature in flatpak-builder like the caching and
verification.
2016-09-05 22:01:56 +02:00
Alexander Larsson c66e394266 builder: Use HostCommand calls if in sandbox 2016-09-05 21:41:14 +02:00
Alexander Larsson ddf05ef063 builder: Use flatpak_spawnv helper in a few more places
This is in preparation for it calling the new host-command.
2016-09-05 21:41:14 +02:00
Alexander Larsson c8df0e6208 SessionHelper: Add calls to spawn processes on the host
This lets any client, possibly in a sandbox if it has access to the
session helper, spawn a process on the host, outside any sandbox.

Clearly this is not something you typically want a sandboxed app to
do. However, it is sometimes very useful when using flatpak mainly
for distribution. For instance, an IDE needs to use this to launch a
flatpak build operation inside the sandbox. (Because otherwise recursive
calls to flatpak will not work.)
2016-09-05 21:41:14 +02:00
Alexander Larsson aafc0f3b66 run/metadata: Add support for --allow=devel
This enables support for ptrace and perf for the app, similar
to what run -d manually gave you before. This is nice to be
able to package an app like gnome-software.
2016-09-05 21:41:14 +02:00
Alexander Larsson a788965eec Support FLATPAK_USER_DIR env var 2016-09-05 21:41:14 +02:00
Alexander Larsson 39534d9212 Merge pull request #255 from piotrdrag/pl-update-160818
Updated Polish translation
2016-09-05 20:59:10 +02:00
Alexander Larsson f387d18d33 Merge pull request #285 from xjuan/doc-portal-runtime
document-portal: Fix the document portal for files outside /app
2016-09-05 20:58:12 +02:00
Juan Pablo Ugarte cd574cfbfe document-portal: Fix the document portal for files outside /app
Strip /newroot prefix from document path since validate_parent_dir()
depends on a system path to get the parent directory stat.
2016-09-05 15:44:02 -03:00
Alexander Larsson d10409cb3e document-portal: Fix the document portal
This was using libflatpak which is the public API, instead of the internal
library, so it was breaking in all sorts of mysterious ways. This is fixed
by just directly calling the lowlevel common/* APIs.

Also, it didn't properly handle the case where the sandboxed app passed a
path that was not in /app, this should be allowed if the fd validation
passes, that is the whole point of the checks after all.
2016-09-05 17:10:15 +02:00
Piotr Drąg ff2d6c7bde Updated Polish translation 2016-09-05 16:19:44 +02:00
Piotr Drąg 21a7bd532b Update POTFILES.in 2016-09-05 16:19:44 +02:00
Alexander Larsson 8475dfeee9 document-portal: Don't link to libflatpak.so 2016-09-05 16:18:26 +02:00
Alexander Larsson 0a20f28f89 session-helper: Add support for -r -v --help --version 2016-09-05 11:54:12 +02:00
Alexander Larsson ff6839a291 utils: Add flatpak_is_in_sandbox() helper 2016-09-05 11:54:12 +02:00
Alexander Larsson 3b90b00e39 build: Export a $XDG_RUN_DIR/flatpak-info file from flatpak build too
This way we know if we're in a sandbox or not even at build time,
and things like portal pickup etc, works.
2016-09-05 11:54:12 +02:00
Alexander Larsson 4865d1edd2 common: Export flatpak_run_add_app_info_args
We want to use this from flatpak build too
2016-09-05 11:54:12 +02:00
Alexander Larsson 3ec0ecba93 common: add_app_info_args() talk GFile *app_files instead of a deploy
We don't really need the full deploy anyway.
2016-09-05 11:54:12 +02:00
Alexander Larsson e50f7a363f build-update-repo: Reuse cache info from old summary
This makes rebuilding partial changes much faster.
2016-09-02 11:13:11 +02:00
Alexander Larsson ba377b29e6 common: Add utility function to load summary file from local repo 2016-09-02 11:10:29 +02:00
Alexander Larsson 0ca185c93f Merge pull request #280 from dbnicholson/G269-summary-optimization
Speed up summary regeneration
2016-09-02 10:31:29 +02:00
Dan Nicholson d2d9804187 utils: Only collect cache data once per revision
If there are multiple refs pointing to the same revision, then
collecting the size and metadata info for each of them is wasteful.
Maintain a hash table of the data so that it's only collected once per
revision.

This slightly widens an existing race where a ref could be updated
before the summary file is regenerated. In that case, the data in the
xa.cache variant would correspond to the wrong revision. I don't believe
this can be fixed unless there's locking at the ostree level.
2016-09-01 10:11:13 -07:00
Dan Nicholson e86ae01ba0 utils: Only update summary info for flatpak refs
If there are non-flatpak refs in the ostree repo, there's no use in
collecting size or metadata information for them. Instead, only operate
on refs in the appstream, app or runtime prefixes.
2016-09-01 10:11:13 -07:00
Dan Nicholson d304c4eca1 utils: Free list of refs in flatpak_repo_update
Although the data is owned by the hash table, the list storage needs to
be freed with g_list_free(). Use g_autoptr for that.
2016-09-01 10:11:07 -07:00
Alexander Larsson a5536d0420 update: Don't stop the entire update if one app fails 2016-09-01 11:45:27 +02:00
Alexander Larsson 509bb33a2b Merge pull request #237 from mwleeds/add-trace-msg
utils: Print a debug message when launching subprocesses
2016-08-30 09:22:02 +02:00
Alexander Larsson c076b33ba3 Fix last commit
The checks where inverted.
2016-08-29 16:15:32 +02:00
Alexander Larsson aa160aa111 lib: Make sure we always call flatpak_dir_ensure_repo after cloning the dir
Otherwise we're not guaranteed the new FlatpakDir has a repo.
2016-08-29 16:11:48 +02:00
Alexander Larsson 59040b50f2 Merge pull request #264 from urbalazs/master
Added Hungarian translation
2016-08-29 12:35:39 +02:00
Alexander Larsson b39c2e81ee Merge pull request #265 from ipuustin/fix-build
Create directories before attempting to generate code into them
2016-08-29 12:35:29 +02:00
Alexander Larsson 6e37155a3e testlibrary: Skip launch test is bwrap is not supported 2016-08-29 12:32:31 +02:00
Alexander Larsson e18ab46977 build-update-repo: Add some spew before starting the prune operation
This makes it more obvious what is happening, and which part is slow.
2016-08-29 12:06:16 +02:00
Alexander Larsson b678431197 Treat remotes with empty url as disabled
This happens with e.g. remotes from a bundle with no origin.

Fixes https://github.com/flatpak/flatpak/issues/270
2016-08-29 12:03:33 +02:00
Alexander Larsson d40ae5ea92 Merge pull request #271 from yurchor/master
Add Ukrainian translation
2016-08-29 11:49:18 +02:00
Alexander Larsson 874a67c721 Update: Don't double-call flatpak_dir_cleanup_removed
This is already called automatically from flatpak_dir_deploy_update.
In particular, in the system-installed case this will cause
a warning due to not being able to remove the old checkout with
permission denied.
2016-08-29 11:48:30 +02:00
Alexander Larsson d0ac28f2fa Merge pull request #273 from csoriano89/patch-1
Readme.md: align image
2016-08-29 11:39:09 +02:00
Alexander Larsson b1fcf792e1 testlibrary: Include libglnx before flatpak.h
This makes the code use the backport of g_auot* so that we can build
against older versions of glib.
2016-08-29 11:01:05 +02:00
Carlos Soriano Sánchez 8ff3f7a7e0 Readme.md: align image
Use css to align the Flatpak image on the Readme.md since markdown
doesn't allow tweaking the positioning.

Sorry, I couldn't let it like this :)
2016-08-27 23:36:56 +02:00
Yuri Chornoivan 12c2a67773 Add Ukrainian translation 2016-08-27 13:17:56 +03:00