Commit Graph

72 Commits (2618a19716856d2b107acc0b5b63838e1379ef45)

Author SHA1 Message Date
Colin Walters 2618a19716 Import ostree's compiler warnings, fix up callers
In ostree I maintain what I consider a "baseline" set of compiler
warnings that should *always* be fatal for a modern C project.

I noticed while working on a previous patch that a `-Werror=format`
warning wasn't fatal.

There are a few that are really, really important like
`-Werror=missing-prototypes`. I also take some like `-Werror=misleading-indentation`
which already caught some bugs.  See also https://lwn.net/Articles/678019/
2017-03-27 10:42:36 +02:00
Colin Walters 64fd2c2a8d Bump libglnx, use new glnx_throw(), fix callers
One benefit here becomes immediately obvious - `flatpak_fail()` was lacking
`G_GNUC_PRINTF` which meant we missed a lot of type checking. Fix up the
callers.
2017-03-27 10:42:36 +02:00
Alexander Larsson 49b5304589 Update OCI support to latest version of spec
This is a major change in the OCI support, as the format of the OCI image
registries changed. Instead of now having a "ref" file for each image
in the repo it has a single index json file, where the ref name is now
a per-image annotation.

This allows us to support OCI much better, as we can now use the actual
flatpak ref as the OCI ref name, and we can find all the flatpak refs
in a remote.

So, with this you can just use:
 flatpak remote-add --oci remote-name URL

and then you can use the regular flatpak operations on the remote.
2017-03-13 14:31:36 +01:00
Richard Hughes d6f4ea424d Allow specifying an ISO-8601 timestamp when using build-export
This allows us to build reproducable repo summaries, for instance in self tests.
2017-03-06 11:38:26 +01:00
Alexander Larsson 2c71298d53 builder: Its break_hardlink, not unbreak_hardlink 2017-02-22 09:43:57 +01:00
Alexander Larsson 082efe8951 Properly quote all commandlines we print
Fixes https://github.com/flatpak/flatpak/issues/236
2017-02-21 18:56:11 +01:00
Alexander Larsson 50c9812a56 utils: Remove unused/broken autorm_rf 2017-02-21 11:50:41 +01:00
Alexander Larsson 5a3c7feb15 builder: Unbreak hardlinks when eu-stripping
Otherwise this breaks with rofiles-fuse if the build produces
hardlinked installed files. For instance, as done by mesa.
2017-02-15 19:22:14 +01:00
Alexander Larsson 8c131be4f6 utils: Add missing Ostree autoptr types 2017-02-15 16:09:48 +01:00
Alexander Larsson 08ea3baf49 builder: Download files and archives directly to disk, don't keep them in memory.
This works much better for larger sources.
2017-02-09 12:26:05 +01:00
Alexander Larsson bf316c1a82 builder: Compute SHA256 while downloading archives 2017-02-09 12:17:10 +01:00
Alexander Larsson 02202b9e76 utils: Add flatpak_copy_bytes
This copies data from one fd to another.
2017-02-07 16:39:23 +01:00
Alexander Larsson 2e453048e0 extensions: Support enable/install-if=active-gl-driver
Only use/download this extension if it matches an active gl driver.
2017-02-03 09:49:05 +01:00
Alexander Larsson d4d15c7211 Initial flatpak_get_gl_drivers() implementation
This is supposed to list all the currently loaded "non-standard" gl drivers.
If FLATPAK_GL_DRIVERS is set, then that is used, otherwise it looks
for an nvidia driver and if so, uses that, and always adding "default"
at the end which is meant to resolve to a stable mesa fallback build, as
well as "host" which can be used if you have a host-side driver
as an unmaintained extension.
2017-02-03 09:48:16 +01:00
Alexander Larsson c88f1aa835 extensions: Support merge-dirs=list..
This causes the listed directories to become symlink farms
into all the subdirectory extensions.
2017-02-02 13:56:34 +01:00
Alexander Larsson 5e1d456b8b extensions: Support subdirectory-suffix=foo
If directory is "foo" and the extension id ends with ".ext" and
subdirectory-suffix is "sub" then the extension point will
be "/usr/foo/ext/sub" rather than just "/usr/foo/ext".

