Commit Graph

3162 Commits (86268f0cbc7aa511523573225f2165088a2fc465)
 

Author SHA1 Message Date
Philip Withnall ae7d960372 common: Support collection IDs in flatpak{ref,repo} and bundle files
These are loaded from the ref/repo/bundle metadata and added to the new
remote configuration.

Signed-off-by: Philip Withnall <withnall@endlessm.com>
2017-08-18 14:23:03 +02:00
Philip Withnall 4c395cec13 lib/ref: Add collection ID support to FlatpakRef
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>
2017-08-18 14:23:03 +02:00
Philip Withnall 5b002edf06 builder: Add collection ID support to the flatpak builder
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>
2017-08-18 14:23:03 +02:00
Philip Withnall f3c898da05 app: Add support for collection IDs to built-in flatpak commands
This sets the collection ID on remote configs and in commit metadata
when building flatpaks.

Signed-off-by: Philip Withnall <withnall@endlessm.com>
2017-08-18 14:23:03 +02:00
Philip Withnall b5860e8f2a common/utils: Add flatpak_repo_set_collection_id() helper method
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>
2017-08-18 14:23:03 +02:00
Philip Withnall 68ab12fce1 lib: List dynamic remotes in flatpak_installation_list_remotes()
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>
2017-08-18 14:23:03 +02:00
Philip Withnall 30a5cf8136 common: Support collections in check_for_updates() and forward the results
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>
2017-08-18 14:23:03 +02:00
Philip Withnall 0d6455aa5f common/dir: Support new experimental libostree API for finding remotes
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>
2017-08-18 14:23:03 +02:00
Philip Withnall 655e7ce5c3 build: Add an --enable-p2p configure option for the peer to peer feature
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>
2017-08-18 14:23:03 +02:00
Alexander Larsson f9a06a0fcd builder: Add --install-deps-from=REMOTE
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
2017-08-18 11:04:13 +02:00
Alexander Larsson 4e15d9a5f8 common: Add GSubprocessFlags to flatpak_spawnv
This is useful to e.g. hide stderr
2017-08-18 10:56:15 +02:00
Alexander Larsson 85ba1f75eb Require ostree 2017.10
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.
2017-08-15 18:41:44 +02:00
Matthias Clasen a2267359ed Merge pull request #965 from pwithnall/coverity
Various minor Coverity fixes
2017-08-15 08:28:30 -04:00
Philip Withnall cd2a555675 common/dir: Clarify the nullability of some variables
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>
2017-08-15 12:28:28 +01:00
Philip Withnall c157719616 common/dir: Avoid a potential NULL pointer dereference
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>
2017-08-15 12:27:28 +01:00
Philip Withnall ecbf42d7fa builder/utils: Remove an unnecessary if-condition
We unconditionally allocate s above, so it can’t be NULL.

Coverity issue: 1376586

