Commit Graph

2760 Commits

Author SHA1 Message Date
Alexander Larsson
ea2af15dc0 run: Use new flatpak_find_current_ref helper. 2017-05-22 13:12:01 +02:00
Alexander Larsson
2023ca03c2 common: Add flatpak_find_current_ref helper 2017-05-22 13:12:01 +02:00
Alexander Larsson
8cd7a0ab31 common: Expose FlatpakExports
This will be needed for the document portal to be able to
detect what directories an app has access to.
2017-05-22 13:11:58 +02:00
Matthias Clasen
9564da53f8 Small documentation improvements
Add some missing newlines, and document that
AddFull was added in version 2.
2017-05-22 09:26:42 +02:00
Matthias Clasen
ea0f97efe7 Correct mountpoint handling
As a file path, the mountpoint should probably be sent
as ay. Also, remove an extra level of gvariant wrapping.
2017-05-22 09:26:23 +02:00
Matthias Clasen
c2ed604b2e Add some hints when icons are not found
We have some extra conditions here that are not evident
from the rename-icon key in the manifest, so add some
verbose output to make it easier to figure out why an
icon is not renamed.
2017-05-22 09:25:44 +02:00
Alexander Larsson
e63d089435 Remove unused variable
Fixes clang warning
2017-05-22 09:25:00 +02:00
Alexander Larsson
4f828942f7 Update to latest libglnx and use the new GLnxTmpFile API 2017-05-22 09:08:49 +02:00
Alexander Larsson
f4d8f5680b builder: Add CPPFLAGS similar to the existing flags 2017-05-22 08:50:18 +02:00
Alexander Larsson
f4281aacb1 builder: Update doc for latest cflags vs env var change 2017-05-22 08:49:52 +02:00
Alexander Larsson
ff8c9ddef6 builder: Make c/cxx/ldflags not override env
This allows you to easily construct flags by appending,
but also lets you override it completely if necessary.
2017-05-22 08:41:30 +02:00
Matthias Clasen
f05f012e19 Merge pull request #803 from mrkara/master
Added Turkish translation
2017-05-20 10:26:13 -04:00
Çağatay Yiğit Şahin
f92a92c50b Added Turkish translation
by GNOME Turkish Translation Team

Signed-off-by: Muhammet Kara <muhammetk@gmail.com>
2017-05-20 10:16:58 +03:00
Alexander Larsson
77a7aa6adb document-portal: Bump version to 2 due to new AddFull method 2017-05-19 17:03:15 +02:00
Alexander Larsson
6ce8521b64 document-portal: Add AddFull() operation
This allows you to add multiple paths at the same time, plus
grant an app access to it, plus it returns the fuse mount path.

This allows you to avoid a lot of roundtrip in common cases.
2017-05-19 17:01:46 +02:00
Alexander Larsson
bda7575e79 Add version property to all dbus interfaces 2017-05-19 14:38:22 +02:00
Alexander Larsson
6c5ee01d01 complete: Don't read outside string
Sometimes the shell_cur value given to us by bash
is longer than expected, so don't step outside the
string in this case.

Fixes https://github.com/flatpak/flatpak/issues/764
2017-05-19 12:52:39 +02:00
Alexander Larsson
617e3a4e4f builder: Fix segfault if appstream-compose fails
We were returning FALSE without initializing the GError.

