Commit Graph

303 Commits

Author SHA1 Message Date
Cosimo Cecchi
3d2a42ddf3 utils: fix double loop when extracting icons for appstream
When trying to extract icons to regenerate the appstream, we are looping
over the entire file every time, instead of only trying to copy icons
for the application ID we're looking at the moment.
This is most likely benign, but it causes a lot of "Error copying icon:
No such file or directory:" spew when calling flatpak build-update-repo.
2016-07-21 13:17:36 -07:00
Cosimo Cecchi
692125c115 run: plug a few memory leaks 2016-07-14 17:27:11 -07:00
Cosimo Cecchi
a8e3e1826f FlatpakDir: use correct function to free FlatpakContext refs
These are not keyfiles. This fixes a crash when launching applications
through gnome-sofware.
2016-07-14 17:26:02 -07:00
Alexander Larsson
92ab585e6f Merge pull request #171 from mariospr/no-desktop
flatpak-run: Add a new --no-desktop option to prevent creation of cgroups
2016-07-02 00:05:30 +02:00
Mario Sanchez Prada
8c8b91609c flatpak-run: Add a new --no-desktop option to prevent creation of cgroups
This is not intented for normal use, but it can be useful in cases where
we don't have a running session and sandboxing is not strictly required.
2016-07-01 22:12:04 +01:00
Alexander Larsson
51663de427 Remove unused variables 2016-07-01 14:45:53 +02:00
Alexander Larsson
b5204c908d builder: Clear mtime to 1, not 0, to match what new ostree does 2016-07-01 14:25:22 +02:00
Alexander Larsson
5da7a0411a lib: Support listing related refs 2016-07-01 10:32:57 +02:00
Alexander Larsson
4a40fece78 Add flatpak_dir_install_or_update
This is needed in the case where we can do any, such as when
installing related refs, which may be already installed.
2016-06-30 16:55:31 +02:00
Alexander Larsson
8293527dbd FlatpakDir: Add flatpak_dir_find_remote/local_related
This lets us find all the "related" refs to a ref in a particular
remote, or locally.  These are the things we should automatically
download or delete when installing/updating/uninstalling the ref.

The implementation currently looks at all the extensions handled by the
app/runtime. For debug extensions and extensions marked no-autodownload we
only consider them related if its already locally installed. For locale
extensions we always consider them related, but we only pull the current
locale data for it.
2016-06-30 16:55:26 +02:00
Alexander Larsson
81e61391be utils: Add flatpak_summary_match_subrefs
This is useful to do extension matching in summaries
2016-06-30 11:42:39 +02:00
Alexander Larsson
5897ddd7ef utils: Add flatpak_get_current_locale_subpaths() 2016-06-30 11:41:12 +02:00
Alexander Larsson
9be05bc511 common: Remove unused functions 2016-06-29 16:43:02 +02:00
Alexander Larsson
0be93ed1dc extensions: Always create a tmpfs for subdirectory extensions.
This makes sure we can actually create a directory as needed, and not
having to have every subdirectory pre-created in the runtime.
2016-06-29 15:56:28 +02:00
Alexander Larsson
853227a3d6 extensions: Minor cleanup
We now store the path to the extension files in the FlatpakExtension
returned from list_extensions instead of having each called look
them up.
2016-06-29 12:20:16 +02:00
Alexander Larsson
de8d8a36c2 Merge pull request #158 from hadess/wip/use-git-patch
Add "use-git" option for patch source types
2016-06-28 15:24:49 +02:00
Alexander Larsson
7070dbf96c Make journal always available in the sandbox
I don't think it makes sense to have to enable this for everything.
It should be safe in the sense that you can't ever do more than
the user can do anyway, and there is no way to use this to communicate
with the rest of the system because you can't read from it.
The worst this could ever cause is to overload the system, but the
sandbox doesn't protect against that in any other way anyway.
2016-06-28 15:05:01 +02:00
Bastien Nocera
2facf8bbf0 utils: Add flatpak_spawnv() helper
This will allow callers to easily add new parameters without tearing
their hair out with varargs.
2016-06-28 14:24:16 +02:00
Alexander Larsson
44b6c31efc fix warning 2016-06-28 11:41:35 +02:00
Alexander Larsson
43dbf96f7c Merge pull request #148 from matthiasclasen/journal
make journal logging work in the sandbox
2016-06-27 11:14:11 +02:00
Simon McVittie
ee99e8afff Add BWRAP and --with-system-bubblewrap configure arguments
This lets distributors share a system copy of bubblewrap (>= 0.1.0)
between Flatpak and any other projects that benefit from it, if they are
careful to keep new versions in sync. The default is still to use the
bundled submodule, ensuring compatibility and simplifying dependencies.

Enable $PATH search everywhere that runs bwrap, so that $BWRAP doesn't
necessarily need to be a fully-qualified path.

Signed-off-by: Simon McVittie <smcv@debian.org>
2016-06-26 11:09:03 +01:00
Simon McVittie
58bd3e3ec8 Downgrade failure to get document portal from warning to message
Otherwise, the tests all abort when run without FUSE.

Signed-off-by: Simon McVittie <smcv@debian.org>
2016-06-25 00:45:09 +01:00
Matthias Clasen
5fb066bf90 Add an option for journal sockets
Untested, I couldn't find a runtime that has systemd-cat or a similar
tool in it.
2016-06-24 01:52:55 -04:00
Alexander Larsson
f9ce1b16ed Make finding refs handle multi-arch
If opt_arch is not specified:
 * find_xxx_refs now return refs for all supported arches
 * find_xxx_ref looks at each supported arch in prio order
