Commit Graph

394 Commits

Author SHA1 Message Date
Alexander Larsson
354164db8b import: Use pull_from_oci helper 2016-12-09 14:45:10 +01:00
Alexander Larsson
791c448653 Use the shared OCI code for import-bundle 2016-12-08 17:43:06 +01:00
Alexander Larsson
4672bc835e Update build-bundle --oci to use the new shared OCI support 2016-12-08 17:43:06 +01:00
Ignacio Casal Quinteiro
210089a066 install: fix error message
So we avoid an error message like:
error: Can't load uri XXXXUnacceptable TLS certificate
2016-12-07 19:54:13 +01:00
Alexander Larsson
bb6e1d535f install: Support RuntimeRepo= key in flatpakref files
This allows an app to point to the repo where the runtime it uses
comes from, and the user will be asked to add that if its not
already configured.
2016-12-02 16:31:14 +01:00
Alexander Larsson
4e43dc8ae8 build-import-bundle: Sign commit if gpg key specified 2016-12-01 16:08:52 +01:00
Alexander Larsson
cc7402d6f7 commit-from: Add --force support 2016-11-30 18:09:19 +01:00
Alexander Larsson
ad7e016349 repo-update: Don't leak from_parent 2016-11-28 16:12:38 +01:00
Alexander Larsson
3e9ce0034e repo-update: Don't leak delta_data 2016-11-28 16:12:21 +01:00
Alexander Larsson
ddb40187c6 Fix various leaks found by valgrind 2016-11-28 15:17:04 +01:00
Mario Sanchez Prada
2c05e868d9 Fix wrong reference to the user installation instead of the system one
This seems like a simple typo introduced in eeaa8320, which is causing
to ignore the system installation when auto completing.
2016-11-25 08:46:48 +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
3896c8d683 Support relative pathnames in various --gpg=FILE commandline options
We juse use g_file_new_for_commandline_arg instead of g_file_new_for_path.
This is somewhat related to https://github.com/flatpak/flatpak/issues/401
but doesn't actually handle the specific case of tilde.
2016-11-15 10:44:26 +01:00
Alexander Larsson
a8e1738860 build-finish: Don't warn for all non-valid names during export
Its pretty common to e.g. ship an icon theme bundled in the app,
but you then don't want to have a warning for every file.
So, instead make this a debug message.
2016-11-11 14:55:27 +01:00
Alexander Larsson
f48e863f4b oci: Don't allow closing the json writer twice
We're already checking if self->str != NUL before we get the
string, but closing the writer assumes self->str != NULL.
2016-11-11 10:53:05 +01:00
Alexander Larsson
966457593d build-sign: Don't crash if ref not found
As reported in https://github.com/flatpak/flatpak/issues/388
2016-11-11 10:42:29 +01:00
Mario Sanchez Prada
e06e560f50 Fix typo when checking for installed refs in the system installation 2016-11-03 11:16:43 +00:00
Alexander Larsson
6e31932221 OCI: Generate an oci image dir structure instead of a runtime 2016-10-31 20:11:14 +01:00
Alexander Larsson
fbf663ac91 remote-add: LOCATION is not optional
Fixes https://github.com/flatpak/flatpak/issues/377
2016-10-31 08:56:45 +01:00
Alexander Larsson
f0380434e1 Remove check for OstreeRepoExportArchiveOptions.path_prefix
We now hard-depend on a recent enough ostree that has this.
2016-10-28 11:02:40 +02:00
Alexander Larsson
4487d78e4e Allow remote-add --from --no-gpg-verify
This overrides the requirement of the gpg key found in the flatpakref
which can be useful at times.

This fixes: https://github.com/flatpak/flatpak/issues/369
2016-10-26 20:46:35 +02:00
Alexander Larsson
47906593b8 When installing to the system dir, don't consider --user dependencies
It makes no sense to allow you to install an application systemwide
if it only works for your user. However, its generally fine if to
install a per-user app that relies on a system-installed runtime.

In particular, this fixes installing system-wide extra-data apps where
we need the runtime to be system-installed to run the unpack script.
2016-10-26 20:41:33 +02:00
Alexander Larsson
224c4ee9e6 update --appstream: Don't stop at first error 2016-10-25 14:53:11 +02:00
Alexander Larsson
294c9bd7c3 update --appstream: Actually handle remote argument if specified 2016-10-25 14:39:55 +02:00
Alexander Larsson
f8e405d212 install --from: Re-read config after adding origin remote 2016-10-25 10:50:47 +02:00
Mario Sanchez Prada
dbaaf65d3b Use g_key_file_load_from_data() instead of g_key_file_load_from_bytes()
The g_key_file_load_from_bytes() function was added in GLib 2.50, and that
is too high as flatpak wants to support centos7/rhel7, which is now in 2.42.
2016-10-24 11:45:57 +01:00
Alexander Larsson
509a358ba3 Make looks_like_branch better
Fixes https://github.com/flatpak/flatpak/issues/359
2016-10-21 21:42:37 +02:00
Alexander Larsson
c3bea6c8fc remote-add: Assume --from if location ends with .flatpakrepo
If you try to set the flatpakrepo uri as a repo uri for a new remote
things get really confused, so lets try to do the right thing anyway.
2016-10-21 12:46:38 +02:00
Alexander Larsson
25e39dfddd build-finish: Add --extra-data= argument 2016-10-21 08:57:42 +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
f3c71cfbf8 build-export: Read Extra Data section and put in commit metadata
If you put a section like:

[Extra Data]
uri=https://sdk.gnome.org/gno%6De.flatpakrepo
checksum=ace1b504d32eefdf05b53044e6f785fe7886cc5657b5df034c3b9ac8e3aeb70c
size=1335
uri2=http://sdk.gnome.org/gedit.flatpakref
checksum2=d8baa109fb5fdcfe90379f3e93c5ab29f11772b42bf569bb3481e4aff489b0dd
size2=1472
name2=renamed.flatpakref

Then this information will be put in the commit object and the
later will be used when downloading the app.
2016-10-21 08:57:42 +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
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
68a0e7f8f5 build-finish: Fix usage output
It was using the build-bundle output instead.
2016-10-19 12:53:16 +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
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
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
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
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