Fixes https://github.com/flatpak/flatpak/issues/775
2017-05-19 12:00:58 +02:00
Alexander Larsson
67a9d9dfec OCI: Properly initialize all used progress fields
Its not a fatal error to try to read uninitialized ones
so this needs to be done.
2017-05-19 11:51:00 +02:00
Alexander Larsson
ae4a7d62af builder: More GLnxTmpfile fixes 2017-05-19 11:41:09 +02:00
Alexander Larsson
411107a942 builder: Better debug output from the rofiles-fuse code
We now show the mount point and the source correctly.
2017-05-19 11:34:37 +02:00
Alexander Larsson
d52329e926 Update to a libglnx that has GLnxTmpfiles fixed 2017-05-19 11:30:48 +02:00
Alexander Larsson
08894bb720 Update to latest libglnx with tmpfile error fix 2017-05-19 09:40:10 +02:00
Colin Walters
bcced9adc7 Bump libglnx, port to new tmpfile API
I think the new tmpfile here is a lot better; there were places in flatpak where
we weren't doing "unlink on failure" etc.
2017-05-19 09:27:03 +02:00
Alexander Larsson
05aa9e4eb3 Remove unused variable 2017-05-19 09:24:51 +02:00
Alexander Larsson
07609559b8 progress: Don't report ??? in the bar while estimating 2017-05-18 15:37:35 +02:00
Alexander Larsson
1c46cfe45d progress: Tweak metadata part of download
We artificially limit the metadata phase to the first 20 metadata
objects, because otherwise that phase takes too long time, as it
downloads content at the same time.
2017-05-18 15:36:34 +02:00
Alexander Larsson
435091e5cf progress: Simplify the progress calculations
For the delta case we can get perfect results by just ignoring
the counts and relying on the sizes. However, this needs a
recent ostree that supports the fetched-delta-part-size field.

For the object case we keep using the object average size
to estimate a size which we can compare with the extra data
size.
2017-05-18 15:14:42 +02:00
Alexander Larsson
fbd5452aac progress: Use the new atomic progress API
We read everything at once, which means we will not
race against the download thread possibly updating the
values.
2017-05-18 12:28:57 +02:00
Alexander Larsson
fcb59afe7a Require ostree 2017.6 for the new progress APIs 2017-05-18 11:30:18 +02:00
Alexander Larsson
7ac5d41bea Use the nicer progress reporting for the CLI too
We now use the same progress calculations as in libflatpak
so we get a nice progress bar also in the CLI.
2017-05-18 09:51:35 +02:00
Georges Basile Stavracas Neto
6924658f59 Improve progress report calculation
Now that we have access to the total extra-data download size,
we can have much more precise progress reports by summing up
all the download sizes from OSTree and extra-data.

This patch makes the progress report callback use the extra-data
sizes, as well as calculate the average size (in bytes) of the
content.

flatpak/flatpak#609
2017-05-18 09:02:02 +02:00
Alexander Larsson
e7ad74c398 run: Fix race condition in app identification
There is a race condition in how the portals detects the peer app-id.
If we manager to open /proc/$pid/root, and then openat(fd,
".flatpak-info"), but the process dies inbetween the two, then the
.flatpak-info read-only bind mount (and all other mounts in the
namespace except the root one) is unmounted, so we will find
and empty .flatpakinfo file.

We fix this race by storing the contents in a regular file, but
also as a readonly bind mount on top of it.

For typical dbus portals the pid is the dbus proxy though, and in
that case the app can't modify the file, so we make it just
a file there instead of file + bind-mount.
2017-05-17 15:06:03 +02:00
Alexander Larsson
461084d1a9 builder: Add a install-rule to allow customized install
Fixes: https://github.com/flatpak/flatpak/issues/791
2017-05-15 09:38:22 +02:00
Alexander Larsson
4774b3c80f builder: Take "buildsystem" into consideration for cache freshness 2017-05-15 09:38:22 +02:00
Balázs Úr
f69c39eb9c [master] Updated Hungarian translation 2017-05-15 09:15:20 +02:00
Alexander Larsson
e3db39ea8f Require latest flatpak (2017.5)
This allows us to rely on the new BARE_USER_ONLY mode, as
well as the fixes to progress reporting. Also, it has a lot
of bugfixes that are nice. If you need an old ostree you can
run the old flatpak series.
2017-05-12 16:30:14 +02:00
Georges Basile Stavracas Neto
222c525910 dir: Report progress more frequently
Flatpak relies on OSTree to report the progress, and
OSTree's progress report frequency fallbacks to 1 second.