2016-06-23 12:52:55 +02:00
Alexander Larsson
9915e3740b Disable static deltas for system-helper updates
Due to an issue with ostree (https://github.com/ostreedev/ostree/pull/362)
applying non-from-scratch deltas fail when using parent_repo such as
in the system-helper case. We fix this temporarily by disabling the
use of deltas for that case.
2016-06-23 12:16:02 +02:00
Alexander Larsson
34faddfa8f common: Make some internal functions static 2016-06-23 11:31:19 +02:00
Alexander Larsson
bde74d25d4 common: Add flatpak_get_arches() helper 2016-06-23 11:05:42 +02:00
Alexander Larsson
e86ae478f7 Fix --dev=all support
As pointed out by Jasper, we need to --dev-bind for devices to work.
2016-06-18 22:52:39 +02:00
Alexander Larsson
6cbc9a7932 dbus proxy: Don't store the temporary sockets in $XDG_RUN_DIR/bus-proxy
This just causes us to leave this empty directory around. Instead we
use hidden files directly in $XDG_RUN_DIR/.
2016-06-16 22:30:48 +02:00
Alexander Larsson
cbe35fedbc system-helper: Correctly copy the system config when modifying a repo
We were accidentally using the passed in copy of the rest of the config
when we should be using the one we read.
2016-06-16 19:56:50 +02:00
Alexander Larsson
de13e496c1 sandbox: Make /var/tmp and /tmp different dirs, not symlinks
This means you can use either or both of --filesystem=/tmp and
--filesystem=/var/tmp to share the host tmpdirs.
2016-06-16 01:33:28 +02:00
Alexander Larsson
a84f725211 Support --device=all
This gives the application full access to the host /dev. Obviously
this is not great in terms of sandboxing, but its nice for applications
that use flatpak mostly as a way to do distribution of the app.

Also, its not like the app has full access to anything, its still
limited to the access right of the user.
2016-06-14 22:33:14 +02:00
Simon McVittie
c18626f11c common: don't distribute generated GDBus files in tarballs
Signed-off-by: Simon McVittie <smcv@debian.org>
2016-06-12 10:35:13 +01:00
Alexander Larsson
874fbbff34 Fix various leaks 2016-06-10 12:59:30 +02:00
Alexander Larsson
5e95d81d45 Allow access to all portals 2016-06-09 16:03:54 +02:00
Matthias Clasen
26b083333a Fix a case of NULL<>FALSE confusion
This causes a compiler warning.
2016-06-08 20:05:26 -04:00
Alexander Larsson
70093d426f lib: Fix crash on install/update due to uninitialized dir->repo 2016-06-08 13:49:01 +02:00
Alexander Larsson
cc08083543 common: Add flatpak_zero_mtime helper
This recursively sets the mtime to 0.
2016-06-08 11:11:01 +02:00
Alexander Larsson
cfef57e343 Properly handle subpaths on update 2016-06-07 22:12:51 +02:00
Alexander Larsson
77f1d7660c Don't abort on errors when pruning
This could happen for local partial pulls, due to a bug in ostree
where it didn't create commitpartial state files during local pulls.
2016-06-07 22:12:51 +02:00
Simon McVittie
9b7c339ca6 flatpak-run: don't fail if there are no system fonts
In a minimal environment (like the one where we run installed-tests
in Debian), we might not have /usr/share/fonts.

Signed-off-by: Simon McVittie <smcv@debian.org>
2016-06-04 22:38:32 +01:00
Alexander Larsson
a0358c8785 Handle non-existing dirs when deploying a subpath 2016-06-03 18:03:23 +02:00
Alexander Larsson
e769af8661 system-helper: Handle installing bundles 2016-06-03 16:04:10 +02:00
Alexander Larsson
8ef84cc3d1 Move shared bundle install code to flatpak_dir_install_bundle 2016-06-03 14:30:25 +02:00
Alexander Larsson
21ab14b19a Improve deployment of appstream data
This has several improvements:
 * Writes to a temporary location and renames at the end, so
   we never end up with partial checkouts.
 * Don't fsync each file during checkout, instead syncfs() at
   the end
 * Pre-create the target deployment directory so that we get the right
   permissions for it.
2016-06-03 14:30:25 +02:00
Alexander Larsson
72118a40b6 Merge pull request #67 from smspillaz/fix-gh-56
completion: Don't show one-time switches already in use
2016-06-02 17:23:01 +02:00
Sam Spilsbury
7bd6c9b277 completion: Don't show one-time switches already in use 2016-06-02 21:38:16 +08:00
Sam Spilsbury
082821288e completion: Store original argv and argc
We deep-free the original argv here, since it isn't modified.
2016-06-02 21:38:16 +08:00
Alexander Larsson
13707f6b18 system-helper: Support directly pulling local remotes
For a local (file:// uri) remote, do an (untrusted) direct pull instead
of pulling into the users cached repo first. This way we do less copies,
as well as guaranteeing the source of the data. The later means its
mostly safe to also allow this for non-gpg signed remotes.
2016-06-02 15:30:08 +02:00
Alexander Larsson
5c23f9bd9d Don't create empty "repo*" directories in the CWD
We were using the wrong dirfd, so we created empty files in the
current directory.
2016-06-01 10:23:52 +02:00