This is very useful when the extension point naming scheme is
"reversed". For instance, this happens for the /usr/share/themes directory.
An extension point for a gtk3 theme would be in /usr/share/themes/$NAME/gtk-3.0,
which could be achived by using subdirectory-suffix=gtk-3.0.
2017-02-01 19:59:12 +01:00
Alexander Larsson a3da0b3da8 extensions: Add add_ld_path property
If your extension points set this, then each extension will have
the corresponding subdirectory added to LD_LIBRARY_PATH.

We also support a priority property in the ExtensionOf group
in the extensions themselves to set the search order.
2017-02-01 19:46:25 +01:00
Alexander Larsson 592bea2b2e Don't break if exporting paths or symlinks to files in the runtime
For instance like in https://github.com/flatpak/flatpak/issues/494
if there is a /linuxrc -> /bin/busybox symlink, and /bin/busybox
is not in the runtime then we will fail creating it as a mountpoint
for the bind mount.

Fixes https://github.com/flatpak/flatpak/issues/494
2017-01-19 10:43:17 +01:00
Alexander Larsson f20e5f7823 bundles: Support dependencies and runtime-repo
If the bundle contains an origin link we can now install related
things from it, such as locale data.

You can also build the bundle with --runtime-repo=URL, where the url
points to a flatpakrepo file for a repo with runtimes. This works
similar to the RuntimeRepo= feature in flatpakref files.
2016-12-20 16:27:57 +01:00
Alexander Larsson c756534b19 utils: Add and use FLATPAK_VARIANT_DICT_INITIALIZER
This fixes warnings on some versions of glib due to a private struct
change.
2016-12-13 10:08:26 +01:00
Alexander Larsson 9ddc4aca48 Support flatpak install --oci to install apps from OCI 2016-12-12 16:22:16 +01:00
Alexander Larsson 53c28de636 utils: Add VARIANT_BUILDER_INITIALIZER and new_empty_string_dict 2016-12-12 12:23:13 +01:00
Alexander Larsson cf0cd287c6 Add flatpak_table_printer_add_column_len 2016-12-12 12:22:50 +01:00
Alexander Larsson aa9640af7e Add flatpak_pull_from_oci helper 2016-12-09 14:44:25 +01:00
Alexander Larsson 186ff0f002 Add flatpak_download_http_uri util function 2016-12-08 16:41:20 +01:00
Alexander Larsson e514dc2e14 Add flatpak_create_soup_session 2016-12-08 16:41:20 +01:00
Alexander Larsson 6a5d6d4970 Json autoptr stuff was added in 1.1.2, not 1.2.0 2016-11-30 11:30:40 +01:00
Alexander Larsson b744cd2493 Add backport of g_autoptr support for json-glib 2016-11-29 10:14:33 +01:00
Alexander Larsson ca99d5be58 build-init: Give error if initializing with a partial dependency
If you're building a runtime and have a base runtime with expected
extensions, fail to build if the actually installed extension is
partial (i.e. if it has a subdir specified).

