Commit Graph

2210 Commits (7f31a1acae8f9825ccd083cf450cf411e467fb68)
 

Author SHA1 Message Date
Alexander Larsson 0695712152 lib: Don't list updates from disabled remotes 2016-10-21 08:46:57 +02:00
Alexander Larsson daa2d79fd1 transaction: Fix error reportin in case an update fails 2016-10-20 14:26:38 +02:00
Alexander Larsson 9a45517536 update: Make --commit=ID actually download that commit
Before it would fail if the commit wasn't accidentally locally.
2016-10-20 09:15:10 +02:00
Alexander Larsson 041d3eeb39 Add generic static permissions to metadata
This allows you do do something like
  flatpak build-finish --add-policy=subsystem.key=v1 --add-policy=subsystem.key=v2

Which maps to this metadata keys:

[Policy subsystem]
key=v1;v2;

You can also --remove-policy to remove values from a key.

The policy values are parsed from the app and runtime metadata, and
are overridable by per-app overrides and on the command line, however
the values are never used by flatpak. They do end up in the flatpak-info
file for the running application though, so external agents can look
at them.

These
2016-10-19 20:39:17 +02:00
Alexander Larsson 27654ceb2f FlatpakDir: Fix timeout of summary cache
There was a msec/usec mismatch in the code that made
the summary cache time out 1000 times to soon.
2016-10-19 18:39:11 +02:00
Alexander Larsson 1ea064c9b0 update: Add back support for --commit= 2016-10-19 18:12:50 +02:00
Alexander Larsson f117985e37 remote-add: Make --from a boolean arg instead of a string arg
So before you did:
 flatpak --user remote-add --from=https://sdk.gnome.org/gnome.flatpakrepo gnome
Now you do:
 flatpak --user remote-add --from gnome https://sdk.gnome.org/gnome.flatpakrepo

This is a somewhat break, but this means we handle --from the same in
remote-add and install, which seems important.
2016-10-19 18:00:12 +02:00
Alexander Larsson 4c037b5381 install: Support http uris in install --from
This means you can do this:
     flatpak --user install --from https://sdk.gnome.org/gedit.flatpakref
2016-10-19 17:50:39 +02:00
Alexander Larsson f9c1cc40bb run: Support running a runtime directly
This means you can do:
  flatpak run org.freedesktop.Sdk
to get a shell in a sandbox with that runtime, but with an
empty /app.

You can also specify a particular runtime branch and command like so:
  flatpak run --command=ls org.gnome.Platform//3.22 /
2016-10-19 17:33:00 +02:00
Alexander Larsson 944c1d58c7 tests: Add suppression for ostree static delta valgrind issue
I filed this upstream as:
 https://github.com/ostreedev/ostree/issues/533

