Commit Graph

144 Commits (de2c6cc85bae8227d1b683618eb8c14c0689248c)

Author SHA1 Message Date
Matthias Clasen 62b8ae2953 table printer: move to its own source files
This is a pretty standalone object, and it is nicer to
have it in its own files. All users have been updated
to include the new flatpak-table-printer.h header.
2017-05-02 14:56:04 +02:00
Matthias Clasen 1998acb18e table printer: Only show titles on ttys
Avoid showing column titles unless stdout is a tty.
2017-05-02 14:56:04 +02:00
Matthias Clasen be92e4aa7e table printer: Support column titles
Add an api to set column titles, and format them in bold.
2017-05-02 14:56:04 +02:00
Matthias Clasen 2a5ce5a05e table printer: Support column alignment
Add support for aligning columns at a certain position.
This will be used to line up numbers at the decimal point,
in future commits.
2017-05-02 14:56:04 +02:00
Matthias Clasen fbcaf05362 table printer: Introduce a cell struct
No functional change here, simply some data structure reorg,
so we can have more data for each cell in the future.
2017-05-02 14:56:04 +02:00
Colin Walters c50648a594 libglnx: Bump to latest master, use new file copy API
The new `glnx_regfile_copy_bytes()` is better than the previous
`flatpak_copy_bytes()` in that it will use reflink/sendfile if available.

More information in 3a4d0f4684
2017-04-28 10:04:22 -04:00
Alexander Larsson 8b13d3c5ee builder: Add progress reporing while downloading 2017-04-24 21:23:46 +02:00
Alexander Larsson 47062137a5 fixup! common: Add flatpak_build_file[_va] helper 2017-04-24 12:23:20 +02:00
Alexander Larsson 4a60c87958 common: Add flatpak_build_file[_va] helper
This makes it easy to construct GFiles
from a base dir and an argument list
of child elements.
2017-04-24 09:02:33 +02:00
Alexander Larsson fe56c08203 build: Always set personality to linux32 when cross-building
This means that autodetection during builds works much better.
Fixes https://github.com/flatpak/flatpak/issues/712
2017-04-19 19:36:55 +02:00
Alexander Larsson b426306884 appstream: Don't strip .desktop extension if thats the actual id
The telegram app is org.telegram.desktop, so we can't assume
the id in the appstream data that ends in .desktop is just a desktop
file extension.
2017-04-12 09:40:04 +02:00
Simon McVittie 646b4c468b Use correct format string for guint64 on 32-bit
Signed-off-by: Simon McVittie <smcv@debian.org>
2017-04-04 12:17:28 +02:00
Alexander Larsson 0dcc7332f7 Handle uris better when detecting .flatpak[repo,ref] suffix
We fully parse the argument as (possibly) a uri, which means
we can handle an argument like:
 https://git.gnome.org/browse/gnome-apps-nightly/plain/gnome-builder.flatpakref?h=stable

Which doesn't work with a simple has_suffix call.
This is important because the flatpak.org site now references
these kinds of uris.

Fixes https://github.com/flatpak/flatpak/issues/659
2017-04-03 10:02:28 +02:00
Alexander Larsson 41d9717113 Fix unused variable errors reported by clang 2017-03-30 10:01:24 +02:00
Alexander Larsson 5b0ad227e8 OCI: Verify signatures 2017-03-29 17:14:36 +02:00
Alexander Larsson 11943e7e40 OCI: Support OCI with system-helper by mirroring OCI repo
This allows us (when we later add signatures) to verify
the signatures of the OCI manifest, and can thus support
the system-helper.
2017-03-29 17:14:19 +02:00
Alexander Larsson 759eee8cea OCI: Verify layer checksum while applying
This means we verify the exact data we use, which is
what was signed. In particular, this means in the
system-helper we don't open us up to the user
manipulating the file while it is being applied.
2017-03-29 17:14:19 +02:00
Alexander Larsson 980bd48f0e OCI: flatpak_pull_from_oci - verify manifest ref
This ensures the actual manifest ref matches what was specified
in the index. This is required as the goal is to sign/trust
the manifest, but not necessarily the index.
2017-03-29 17:14:19 +02:00
Alexander Larsson 82aad1ccb1 Correctly find system unmaintained extensions
We should not terminate the extension search just because
an earlier directory succeeds. Even non-existant directories
succeed, and anyway we should continue searching even if it
wasn't empty, because multiple subdir extensions may match.