Fixes https://github.com/flatpak/flatpak/issues/390
2016-11-15 11:11:00 +01:00
Alexander Larsson 18ad54b4a0 utils: Add utils to read and resolve symlinks 2016-11-11 22:17:56 +01:00
Alexander Larsson 81c55d752a Add backport of SoupRequestHTTP autoptr support 2016-10-25 16:14:44 +02:00
Jan Jedelský 47e9283450 Add support for unmaintained extensions (#361)
See https://github.com/flatpak/flatpak/issues/167
2016-10-25 10:25:15 +02:00
Alexander Larsson 906b3b5871 dir: When pulling/deploying an app, support xa.extra-data-sources
If the downloaded app has a "xa.extra-data-sources" property in
the commit, then we download these as part of the pull operation
and store the result in the commitmeta object in the repo.

Then during deploy we look at the xa.extra-data-sources properties
again and extract them from the commitmeta into /app/extra
in the app, and afterwards we run /app/bin/apply_extra in a minimal
sandbox that has read-write access to /app/extra, but nowhere else.

There are some complexities:

We need to re-verify when extracting, because the commitmeta is not
really signed, so we could have picked up random stuff there
from the upstream repo, or from an attacker misusing the system-helper
local install codepath.

When using the system-helper the pull will fail if the commitmeta
is to large, so we have some code in this case to manually transfer
the larger commitmeta on the side to the local-pull code.
2016-10-21 08:57:42 +02:00
Alexander Larsson 9c3f77da3a utils: Add flatpak_load_http_uri helper function 2016-10-21 08:57:42 +02:00
Alexander Larsson 28261d839e update/install: Install/Update runtime dependencies as needed
When an application requires a runtime that is not installed, search
for it and prompt for permissions to install it. Also, update required
runtimes when the app is being updated.
2016-10-19 12:40:49 +02:00
Mario Sanchez Prada 81d1bef4a0 Support --default-branch when updating the repository summary file
Add support for this flag in build-update-repo, so that we can define
a default branch in the server side, to be picked by the clients.

https://github.com/flatpak/flatpak/issues/221
2016-10-14 16:23:15 +01:00
Alexander Larsson 70e9b2c737 update: Support specifying multiple arguments 2016-10-14 16:39:10 +02:00
Alexander Larsson 7018717ce2 install: Support installing multiple apps at the same time
Instead of using "NAME [BRANCH]" as the command list we now
support REF..., where each REF can be partial. This is easiest
explained by examples. Here are some valid refs:

  org.test.App - only app id
  app/org.test.App/x86_64/stable - full ref
  org.test.App/x86_64/stable - full ref without prefix
  org.test.App - only app id
  org.test.App//stable - only branch
  org.test.App/x86_64 - only arch

If any parts are left out they are wildcarded. Such parts are filled
first by looking at other command line arguments like --arch and
--app/--runtime. And finally by looking at what is available in the
remote. If there are multiple matches the user is told the options
in an error message.
2016-10-14 15:45:16 +02:00
Alexander Larsson c3606392aa common: Make flatpak_split_partial_ref_arg more regular and capable
Instead of in-place editing we return proper new strings. We
also handle kinds, both the defaults and supporting app/ and runtime/
prefixes.
2016-10-14 12:08:37 +02:00
Alexander Larsson c23316cb5d Add FlatpakKinds flag and use instead of booleans 2016-10-14 11:20:53 +02:00
Alexander Larsson af76206ba5 common: Add flatpak_variant_builder_init_from_variant 2016-09-27 12:39:27 +02:00
Matthias Clasen 06c7aca9f9 Make flatpak_is_valid_branch set a GError
Return detailed information about the problem with the branch in
the GError. Update all callers.
2016-09-13 13:28:42 -04:00
Matthias Clasen b2b281e485 Make flatpak_is_valid_name set a GError
Return detailed information about the problem with the name in
the GError. Update all callers.
2016-09-12 23:25:54 -04:00
Alexander Larsson e16ca25a67 utils: Change flatpak_invocation_lookup_app_id to lookup_app_info
This lets you get the entire app info rather than just the id.
For host processes you'll get an empty info with just an empty
name.
2016-09-08 12:37:32 +02:00
Alexander Larsson e6a85a7fdd utils: Fix support for old glib without g_autoptr 2016-09-06 09:26:02 +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 ff6839a291 utils: Add flatpak_is_in_sandbox() helper 2016-09-05 11:54:12 +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 54c5f9a59e Allow specifying partial refs as name in commands
The commands: install, update, uninstall, info, make-current and run
now supports specifying a partial ref for the name. This is a different
way of specifying optional arch and branch arguments.

For instance org.app.App//master is the same as "org.app.App master" or
"--branch=master org.app.App".

This is useful if you're cutting and pasting from e.g. the list -d output.
2016-08-24 09:18:00 +02:00
Alexander Larsson 6578d37984 Drop libgsystem dependency 2016-08-22 16:00:33 +02:00