Signed-off-by: Philip Withnall <withnall@endlessm.com>
2017-08-15 12:26:05 +01:00
Philip Withnall 0cd65edc8b builder/module: Drop some unreachable code
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>
2017-08-15 12:24:01 +01:00
Philip Withnall 2106b80965 builder/module: Fix a crash if realpath() fails
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>
2017-08-15 12:22:45 +01:00
Philip Withnall 4bb3f4da36 builder/context: Add a missing va_end() call
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>
2017-08-15 12:16:16 +01:00
Jonathan Lebon bb3ff4ac46 ci/build.sh: also install git 2017-08-14 16:05:59 +02:00
Jonathan Lebon 23b496f74f ci: bump tests to use F26 host & container 2017-08-14 16:05:59 +02:00
Matthias Clasen 2082b50871 Merge pull request #910 from matthiasclasen/language-config
Allow setting the locale subpaths in repo config
2017-08-04 01:57:06 +01:00
Matthias Clasen 1f60624472 Merge pull request #948 from pwithnall/build-system-helper
system-helper: Ensure template files are always distributed
2017-08-04 01:50:05 +01:00
Philip Withnall 4fb3f71475 system-helper: Ensure template files are always distributed
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>
2017-08-03 16:50:22 +01:00
Matthias Clasen ea0fc59119 Merge pull request #939 from piotrdrag/potfiles-update-170730
Update POTFILES.in
2017-07-31 13:25:52 +01:00
Matthias Clasen e40c736b3b Merge pull request #943 from handsome-feng/master
fix issues #942
2017-07-31 13:22:38 +01:00
handsome_feng c9de78fe34 fix issues #942 2017-07-31 17:44:26 +08:00
Piotr Drąg 8823f9a6d3 Update POTFILES.in 2017-07-30 15:25:17 +02:00
Alexander Larsson 9c06cbb360 Add support for --extra-sources-url=URL
This makes flatpak-builder look in the specified URL for mirrored
sources before downloading the original URL.
2017-07-29 17:43:10 +02:00
Matthias Clasen 776f3b17b9 Merge pull request #922 from chergert/wip/chergert/fix-855
flatpak-enter: warn when not running as root
2017-07-14 16:03:26 -04:00
Matthias Clasen 941caede42 Merge pull request #921 from ramcq/missing-app-crash
fix crash in flatpak info when app is not present in origin
2017-07-14 13:57:20 -04:00
Robert McQueen 230e18db7b fix crash in flatpak info when app is not present in origin 2017-07-14 12:21:32 +01:00
Matthias Clasen af95979559 Merge pull request #920 from ramcq/gh917
remote-add: also ignore resolver errors
2017-07-12 13:50:38 -04:00
Robert McQueen 5fccf0cc0d remote-add: also ignore resolver errors
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
2017-07-12 18:43:21 +01:00
Matthias Clasen 142ae56d2c Merge pull request #919 from pwithnall/glnx-c99
build: Add -std=gnu99 to libglnx CFLAGS
2017-07-12 11:16:34 -04:00
Matthias Clasen 25449047f8 Merge pull request #918 from ramcq/gh917
allow remote add to succeed when offline
2017-07-12 11:16:08 -04:00
Philip Withnall 59e4e3f72b build: Add -std=gnu99 to libglnx CFLAGS
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>
2017-07-12 15:58:50 +01:00
Robert McQueen f2dbaecf86 allow remote add to succeed when offline
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
2017-07-12 11:20:26 +01:00
Matthias Clasen eecdcbd195 Merge pull request #915 from matthiasclasen/fix-builder-run
Catch some more errors in option parsing
2017-07-10 06:26:02 -04:00
Matthias Clasen 9ef22bed1d Catch some more errors in option parsing
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
2017-07-09 23:06:00 -04:00
Christian Hergert 7bf60270fe flatpak-enter: warn when not running as root
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
2017-07-09 14:27:26 -07:00
Matthias Clasen 3259704a06 Merge pull request #913 from matthiasclasen/fix-match-subrefs
Fix flatpak_summary_match_subrefs
2017-07-09 10:53:40 -04:00
Matthias Clasen f71655a5f8 Fix flatpak_summary_match_subrefs
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.
2017-07-09 10:39:47 -04:00
Matthias Clasen ed08538f92 Merge pull request #900 from pwithnall/lan-and-usb-preparation
LAN/USB preparation refactoring
2017-07-08 20:54:28 -04:00
Matthias Clasen 2d5a8ba86b Merge pull request #909 from matthiasclasen/install-flags
Check the right flags
2017-07-08 18:19:14 -04:00
Matthias Clasen 0d633babac Only do locale subsetting in per-user installs
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.
2017-07-08 14:02:00 -04:00
Matthias Clasen 9463327663 Merge pull request #912 from nazgul77/patch-1
Update de.po
2017-07-08 14:00:37 -04:00
Matthias Clasen 34cd0631d9 Merge pull request #911 from piotrdrag/potfiles-update-170708
Update POTFILES.in
2017-07-08 13:57:07 -04:00
Christian 40e7bafe87 Update de.po
Change ambigious translation
2017-07-08 16:58:29 +02:00
Piotr Drąg af744ffceb Update POTFILES.in 2017-07-08 16:42:15 +02:00