Lets ignore it for now so we can use valgrind tests for the flatpak
parts.
2016-10-19 13:21:29 +02:00
Alexander Larsson 5e4f46f9c2 tests: Make the valgrind based checks default to not checking for leaks
Use FLATPAK_TESTS_VALGRIND_LEAKS to check for leaks.
We're not currently passing the leak checks, so this helps letting
us make valgrind checks useful.
2016-10-19 13:13:30 +02:00
Alexander Larsson 68a0e7f8f5 build-finish: Fix usage output
It was using the build-bundle output instead.
2016-10-19 12:53:16 +02:00
Alexander Larsson 89244ee71f system-helper: Add debug spew for all system helper calls
This helps when debugging failures.
2016-10-19 12:41:08 +02:00
Alexander Larsson e1527c9347 system-helper: Correctly return ALREADY_INSTALLED error on noop deploy
This was breaking the test suite
2016-10-19 12:41:08 +02:00
Alexander Larsson c70c453eab remote-add: Support installing .flatpakrepo files from http uri 2016-10-19 12:41:08 +02:00
Alexander Larsson 0999def431 uninstall: Only try to uninstall related apps that are installed 2016-10-19 12:41:08 +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
Alexander Larsson b2af78fb6f remotes: Add no-use-for-deps property
If this is set for a remote we will never automatically look for
dependencies in it. This makes dependency search faster, as we
don't need to search in app-only remotes.
2016-10-19 11:34:22 +02:00
Alexander Larsson 94295873e9 Summary cache: Fix valgrind report
We need to use g_hash_table_replace() to avoid the old freed key being
left in the hashtable.
2016-10-19 11:34:22 +02:00
Alexander Larsson 3b461a6c5a Merge pull request #354 from mariospr/default-branch
Only override the default branch, if needed, after splitting a ref
2016-10-18 12:11:56 +02:00
Mario Sanchez Prada 5c1bf1e3d9 Only override the default branch, if needed, after splitting a ref
Otherwise we'll be always trying to force the installation from the
default branch for a repo, regardless of whether the app being
installed is available for that branch.
2016-10-18 11:09:02 +01:00
Alexander Larsson 0f05143227 builder: Handle the case where the source directory is in a symlink
It can happen, like in https://github.com/flatpak/flatpak/issues/353
that there are references in the source to the absolute source path.
We need to ensure that is visible in the build. We mostly do this,
but for technical reasons it didn't get the same pathname when
the source was inside a symlinked directory. We fix this with an
extra bind-mount to the symlinked directory name too.

This fixes https://github.com/flatpak/flatpak/issues/353
2016-10-18 11:06:43 +02:00
Alexander Larsson 6345f0bae7 build-finish: Support exporting more than hicolor icons
We really want apps to be able to export e.g. HighContrast icons too.
2016-10-18 10:14:10 +02:00
Alexander Larsson 3c2b8a92b1 FlatpakDir: Fix leak in fetch_remote_title/default_branch
We were not freeing the GVariant returned by g_variant_dict_end.
In fact, we don't need the GVariantDict at all.
2016-10-18 10:10:03 +02:00
Alexander Larsson cb744c2d13 tests: Fix assert comming from ostree
It seems that ostree_repo_remote_fetch_summary asserts if you
pass a NULL error, so lets not do that.
2016-10-18 10:09:09 +02:00
Alexander Larsson e8cf8be8ab install: Check that runtime is installed before installing app 2016-10-17 17:54:35 +02:00
Alexander Larsson 9bb630d674 update: Don't reorder arguments 2016-10-17 17:33:10 +02:00
Alexander Larsson b2cc643f2c install: Actually handle more than two REFs 2016-10-17 17:28:28 +02:00
Alexander Larsson d248f0887b install: Don't print error if related refs were already installed 2016-10-17 17:28:09 +02:00
Alexander Larsson aa081420a4 Fix whitespace issues 2016-10-17 17:27:51 +02:00
Alexander Larsson 8df193bc37 update: Fix completion of options 2016-10-17 17:27:34 +02:00
Alexander Larsson ee0ffbcb35 uninstall: Support multiple REFs 2016-10-17 17:27:16 +02:00
Alexander Larsson 5b11c03adc install: Don't override default_branch specified on commandline
Fixes issue pointed out in review at:
 https://github.com/flatpak/flatpak/pull/345
2016-10-17 12:34:32 +02:00
Alexander Larsson 0abdcd3f03 Merge pull request #345 from mariospr/issue221
Add server-side support for default-branch for remote repositories
2016-10-17 12:31:07 +02:00
Alexander Larsson b337c95d78 dbus proxy: Tight down what is allowed to send to the bus
Make sure we can only send message calls (not e.g. unicast signals)
to the bus. Also, whitelist the list of allowed interfaces to
org.freedesktop.DBus and org.freedesktop.DBus.Introspectable

