This adds a new collection-id property which is only enabled if
FLATPAK_ENABLE_P2P is defined. The internal machinery for handling it is
always enabled, to reduce the amount of #ifdef spam.
Signed-off-by: Philip Withnall <withnall@endlessm.com>
Pass a --collection-id argument through to `flatpak build-export`.
Also add a ‘collection-id’ property to manifest files, which can be used
to set the collection ID on an exported repo (when using --repo) without
having to provide a command line option.
Signed-off-by: Philip Withnall <withnall@endlessm.com>
It will be used by builtins-repo-update in a following commit to allow
updating the collection ID for an upstream repo.
Signed-off-by: Philip Withnall <withnall@endlessm.com>
Also expose a new flatpak_remote_get_remote_type() API so that users can
query what type of remote something is — whether it’s a USB or LAN
remote, or something statically configured.
Make this all conditional on compiling with --enable-p2p.
Signed-off-by: Philip Withnall <withnall@endlessm.com>
Search for updates on peer to peer sources as well as the internet in
check_for_updates(), and pass the resulting OstreeRepoFinderResult array
to the pull() calls, so a consistent set of checksums are pulled.
Signed-off-by: Philip Withnall <withnall@endlessm.com>
This adds support in flatpak-dir.c for using the new libostree API for
finding remotes dynamically for a given set of refs, if flatpak is
configured with --enable-p2p.
The new code paths are only taken if the repository is configured with
a collection ID set.
These changes by themselves aren’t sufficient for full P2P support, as
all the infrastructure for downloading summary files and finding refs
needs to be modified in the following commits.
Signed-off-by: Philip Withnall <withnall@endlessm.com>
A series of following commits will introduce a peer to peer feature for
pulling apps and runtimes from LAN peers and USB sticks without needing
an internet connection. This requires experimental API in libostree
(which needs to have been configured with --enable-experimental-api), so
needs to be hidden behind a configure option in flatpak too. It’s called
--enable-p2p, and bumps our libostree dependency to 2017.8 with
experimental API required too.
Signed-off-by: Philip Withnall <withnall@endlessm.com>
This allows you to automatically install/update dependencies required
by the manifest. The dependencies include:
Runtime, Sdk, Base, Sdk Extensions and Platform Extensions
There is also a --install-deps-only switch to make the build
stop after the dependencies are installed.
Fixes https://github.com/flatpak/flatpak/issues/955
This includes a change in how ostree reports missing gpg signatures
which makes the test-suite pass. Additionally that change requires
us to change how we detect such missing gpg signatures in one place.
We could try to support both versions, but the easiest fix is to just
require the latest ostree.
flatpak_decompose_ref() can fail, but in this situation we know it won’t
since find_matching_refs() checks it for us and hence guarantees that it
only returns decomposable refs. Add some assertions to make this clearer
and to shut Coverity up.
Signed-off-by: Philip Withnall <withnall@endlessm.com>
Everywhere else that index->manifests is used, it’s checked for being
NULL beforehand, which probably means that, sometimes, it might be NULL.
Let’s check that here too.
Coverity issue: 1452432
Signed-off-by: Philip Withnall <withnall@endlessm.com>
use_builddir is TRUE if meson is TRUE, so there can never be a meson
case in the !use_builddir case.
Coverity issue: 1452428
Signed-off-by: Philip Withnall <withnall@endlessm.com>
If realpath() fails (unlikely) it returns NULL, which we later merrily
dereference. Fix that by taking the unexpanded path.
Also fix a minor indentation problem later on.
Coverity issue 1452435.
Signed-off-by: Philip Withnall <withnall@endlessm.com>
This prevents a resource leak, although not really in practice because
va_args are free on common platforms.
Coverity issue 1452430.
Signed-off-by: Philip Withnall <withnall@endlessm.com>
Previously they weren’t getting distributed unless the system helper was
enabled at configure time for distcheck. They should be distributed
unconditionally so the user can choose whether to enable the system
helper when they call configure.
Signed-off-by: Philip Withnall <withnall@endlessm.com>
Resolver errors are more likely in offline remote adds than IO
errors. Catch them first when we're downgrading metadata update
errors to a warning.
https://phabricator.endlessm.com/T17172
It uses inline for loop initialisers, which are a C99 feature. Set
-std=gnu99 like ostree.git does for its libglnx submodule.
Based on a patch by Georges Basile Stavracas Neto
<georges.stavracas@gmail.com>.
Signed-off-by: Philip Withnall <withnall@endlessm.com>
Updating the metadata at the end of adding a remote means that it fails
if we're offline, even if we have the .flatpakrepo file available.
Unlike the other error cases in the process, which mean the operation
really has messed up, the remote is actually usable even if the
metadata update fails, because future operations will grab the
summary and any new metadata - so we should change this to a warning
to allow the operation to succeed when we're offline.
https://github.com/flatpak/flatpak/issues/917
flatpak-builder was running into an assertion when --run was
used after a non-option. Catch this and exit with a clear error
message. Same for --show-deps
Currently, all conceivable configurations and installations of
flatpak require root to perform this operation. That may not be
the case in the future, but until then, we should warn when the
user is not root as the operation will fail.
Fixes https://github.com/flatpak/flatpak/issues/855
We were checking the prefix twice here, instead of
checking prefix and suffix, which was obviously the
intention.
This caused extensions with non-matching architectures
to be reported as related refs.
If xa.languages is not explicitly set, only use the current locale
if we are installing something per-user. For system-wide installs,
default to installing all locales.