Commit Graph

3108 Commits (ad2ae90d12931ec3d1f7d2b51e5ed7b88128d0c0)
 

Author SHA1 Message Date
Matthias Clasen 261ff03b63 Merge pull request #907 from smcv/metadata
Document all metadata groups and keys
2017-07-07 17:50:15 -04:00
Matthias Clasen d1189d6d79 Merge pull request #904 from chergert/wip/term-titles
Update terminal title with build progress
2017-07-07 17:08:29 -04:00
Christian Hergert 59c4aec237 builder: update terminal title when build progress
This tries to be similar to jhbuild in that we update the
terminal title at various stages of the build process.

This is useful for casual command line users. It is also useful
for applications automating the use of flatpak-builder as then
can display progress to the user without having to parse all
stdout content.

For build systems that support progress (such as ninja), this
allows for both a build message (the term title) and progress
bars (generated from %d/%d build system output).
2017-07-07 14:04:30 -07:00
Matthias Clasen db0a9a0658 Merge pull request #903 from pwithnall/warning-fixes
Fix compiler warning flags and (accordingly) quite a few compiler warnings
2017-07-07 16:50:45 -04:00
Matthias Clasen c7047ca9ed Merge pull request #905 from owtaylor/ref-name-annotation
OCI: Update org.opencontainers.ref.name to org.opencontainers.image.r…
2017-07-07 13:17:18 -04:00
Simon McVittie 33caac29d2 flatpak-metadata(5): Add very brief documentation for Policy groups
Signed-off-by: Simon McVittie <smcv@collabora.com>
2017-07-07 18:05:48 +01:00
Philip Withnall 81301f0ef4 general: Remove trailing \n from GLib log messages
The GLib logging framework automatically appends a \n to messages, so it
doesn’t need to be added by callers.

Signed-off-by: Philip Withnall <withnall@endlessm.com>
2017-07-07 17:18:24 +01:00
Philip Withnall 315edcfc41 common/utils: Use a hash table as a set in the recommended way
Use g_hash_table_add() so that GHashTable can internally optimise for
use as a set, which results in slightly simpler code for the caller, and
slightly less memory usage overall.

This introduces no functional changes.

Signed-off-by: Philip Withnall <withnall@endlessm.com>
2017-07-07 17:18:24 +01:00
Simon McVittie b5023ffe87 flatpak-metadata(5): Document the Instance group
Signed-off-by: Simon McVittie <smcv@collabora.com>
2017-07-07 16:08:35 +01:00
Simon McVittie 6856ca18bc flatpak-metadata(5): Document missing keys
Signed-off-by: Simon McVittie <smcv@collabora.com>
2017-07-07 16:08:35 +01:00
Simon McVittie b552d8995b flatpak-metadata(5): Document /.flatpak-info
Signed-off-by: Simon McVittie <smcv@collabora.com>
2017-07-07 16:08:35 +01:00
Simon McVittie 6839fee009 common: Clarify what flatpak_context_load_metadata, save_metadata do
Signed-off-by: Simon McVittie <smcv@collabora.com>
2017-07-07 16:08:35 +01:00
Simon McVittie 489bfddfb3 common: Add and use constants for flatpak-metadata(5) groups and keys
This makes it easier to avoid typos, and also makes it easier to see
what groups and keys are in use. In the header file, they are
clustered according to the group in which the keys are used.

