Commit Graph

7164 Commits

Author SHA1 Message Date
Alexander Larsson
900d146810 builder: Don't strip already stripped binaries 2017-03-09 17:03:59 +01:00
Georges Basile Stavracas Neto
556782ac06 Fix comment 2017-03-08 15:42:44 +01:00
Georges Basile Stavracas Neto
d74956c23a Improve progress calculation
When calculating the progress of a flatpak installation,
it considers the extra-data and OSTree pull as different
operations and that makes the progress to go back and
forth between 0% and 100%.

Consumers of this API, like GNOME Software, end up having
a bad experience reporting the progress of a Flatpak app
instalation.

Fix that by using a set of heuristics to improve the process,
splitting the operation in parts that can be tracked (or at
least estimated).
2017-03-08 15:37:28 +01:00
Georges Basile Stavracas Neto
d73090cc96 Split extra-data setup and fetch
By splitting the extra-data setup - where we set the number of
extra-data downloads and auxiliary information - and download -
where we actually fetch the extra-data - we can have more precise
progress reports.
2017-03-08 15:37:28 +01:00
Alexander Larsson
7d1a8f69f6 appstream: Don't add runtime to flatpak bundle tag for runtimes 2017-03-08 12:31:44 +01:00
Elvis Angelaccio
a9acdc0532 Append flatpak data dirs if XDG_DATA_DIRS is already set (#611)
* Append flatpak data dirs if XDG_DATA_DIRS is already set

Otherwise it will be impossible to run flatpak apps from desktop menus.
This issue can happen if another app (e.g. snapd) wants to add custom
folders to XDG_DATA_DIRS through /etc/profile.d

If XDG_DATA_DIRS is empty or unset, define it as before.

Fixes #606
2017-03-08 08:38:47 +01:00
Matthew Leeds
66f0efda41 doc: Add docs for undocumented options
A few options aren't documented in the manpages. This commit adds
documentation for them based on the --help output and relevant commit
messages. Some of it could probably use more elaboration.
2017-03-07 21:19:02 +01:00
Matthew Leeds
2d07f7d455 doc: Make manpages consistent with --help output
For a few commands the options aren't fully documented. This commit
makes the manpage documentation (almost) match the options shown
when you run "<command> --help" on the command line.
2017-03-07 21:19:02 +01:00
Matthew Leeds
d9272ab120 doc: Fix typos 2017-03-07 21:19:02 +01:00
Matthew Leeds
4817421289 doc: Fix example for flatpak-info command 2017-03-07 21:19:02 +01:00
Alexander Larsson
ea6747fcb4 builder: Fix --from-git
We need to specify the full branch when checking out
2017-03-07 14:20: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
60cadead5c builder: Properly handle relative module include paths from git
We load the sub-modules from the base directory (i.e. where
the manifest is stored).
2017-03-06 09:20:34 +01:00
Matthias Clasen
6da3d1d6ca Merge pull request #601 from piotrdrag/pl-update-170303-master
Update Polish translation for master 170303
2017-03-03 05:46:22 -05:00
Piotr Drąg
33931f88a0 Update Polish translation 2017-03-03 08:53:39 +01:00
Richard Hughes
b3569e4e86 scripts: Fix 'make distcheck' 2017-03-02 12:26:55 +00:00
Matthias Clasen
cb95375efd Merge pull request #593 from mwleeds/update-run-docs
doc: Mention that flatpak-run can be used with runtimes
2017-03-01 10:30:55 -05:00
Matthias Clasen
fccddf07e8 Merge pull request #594 from mwleeds/emit-runtime-error
run: Print an error for runtimes that aren't installed
2017-03-01 10:28:52 -05:00
Alexander Larsson
62286cf779 Support runtime-less extra-data
This is going to be needed for the nvidia driver to solve
https://github.com/flatpak/flatpak/issues/595
2017-02-28 18:10:06 +01:00
Alexander Larsson
27b4b3906a build-finish: Add --metadata= support
This lets us set generic metadata keys
2017-02-28 17:50:32 +01:00
Alexander Larsson
44399bcf5f builder: Add only-arches and skip-arches for sources 2017-02-28 17:41:45 +01:00
Alexander Larsson
0379c01981 builder: Add build-arches and skip-arches to modules
This lets you avoid modules on some arches.
2017-02-28 12:07:53 +01:00
Alexander Larsson
c3322fd9e9 builder: Add no-make-install to modules
This is useful for modules that don't have a make install rule.
You can use the new build-commands which is run after make to
create your own custom installation phase.

Fixes https://github.com/flatpak/flatpak/issues/458
2017-02-28 11:30:59 +01:00
Alexander Larsson
352eb84189 builder: Add builder_cache_checksum_compat_boolean 2017-02-28 11:29:39 +01:00
Alexander Larsson
0b448c5f68 builder: Handle chdir failures when spawning shell 2017-02-28 11:11:28 +01:00
Alexander Larsson
78b5c2fbf5 Fix error check when loading configuration 2017-02-28 11:06:06 +01:00
Alexander Larsson
e9429d6759 builder: Silence unused return value warning 2017-02-28 11:05:01 +01:00
Alexander Larsson
9d9bd184c7 zero-mtime: Handle error when enumerating directory 2017-02-28 11:02:32 +01:00
Alexander Larsson
d24c5f1423 run: Handle error when enumerating /etc 2017-02-28 11:00:01 +01:00
Alexander Larsson
e3d8e0df04 list-remotes: Handle remotes with no url specified 2017-02-28 10:56:24 +01:00
Alexander Larsson
2e639b81e2 list: Don't check error twice 2017-02-28 10:48:38 +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
b2b6dd3af2 Avoid possible null dereference
If the link fails to resolve the return value will be NULL, so we shouldn't use
it before checking for NULL.
2017-02-28 10:44:54 +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
Alexander Larsson
92b80fe672 build: Remove duplicated code for custom_usr 2017-02-28 10:38:43 +01:00
Matthew Leeds
6880818262 run: Print an error for runtimes that aren't installed
Currently if you pass flatpak-run an app that's not installed it prints
an error message to that effect, but if you pass it a runtime that's not
installed (and use the full ref format, e.g.
runtime/org.gnome.Sdk//master) it prints this message and crashes:

(flatpak run:15104): GLib-CRITICAL **: g_propagate_error: assertion 'src != NULL' failed
flatpak:ERROR:app/flatpak-main.c:394:flatpak_run: assertion failed: (success || error)

This commit makes flatpak print the appropriate error message, while
still printing an "app not found" error if the user didn't specify
whether the ref is an app or runtime.
2017-02-27 15:05:02 -06:00
Matthew Leeds
6d0f86d868 doc: Mention that flatpak-run can be used with runtimes
The ability to use flatpak-run to enter into a shell in a runtime was
added in flatpak 0.6.13 but the docs weren't updated to reflect that.
This commit updates the flatpak-run documentation to explain the
functionality.
2017-02-27 15:04:37 -06:00
Alexander Larsson
83600f7c1b builder: Always clone git repos with transport.fsckObjects
This way we detect any corrupt (or malicious) objects
2017-02-27 16:17:57 +01:00
Richard Hughes
d2307ca8b1 Don't include newlines in error messages 2017-02-24 17:03:03 +00:00
Alexander Larsson
aaf923bd37 builder: Use separate rofiles-fuse mounts for each module
We're doing a post-commit checkout directly to the app dir, which
means the fuse filesystem cache may get out of sync with the backing
directory. So, to ensure this doesn't happen we mount a fresh rofiles
fs for each build.
2017-02-24 14:16:12 +01:00
Alexander Larsson
f8388e7fdf Don't print stderr/stdout from emergency fuse unmount 2017-02-24 14:16:12 +01:00
Alexander Larsson
c0da3e49b9 builder: Use splice in rofiles-fuse mount 2017-02-24 14:16:12 +01:00
Alexander Larsson
576854fc7b tests: Make python mtime test modified file same size
This doesn't really affect the current test, but it makes
a difference for using python3 which also stores the size
in the cache.
2017-02-24 14:16:12 +01:00
Alexander Larsson
8983834f92 builder: Fix up .py[co] invalidation
Since we now only look at changed files we need to handle
the case where a .py file changed and the .pyc didn't, and
remove the now stale .pyc files.

Previously we looked at all files, so we detected this via
the stale .pyc file.
2017-02-24 14:16:12 +01:00
Thibault Saunier
75388609b3 scripts: Add a script to allow bisecting failures
The CLI is pretty similare to the `git bisect` one and works as follow:

  $ flatpak-bisect org.app.App start # Update application and get the history
  $ flatpak-bisect org.app.App bad # Sets current commit as first bad commit
  $ flatpak-bisect org.app.App checkout GoodHash # Checkout the first known good commit
  $ flatpak-bisect org.app.App good # Sets GoodHash as first good commit

... Here it starts bisection and checkouts a commit on the way, the user should launch the
app to check if the commit is good or bad and run:

  $ flatpak-bisect org.app.App good # if commit is good
  $ flatpak-bisect org.app.App bad # if commit is bad

flatpak-bisect will tell when the first bad commit is found.

Fixes https://github.com/flatpak/flatpak/issues/530
2017-02-23 17:41:06 +01:00
Richard Hughes
6125dabf58 Return the container from flatpak_get_system_installations()
This matches what other functions in libflatpak do, and also fixes a memory
leak in the error path.
2017-02-23 17:26:45 +01:00
Matthias Clasen
a95dbc8e9b Document --from-git and --from-git-branch 2017-02-23 17:15:35 +01:00
Alexander Larsson
3556272094 CI: require ostree package too
The libs were split out into its own package
2017-02-23 17:11:51 +01:00