Commit Graph

32 Commits (master)

Author SHA1 Message Date
Patrick 99d1d511b6
Quote checksum in mismatch error for clarity
Closes #321
2019-11-14 04:19:34 -08:00
Ryan Gonzalez 788ffbb630 Minor fix for YAML number warning
This will properly make sure numbers are identified without giving a false positive for ".".

Closes: #298
Approved by: alexlarsson
2019-09-13 10:30:46 +00:00
Ryan Gonzalez b317081048 Support parsing sources files as yaml
Fixes #297.

Closes: #298
Approved by: alexlarsson
2019-09-13 10:30:46 +00:00
Christian Hergert d3399fd785 utils: force exit host commands when flatpak-builder exits
If we are spawning applications on the host using the Development service,
then we want those commands to exit when the flatpak-builder process
exits, as can happen from Ctrl^C or kill().

By using a static FlatpakHostCommandFlags we only ever check this a single
time and then each subsequent request will do the right thing.
2019-05-06 13:03:17 +02:00
Alexander Larsson 2d938e2ccd Move flatpak_version_check to builder-utils.c
Closes: #274
Approved by: alexlarsson
2019-03-05 07:13:34 +00:00
Alexander Larsson ed4c440063 utils: Add flatpak_variant_[un]compress helpers
Closes: #263
Approved by: alexlarsson
2019-01-25 14:54:54 +00:00
Alexander Larsson feb839944f yaml: Allow null nodes, for example as dict values
We want this for overriding env vars. If you need a "null" string you
will have to quote it.

Closes: #257
Approved by: alexlarsson
2019-01-14 10:31:42 +00:00
Ryan Gonzalez 44c9b69898 Print a warning when a YAML document has a float-like string value
Closes: #221
Approved by: alexlarsson
2018-10-16 06:10:26 +00:00
Alexander Larsson fd802105c5 Keep x-* properties in manifest.json
This add custom (de)serialization code for the source, module and manifest
objects so that properties starting with "x-" are kep and then put back
in the manifest.

We also add a checksum of the manifest to the "finish" phase so that
if you change them the manifest is re-generated.

Closes: #203
Approved by: TingPing
2018-08-15 16:39:06 +00:00
Alexander Larsson d7200a4af4 host_spawn: Force kill f-b after forwarding INT/TERM
Otherwise we will just re-enter after INT and forward a TERM.

Closes: #195
Approved by: alexlarsson
2018-08-08 14:02:32 +00:00
Alexander Larsson a594fed33f builder_host_spawnv: NULL dir means cwd
Closes: #195
Approved by: alexlarsson
2018-08-08 14:02:32 +00:00
Alexander Larsson 00f38fece3 builder_maybe_host_spawnv: Pass on flags in the host case
Closes: #195
Approved by: alexlarsson
2018-08-08 14:02:32 +00:00
Alexander Larsson 12c29dc5ab builder_host_spawnv: Support G_SUBPROCESS_FLAGS_STDIN_INHERIT
We used to always inherit stdin when calling to the host, but only
do so when requested.

Closes: #195
Approved by: alexlarsson
2018-08-08 14:02:32 +00:00
Martin Pilarski 7cfdec0538 Use GInputStream for checksum computation of source files & archives
Using g_load_contents () for the checksum computation uses a lot of memory
(for large files) and actually fails for files larger than 4 GiB. Instead,
this implementation uses GInputStream to read the file in small buffers
and feeds the GChecksum manually.

Closes: #165
Approved by: alexlarsson
2018-07-02 07:53:19 +00:00
Richard Hughes a233e84c11 Rewrite the <launchable> tag when using rename-desktop-file
This also changes the <id> rewriting to use the non-desktop suffixed version of
the application ID as this has been deprecated now the launchable tag exists.

Applications shipping an appdata file without a launchable set will have one
auto-added at runtime based on the appstream <id>.

This copies FlatpakXml from the flatpak project.

