Commit Graph

409 Commits

Author SHA1 Message Date
Mario Sanchez Prada
22e3f83fb6 Remove internal API flatpak_dir_get(gboolean user)
User and system installations is no longer a binary decision, so remove
this API to force explicit calls to either flatpak_dir_get_system_default()
or flatpak_dir_get_system_list() when dealing with system installations.
2016-12-16 19:17:18 +00:00
Mario Sanchez Prada
521c3fcd4b Rename flatpak_dir_get_system() into flatpak_dir_get_system_default()
There will be a way to retrieve the list of all system installations,
not just the default one, so we rename this for backward compatibility.

Note that some (most?) of the places where we will be now using this
renamed function will likely have to migrate to using specific system
installations, but we don't have the necessary APIs yet so we do this
as an initial step to all the incremental changes that will come next.
2016-12-16 19:17:13 +00:00
Alexander Larsson
cc85b93584 build-finish: Add --require-version and handling of it
This means that clients will refuse to install or update to your
new app if the flatpak version they are using is too old.
2016-12-14 13:48:51 +01:00
Matthew Leeds
a528db5b95 install: Fix typo 2016-12-14 09:17:24 +01:00
Alexander Larsson
e1bf3eff52 Flatpak[ref|repo]: Add Version field
If this is set it has to be 1, or we fail.
This lets us later introduce incompatible changes.
2016-12-13 15:54:14 +01:00
Alexander Larsson
5e80abd234 build-sign: Support empty id to mean sign all apps 2016-12-13 12:39:06 +01:00
Alexander Larsson
c4cea2489f remote-add/modify: Fix updating remote-metadata for config
We recreate the OstreeRepo object in order to flush out any configuration
changes done via the system helper, so that changing the configuration works.

Should fix https://github.com/flatpak/flatpak/issues/413.
2016-12-13 12:00:44 +01:00
Alexander Larsson
902d945f4f install/update: Support -y to avoid interaction (for automation)
This assumes the answer to any question is yes (or to pick the
most prioritized answer).

Fixes https://github.com/flatpak/flatpak/issues/436
2016-12-13 11:35:06 +01:00
Alexander Larsson
f6d1a064b9 Clean up docs/help for install and remote-add
This makes it easier how the different variants like --from and --bundle
work.

Fixes https://github.com/flatpak/flatpak/issues/438 and
https://github.com/flatpak/flatpak/issues/439
2016-12-13 11:19:06 +01:00
Alexander Larsson
057fbcb459 install: Make --from and --bundle optional
If the first argument has the right extension we just assume
you want to install from it.

This fixes https://github.com/flatpak/flatpak/issues/429 and
https://github.com/flatpak/flatpak/issues/415
2016-12-13 11:13:33 +01:00
Alexander Larsson
1e854ddc11 Fix all clang warnings 2016-12-13 10:20:28 +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
f65f0cb37c Merge branch 'wip/oci' 2016-12-12 16:26:35 +01:00
Alexander Larsson
9ddc4aca48 Support flatpak install --oci to install apps from OCI 2016-12-12 16:22:16 +01:00
Iago López Galeiras
27d01fc2d3 build-finish: Export MIME Types 2016-12-12 08:50:07 +01:00
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