Signed-off-by: Simon McVittie <smcv@collabora.com>
2017-07-07 16:06:21 +01:00
Christian Hergert 2c6d05cf9f builder: add helper to set terminal title on TTYs
If isatty(STDOUT_FILE) is true, then we can possibly send
escape sequences to set the title of the terminal. This is
useful for both terminals like gnome-terminal as well as
programs scripting flatpak-builder such as Builder. This allows
those programs to get information about the current build
progress without having to parse the command line output which
is muxed with build information.
2017-07-06 14:22:19 -07:00
Owen W. Taylor 0853089457 OCI: Update org.opencontainers.ref.name to org.opencontainers.image.ref.name
This annotation was changed in later versions of the OCI Image specification.
(See https://github.com/projectatomic/skopeo/issues/369#issuecomment-310158211)
2017-07-06 17:07:08 -04:00
Philip Withnall f47a696392 build: Add AM_* variables to all per-target special variables
For example, add $(AM_CFLAGS) to mumble_CFLAGS. Since $(WARN_CFLAGS) is
only added to $(AM_CFLAGS), this fixes the lack of inclusion of the
compiler warning flags in the compilation of half of flatpak.

Note that $(AM_*) variables are only used by automake if a more specific
(per-target) special variable is not defined instead. So if you define
mumble_CFLAGS, AM_CFLAGS will not be used for that target unless
explicitly included in mumble_CFLAGS.

See
https://www.gnu.org/software/automake/manual/html_node/Flag-Variables-Ordering.html.

Do the same for $(AM_LIBADD), $(AM_LDFLAGS), etc. These are not
currently defined, but it’s good practice to include them in
mumble_LIBADD (etc.) just in case they’re defined in future. Hopefully
their inclusions will be cargo-culted to any new targets which are
added, retaining full coverage of the code base.

Signed-off-by: Philip Withnall <withnall@endlessm.com>
2017-07-06 15:05:58 +01:00
Philip Withnall 95c3c942d3 tests: Move printf format string into printf() call to silence warning
Clang otherwise complains about the printf() format string not being a
string literal, which is a bit pants.

Signed-off-by: Philip Withnall <withnall@endlessm.com>
2017-07-06 15:05:58 +01:00
Philip Withnall a7f5b1c3ef builder: Remove an unused variable
Fix a compiler warning.

Signed-off-by: Philip Withnall <withnall@endlessm.com>
2017-07-06 15:05:58 +01:00
Philip Withnall 5771527286 builder: Add a missing function to the header file
All the similarly named functions were in the header file, but this one
was left out. Stop it feeling sad and lonely by putting it in the header
file with its friends.

Signed-off-by: Philip Withnall <withnall@endlessm.com>
2017-07-06 14:41:21 +01:00
Philip Withnall 548f60ebc0 general: Add missing `static` modifier to various local methods
The compiler warning flag which was supposed to warn about this was not
being included in the CFLAGS for these targets. That will be fixed in an
upcoming commit.

Signed-off-by: Philip Withnall <withnall@endlessm.com>
2017-07-06 14:41:21 +01:00
Philip Withnall 225e4b1e2f common/utils: Factor out code for populating the commit data cache
This introduces no functional changes. The split out function will be
reused in a later commit to additionally load commit data from the
ostree-metadata branch.

Signed-off-by: Philip Withnall <withnall@endlessm.com>
2017-07-06 14:41:01 +01:00
Philip Withnall 7d286a6dce common/dir: Move progress reporting setup higher in flatpak_dir_pull()
This will slightly simplify some later refactoring. It makes no real
difference to the function’s behaviour at the moment.

Signed-off-by: Philip Withnall <withnall@endlessm.com>
2017-07-06 14:41:01 +01:00
Philip Withnall 4ffe706cd9 app/repo: Use utility function to load repository summary
Rather than reinventing the code.

Signed-off-by: Philip Withnall <withnall@endlessm.com>
2017-07-06 14:41:01 +01:00
Matthias Clasen a80a1b9bb2 Merge pull request #896 from pwithnall/missing-n
app/build-export: Add missing N_() around a translatable option
2017-07-05 12:48:14 -04:00
Matthias Clasen 4896a47b25 Merge pull request #901 from pwithnall/printf-warning-fix
app/build-export: Fix gcc warning about too many arguments for printf
2017-07-05 12:47:40 -04:00
Philip Withnall 574f3692ec app/build-export: Fix gcc warning about too many arguments for printf
Drop the spurious final argument.

Signed-off-by: Philip Withnall <withnall@endlessm.com>
2017-07-05 15:56:43 +01:00
Philip Withnall c4228fac67 app/build-export: Add missing N_() around a translatable option
Signed-off-by: Philip Withnall <withnall@endlessm.com>
2017-07-05 15:51:02 +01:00
Matthias Clasen 367c586862 Merge pull request #894 from smcv/isolate-tests
tests: Isolate tests from real home directory more thoroughly
2017-07-04 09:22:36 -04:00
Matthias Clasen 2dca804768 Merge pull request #895 from pwithnall/drop-unused-variable
common/dir: Drop unused variable
2017-07-04 09:19:37 -04:00
Philip Withnall c6011083a2 common/dir: Drop unused variable
This was accidentally introduced in a8ad3927 in advance of the LAN/USB
changes from PR #884 which will actually use it.

Signed-off-by: Philip Withnall <withnall@endlessm.com>
2017-07-04 13:43:26 +01:00
Simon McVittie 5de225e615 tests: Isolate tests from real home directory more thoroughly
The library test previously used the real ~/.cache, while the
library test and the shell-script tests would use the real ~/.config
to look up the XDG user-dirs.dirs. Other home-directory-related code
might have used the real $HOME.

As a general rule, build-time tests should not affect the real home
directory. Debian autobuilders run as a user whose home directory
does not exist, in order to catch packages whose build process could
affect or be affected by the contents of the home directory. This
caused testlibrary to fail when it tried to create that nonexistent
directory, which I think happened while trying to create ~/.cache.

Signed-off-by: Simon McVittie <smcv@debian.org>
2017-07-04 11:32:45 +01:00
Alexander Larsson 9a19ea7c13 Update pofiles 2017-06-30 23:08:15 +02:00
Alexander Larsson 67a568d513 Bump version to 0.9.7 2017-06-30 22:56:59 +02:00
Alexander Larsson 305512ba17 Update NEWS for release 2017-06-30 22:56:43 +02:00
Simon McVittie 8e03e7b719 build: Re-run gdbus-codegen if the Makefile changes
Changes to the Makefile could include changes to the options passed
to gdbus-codegen, which would invalidate the output.

Signed-off-by: Simon McVittie <smcv@collabora.com>
2017-06-30 21:21:06 +02:00
Simon McVittie f4c4abfb1e build: Only run each instance of gdbus-codegen once
A rule of the form

    foo.c foo.h: foo.in
        some-generator --output=foo foo.in

is essentially equivalent to writing the same rule once for each target:

    foo.c: foo.in
        some-generator --output=foo foo.in
    foo.h: foo.in
        some-generator --output=foo foo.in

In a parallel build, this can result in some-generator being run more
than once with the same inputs and outputs, leading to unpredictable
results if the outputs are overwritten in-place by two parallel copies
(particularly if the generator does not use the standard atomic-writing
trick of writing out a temporary file and renaming it over the top of
the intended name, which gdbus-codegen does not).

gdbus-codegen happens to write the .h file before the .c file, so
use the real build rules to generate the .c file, and consider the
.h file to be a side-effect.

Signed-off-by: Simon McVittie <smcv@collabora.com>
2017-06-30 21:21:06 +02:00
Simon McVittie 8776d3c1f8 build: Check for system extensions before any other C compiling
AC_USE_SYSTEM_EXTENSIONS issues warnings unless it is the first
attempt to compile C code.

Signed-off-by: Simon McVittie <smcv@collabora.com>
2017-06-30 21:18:22 +02:00
Simon McVittie de8d982b40 .gitignore: Ignore all generated man pages
Signed-off-by: Simon McVittie <smcv@collabora.com>
2017-06-30 21:17:54 +02:00
Simon McVittie 501399a808 dbus-proxy: Don't clear dbus_address twice
It's sufficient to g_free it, which we do further down finalize().
This is not a double-free, because we used g_clear_pointer(),
but it's redundant.

Signed-off-by: Simon McVittie <smcv@collabora.com>
2017-06-30 21:17:38 +02:00
Simon McVittie c02920f28c dbus-proxy: Make miscellaneous globals static
Signed-off-by: Simon McVittie <smcv@collabora.com>
2017-06-30 21:17:38 +02:00
Alexander Larsson d7d82d1f2a builder: When bundling git sources, reuse cache
Fixes https://github.com/flatpak/flatpak/issues/885
2017-06-30 18:00:14 +02:00
Philip Withnall 55ca5a9662 common/dir: Factor out body of update_remote_configuration_for_summary()
This will make it easier to add another version in upcoming commits
which gets the updated configuration from another source (an
ostree-metadata branch).

This commit introduces no functional changes.

Signed-off-by: Philip Withnall <withnall@endlessm.com>
2017-06-30 16:06:50 +02:00
Philip Withnall 07607e3e00 common/dir: Factor out common code to get and load the summary file
There was already a convenience method for this,
fetch_remote_summary_file(), but it wasn’t used uniformly throughout the
file. This introduces no functional changes.

Signed-off-by: Philip Withnall <withnall@endlessm.com>
2017-06-30 16:06:50 +02:00
Philip Withnall a8ad392750 common/dir: Factor out common code for getting repo metadata
There are several places which query keys in the metadata in the summary
file. Factor out a common function to do that, and write it in such a
way that it could be extended to read the metadata from somewhere else
in future (the plan being that metadata will move to an ostree-metadata
branch rather than the summary file).

Signed-off-by: Philip Withnall <withnall@endlessm.com>
2017-06-30 16:06:50 +02:00
Philip Withnall 7a550f2f68 build: Include config.h using CPPFLAGS
This ensures it’s always included in the build, regardless of whether
someone forgets to #include it from a C file.

Signed-off-by: Philip Withnall <withnall@endlessm.com>
2017-06-30 13:41:38 +02:00
Philip Withnall 15bc368188 builder: Rearrange args to do_export() to make mandatory ones obvious
Previously, the mandatory location, directory and branch positional
arguments were passed as part of the varargs. This meant the varargs
were conflating flags and positional arguments, making it harder to add
new positional arguments.

Move the mandatory positional arguments to separate parameters for
do_export(). This introduces no functional changes, but makes later
commits easier.

Signed-off-by: Philip Withnall <withnall@endlessm.com>
2017-06-30 13:41:38 +02:00
Emmanuele Bassi 4aa4f91a1f Add nullable annotations for progress callbacks
The progress callback arguments in the Flatpak.Installation installation
and update methods are nullable, so we should annotate them as such.
2017-06-30 10:32:14 +02:00
Philip Chimento 86bc5f39be builder: Use build-args during cleanup
Any build-args specified in the manifest should be used during the
cleanup and platform-cleanup stages. This is because if you are using
QEMU to build for another architecture, for example, you need to pass
--bind-mount in the build-args, and the bind mount also needs to be
present while running cleanup commands.
2017-06-30 10:23:52 +02:00
Philip Chimento 3b6f018809 docs: Remove --version from flatpak-build docs
This is not an option in flatpak-build; `flatpak build --version` prints
an unknown option error message.
2017-06-30 10:19:24 +02:00
Philip Withnall c0837b8179 common: Split out self and repo arguments for a static function
This introduces no functional changes; it will simplify upcoming
commits.

Signed-off-by: Philip Withnall <withnall@endlessm.com>
2017-06-30 10:17:34 +02:00