Fixes https://github.com/flatpak/flatpak-builder/issues/155

Closes: #164
Approved by: alexlarsson
2018-06-19 13:16:30 +00:00
Denis Ollier 85eb2f1a64 Print more useful cURL error messages 2018-06-08 12:29:37 +02:00
Denis Ollier 1f46ee7e8c Use libcurl for HTTP downloads as well
Closes: #151
Approved by: alexlarsson
2018-05-15 10:16:15 +00:00
Denis Ollier a922cd49a4 Add support for FTP sources using libcurl
Closes: #143
Approved by: TingPing
2018-05-14 09:54:39 +00:00
Alexander Larsson 8af638bdd8 flatpak_spawn: Always spawn children untranslated
We need this as we sometimes (like flatpak info) parse the command output.

Closes: #148
Approved by: alexlarsson
2018-05-07 15:26:15 +00:00
Alexander Larsson aa2601dbb3 flatpak_cp_a: Add support for skipping some source files
Closes: #136
Approved by: alexlarsson
2018-04-26 07:15:38 +00:00
Alexander Larsson 0de0b8d615 Fix non-yaml build 2018-04-19 15:50:49 +02:00
Ryan Gonzalez e24c2218f1 Add YAML support as an alternative to JSON (closes #2)
Closes: #127
Approved by: alexlarsson
2018-04-19 12:44:38 +00:00
Alexander Larsson c844563f7d Don't warn for // and __ key prefixes
This means you can make valid json comments like so:

 "//": "Some comment",

Closes: #122
Approved by: alexlarsson
2018-03-27 14:12:39 +00:00
Christian Hergert dce8981162 utils: use g_debug() for debug information
Closes: #100
Approved by: alexlarsson
2018-01-12 10:06:12 +00:00
Christian Hergert 1bb6925481 utils: don't pass stderr if silence was requested
Closes: #100
Approved by: alexlarsson
2018-01-12 10:06:12 +00:00
Christian Hergert 897fe1b768 utils: add GSubprocessFlags parameter
This allows us to pass it through in the case we're running in the same
pid namespace as the flatpak-builder process.

Closes: #100
Approved by: alexlarsson
2018-01-12 10:06:12 +00:00
Christian Hergert 1929fd1cc6 utils: clear GUnixFDList before entering main loop
If we do not clear the FDList before entering the main loop, the splice
async command may not complete because the pipe fd is still held. This
fixes an issue where builder_maybe_host_spawnv() hangs indefinitely when
run inside a Flatpak application.

Closes: #100
Approved by: alexlarsson
2018-01-12 10:06:12 +00:00
Alexander Larsson adc84ac4ca
Add more checksum types for files and archives (#75)
* Add more checksum types for files and archives

Many upstreams don't use sha256, some use even stronger checksums like
sha512, and its nice to be able to use these. Some system uses
weaker checksums, which you can work around by recomputing your own,
but sometimes that is a bit painful, for example when you're
auto-generating flatpak-builder manifests based on some other format
such as npm lock files.

This adds all the checksum types that GChecksum supports in the
glib version we currently use: md5, sha1, sha256, sha512
2017-12-07 15:40:04 +01:00
Alexander Larsson 039a24aeb4 utils: Add flags argument to flatpak_spawn
This allows you to e.g. silence STDERR

Closes: #47
Approved by: alexlarsson
2017-10-17 10:31:28 +00:00
Alexander Larsson 34710550ef Automatically compress debug info unless no-debuginfo-compression is set
This uses eu-elfcompress to compress the debuginfo. We use the older
zlib-gnu compression format which is older and has more widespread
support.

Closes: #43
Approved by: alexlarsson
2017-10-05 18:11:21 +00:00
Alexander Larsson faba587a72 Move common/flatpak-utils.* to src/builder-flatpak-utils.* 2017-08-25 09:36:49 +02:00
Alexander Larsson 5823533bd7 Move builder/ to src/ 2017-08-25 09:30:53 +02:00