Fixes https://github.com/flatpak/flatpak/issues/654
2017-03-27 11:18:16 +02:00
Colin Walters 2618a19716 Import ostree's compiler warnings, fix up callers
In ostree I maintain what I consider a "baseline" set of compiler
warnings that should *always* be fatal for a modern C project.

I noticed while working on a previous patch that a `-Werror=format`
warning wasn't fatal.

There are a few that are really, really important like
`-Werror=missing-prototypes`. I also take some like `-Werror=misleading-indentation`
which already caught some bugs.  See also https://lwn.net/Articles/678019/
2017-03-27 10:42:36 +02:00
Colin Walters 64fd2c2a8d Bump libglnx, use new glnx_throw(), fix callers
One benefit here becomes immediately obvious - `flatpak_fail()` was lacking
`G_GNUC_PRINTF` which meant we missed a lot of type checking. Fix up the
callers.
2017-03-27 10:42:36 +02:00
Alexander Larsson 3385c9dc5c Fix some warnings reported by clang 2017-03-15 10:17:26 +01:00
André Klitzing 567802749c Fix some issues with musl
* Use realpath instead of canonicalize_file_name
* Add missing include
2017-03-15 10:14:39 +01:00
Alexander Larsson 49b5304589 Update OCI support to latest version of spec
This is a major change in the OCI support, as the format of the OCI image
registries changed. Instead of now having a "ref" file for each image
in the repo it has a single index json file, where the ref name is now
a per-image annotation.

This allows us to support OCI much better, as we can now use the actual
flatpak ref as the OCI ref name, and we can find all the flatpak refs
in a remote.

So, with this you can just use:
 flatpak remote-add --oci remote-name URL

and then you can use the regular flatpak operations on the remote.
2017-03-13 14:31:36 +01:00
Alexander Larsson 7d1a8f69f6 appstream: Don't add runtime to flatpak bundle tag for runtimes 2017-03-08 12:31:44 +01:00
Alexander Larsson 640a02315b extensions: Support multiple versions
This means an extension point can include extensions of multiple
(specified) versions. This is useful for e.g. the GL extensions,
where we want a single extension for all the essentially unversioned
GL extensions (like the nvidia one) that is used by all the
runtimes.
2017-03-06 14:36:20 +01:00
Alexander Larsson 3122d1c014 flatpak_list_extensions: Break out code into helper
This is a minor restructure to make the code more readable
and extensible.
2017-03-06 14:36:20 +01:00
Richard Hughes d6f4ea424d Allow specifying an ISO-8601 timestamp when using build-export
This allows us to build reproducable repo summaries, for instance in self tests.
2017-03-06 11:38:26 +01:00
Alexander Larsson 9d9bd184c7 zero-mtime: Handle error when enumerating directory 2017-02-28 11:02:32 +01:00
Alexander Larsson 4db1e74090 utils: Fix flatpak_bundle_load typo
If we failed to look up the app metadata we would
clear out a different out argument instead.
2017-02-28 10:46:56 +01:00
Alexander Larsson e1e27559d1 utils: Fix list_unmtainained_refs
There was a stray goto out that caused it to only look at the first
element in the system dirs list.
2017-02-28 10:41:29 +01:00
Mario Sanchez Prada d0b5b51076 Initialize g_autofree string to NULL, not to crash when early returning
Otherwise, anytime we fail in ostree_repo_write_metadata() will cause
an invalid free to happen, and flatpak to crash.
2017-02-23 14:27:22 +00:00
Alexander Larsson 2c71298d53 builder: Its break_hardlink, not unbreak_hardlink 2017-02-22 09:43:57 +01:00
Alexander Larsson 082efe8951 Properly quote all commandlines we print
Fixes https://github.com/flatpak/flatpak/issues/236
2017-02-21 18:56:11 +01:00
Alexander Larsson 5a3c7feb15 builder: Unbreak hardlinks when eu-stripping
Otherwise this breaks with rofiles-fuse if the build produces
hardlinked installed files. For instance, as done by mesa.
2017-02-15 19:22:14 +01:00
Mario Sanchez Prada 86bf88d89f Allow cancelling the downloading process for extra data
So far, the installation of external apps can only be cancelled
before flatpak starts downloading the extra data, as there's no
cancellable being passed to g_input_stream_read_async().