See https://github.com/flatpak/flatpak/issues/343 for the origin
discussion of this.
2016-10-17 12:19:46 +02:00
Alexander Larsson 4cb3f7fd79 builder: Support application inheritance
When initializing a build you can initialize the application directory
with the files from another directory, and optionally a set of its
extensions. This allows one to create a "base" application that
can be derived from in multiple forms. A typical example is an application
framework like Electron. The base electron app has all the dependencies
needed to write Electron app, and then your manifest can add the specific
files needed for your application.

An example snipped could look something like:

    "base": "org.base.App",
    "base-version": "stable",
    "base-extensions": ["org.base.app.Locale", "org.base.app.Debug" ],
2016-10-17 11:40:57 +02:00
Alexander Larsson d628350794 build-init: Support --base to create an application based on another 2016-10-17 11:37:19 +02:00
Alexander Larsson c1cc0b362a build-init: Factor out helper function copy_extensions() 2016-10-17 11:04:18 +02:00
Alexander Larsson a9c924928c builder: Add runtime-commit to resolved manifest
Apparently this must have been forgotten when sdk-commit was added.
2016-10-17 10:19:36 +02:00
Matt Watson b9521e719b builder: add allow missing runtimes options
The --allow-missing-runtimes options will allow flatpak builder to
not abort immediately if the sdk or runtime for the app being built
are missing.

This option will be useless when building anything in the modules
section of the app manifest. The calls to flatpak-build will fail
because of the missing sdk.

However, it may be useful when an application does not require
building anything inside the sandbox, and the application files
will be installed via other means.
2016-10-17 09:49:34 +02:00
Matt Watson e968b87f6a builder: add a build finish option
With the option you can resume an application build where it left
off when calling flatpak-buidler --build-only
2016-10-17 09:49:34 +02:00
Alexander Larsson f9ed36e092 docs: Fix docs for no-debuginfo
This was documented in reverse, see:

https://github.com/flatpak/flatpak/issues/349
2016-10-17 09:42:56 +02:00
Alexander Larsson da0204f4c8 bubblewrap: Update to 0.1.3 to fix CVE-2016-8659
There was a security issue for builds that used a setuid installation
of bubblewrap. Update the in-source version to one that has the fix.
2016-10-17 08:55:47 +02:00
Alexander Larsson 274e30310b Post-release version bump 2016-10-17 08:54:22 +02:00
Mario Sanchez Prada 8decac7d7f Added new public API: flatpak_installation_update_remote_sync()
Provides access to the functionality offered by the new internal API
flatpak_dir_update_remote_configuration(), in a similar way to what
can be done via the command 'flatpak remote-modify --update-metadata'.
2016-10-14 16:42:17 +01:00
Mario Sanchez Prada 2cbb1da935 Added new parameter for the remote-modify built-in command: --update
This new command relies on flatpak_dir_update_remote_configuration()
and allows updating the local configuration for the remotes based on
the extra metadata present in the OSTree repo's summary file.

This parameter can still be combined with --title and --default-branch,
which take precedence when combined with --update.
2016-10-14 16:42:17 +01:00
Mario Sanchez Prada 7e5f2580a6 New internal API to update configuration of remotes from their summary file
The new function flatpak_dir_update_remote_configuration() can be called
to fetch the contents of the summary file from the remote's source location
and update the local configuration in the installation directory accordingly.

For now, only the xa.title and xa.default-branch configuration parameters
are supported, since those seem to be the only relevant ones at the moment.
2016-10-14 16:42:17 +01:00
Mario Sanchez Prada 44dcc77a18 Check and use the remote's default branch when installing flatpaks
If no branch is explicitly stated when installing a flatpak, and several
options (branches) are available for the same ID, we now check the remote's
default branch and use that one, if it's defined and available for the app.

https://github.com/flatpak/flatpak/issues/221
2016-10-14 16:42:17 +01: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
Mario Sanchez Prada 69831c60ca Check flatpak_remote_get_default_branch() in test-lib.c 2016-10-14 16:23:15 +01:00