Recently, however, OSTree received support for setting
custom update frequencies. Since it relies on GVariant
options, if the user has an older OSTree, it'll simply
be ignored.

This patch, then, makes Flatpak report progress every
100ms rather than the default value of 1 second.

flatpak/flatpak#609
2017-05-12 16:16:03 +02:00
Matthias Clasen
514886dd13 Document flatpakref format extensions
gnome-software is reading some extra keys. Document them.
2017-05-12 12:27:16 +02:00
Matthias Clasen
b232c9e1fa Document flatpakrepo format extensions
gnome-software is reading some extra keys. Document them.
2017-05-12 12:27:16 +02:00
Alexander Larsson
3e9bc8ba7a Rewrite exported mimetype files
We only allow globs, not magic matches, and we drop the glob
priority to a very low level (weight=5) which means that its
hard for app-installed mimetypes to override the system installed
ones. That should make exporting mimetypes pretty safe.
2017-05-11 18:16:13 +02:00
Alexander Larsson
050fe4e795 exports: Fix up exporting of dbus service files
The relative paths for the symlinks in the table was wrong.
2017-05-11 17:20:32 +02:00
Alexander Larsson
2ebf672866 Disable exported search providers by default
Installing a search provider is a minor security issue, as it
can see all that you search for in the desktop, so we rewrite
these so that they are always disabled by default. The user
can then chose to enable it if he wants.
2017-05-11 16:04:45 +02:00
Alexander Larsson
e8369a69ef install: Limit the exported file to a whitelist
Instead of exporting any files we add a whilelist
of directories that get exported:

 share/applications
 share/icons
 share/dbus-1/services
 share/gnome-shell/search-providers
 share/mime/packages

This avoids potentially installing some kind of file that the
host system reads and interprets in a risky way.

Applications and dbus services are safe because we rewrite them.
Icons are safe as long as the image loaders are, and if they are
not we have worse problems.
Search providers and mime formats are somewhat problematic, and
follow-up commits will rewrite these to be safer.
2017-05-11 15:28:19 +02:00
Alexander Larsson
373d2155ec deploy: Verify that xa.metadata in the commit matches the deployed file
We may have made decisions based on the permissions listed in the
metadata in the (signed, thus trusted) commit. However, at runtime
we actually look at the metadata file that is deployed. Make sure
these are the same by comparing them when we deploy.
2017-05-11 14:13:44 +02:00
Alexander Larsson
98e749202a update: Fix update for partial commits with system-helper
When we're pulling via the system-child repo we don't inherit
the commitpartial state from the parent, so we didn't know a
commit was partial, so the full contents was not downloaded.
This fixes updating a partial install to the same commit, but
with different subsets.
2017-05-11 13:58:46 +02:00
Alexander Larsson
b5c66a7689 update: If resused ostree repo fails, blow it away and create new
This happened to me because I had some leftover from a test run
that failed. But could happen for other reasons.
2017-05-11 13:57:43 +02:00
Alexander Larsson
703a0d7900 update: flatpak update --subpath= means all subpaths 2017-05-11 12:44:15 +02:00
Alexander Larsson
529c3bbaf1 deploy: Append the subdirs to the checkout dir
This allows us to easily move between different partial
installs of the same commit id.
2017-05-11 12:43:30 +02:00
Alexander Larsson
093b60c157 deploy: Uncouple active link from checksum
We don't guarantee that the active link is identical to the
checksum anymore. If you really need the checksum you have
to look at the deploy data.

This is mainly changing the names from "checksum" to "active_id"
in the code that touches the active link, except the case where
we're undeploying after an update. We then use the old active
link value rather than the old commit id as the undeploy id.

This will allow us to have partial deploys with different names
than the full or differently partial deploy.
2017-05-11 12:40:36 +02:00