This fixes that problem, making it possible to cancel installs
from GNOME Software regardless of the installation stage.
2017-02-14 09:01:16 +01:00
Mario Sanchez Prada ca952b0f21 Use the thread's default context to download extra data, not a new one
Otherwise, all the progress reporting for the extra data being downloaded
won't work, as the main context used by OstreeAsyncProgress will not be
the same than the one from the nested main loop used to download this.
2017-02-14 09:00:57 +01:00
Alexander Larsson 08ea3baf49 builder: Download files and archives directly to disk, don't keep them in memory.
This works much better for larger sources.
2017-02-09 12:26:05 +01:00
Alexander Larsson bf316c1a82 builder: Compute SHA256 while downloading archives 2017-02-09 12:17:10 +01:00
Alexander Larsson 02202b9e76 utils: Add flatpak_copy_bytes
This copies data from one fd to another.
2017-02-07 16:39:23 +01:00
Alexander Larsson 2e453048e0 extensions: Support enable/install-if=active-gl-driver
Only use/download this extension if it matches an active gl driver.
2017-02-03 09:49:05 +01:00
Alexander Larsson d4d15c7211 Initial flatpak_get_gl_drivers() implementation
This is supposed to list all the currently loaded "non-standard" gl drivers.
If FLATPAK_GL_DRIVERS is set, then that is used, otherwise it looks
for an nvidia driver and if so, uses that, and always adding "default"
at the end which is meant to resolve to a stable mesa fallback build, as
well as "host" which can be used if you have a host-side driver
as an unmaintained extension.
2017-02-03 09:48:16 +01:00
Alexander Larsson c88f1aa835 extensions: Support merge-dirs=list..
This causes the listed directories to become symlink farms
into all the subdirectory extensions.
2017-02-02 13:56:34 +01:00
Alexander Larsson 5e1d456b8b extensions: Support subdirectory-suffix=foo
If directory is "foo" and the extension id ends with ".ext" and
subdirectory-suffix is "sub" then the extension point will
be "/usr/foo/ext/sub" rather than just "/usr/foo/ext".

This is very useful when the extension point naming scheme is
"reversed". For instance, this happens for the /usr/share/themes directory.
An extension point for a gtk3 theme would be in /usr/share/themes/$NAME/gtk-3.0,
which could be achived by using subdirectory-suffix=gtk-3.0.
2017-02-01 19:59:12 +01:00
Alexander Larsson a3da0b3da8 extensions: Add add_ld_path property
If your extension points set this, then each extension will have
the corresponding subdirectory added to LD_LIBRARY_PATH.

We also support a priority property in the ExtensionOf group
in the extensions themselves to set the search order.
2017-02-01 19:46:25 +01:00
Alexander Larsson 7f8ad5b3a1 extensions: Make extension tmpfs requirement independent on order
If we sort, or subset the extensions we use, then we can't just
set need_tmpfs on the first one, instead do the checking
for the first one when we're applying the extensions.
2017-02-01 19:42:57 +01:00
Alexander Larsson 27031df5bf flatpak_resolve_symlink: Properly make paths absolute
We need to use g_build_filename, g_build_path takes a separator
as the first arg, not a path!
2017-01-19 15:36:06 +01:00
Alexander Larsson 592bea2b2e Don't break if exporting paths or symlinks to files in the runtime
For instance like in https://github.com/flatpak/flatpak/issues/494
if there is a /linuxrc -> /bin/busybox symlink, and /bin/busybox
is not in the runtime then we will fail creating it as a mountpoint
for the bind mount.

Fixes https://github.com/flatpak/flatpak/issues/494
2017-01-19 10:43:17 +01:00
Alexander Larsson a2810186b8 appstream update: Allow component ids not ending in .desktop
This is needed for runtimes
2017-01-18 13:22:56 +01:00
Joaquim Rocha 5dd952e68e Fix downloading extra data when run from a different thread
The main loop that is initiated while the extra data is being downloaded
needs a different context to be the thread-default one, otherwise the
operations just hang when running from a different thread.
2017-01-12 00:23:39 +01:00