Commit Graph

526 Commits

Author SHA1 Message Date
Matthias Clasen
c30e00eef2 Make it possible to unset values in update-repo
The underlying setters interpret NULL as 'unset this key', but
we never pass NULL. Since empty strings are not useful values
for title or default-branch or redirect-url, just interpret
an explicit empty value as 'unset this key'. E.g. to unset
the redirect url, use

flatpak build-update-repo --redirect-url= ~/my-repo/
2017-05-10 11:53:01 +02:00
Matthias Clasen
0ea9d93001 repo: Print out redirect url too
This is useful information about a repository, so make
the repo command print it out.
2017-05-10 11:53:01 +02:00
Matthias Clasen
4ecd7a9dfe Add a missing return
The compiler pointed this out.
2017-05-10 11:43:40 +02:00
Alexander Larsson
7a4c82529e Support build-update-repo --redirect-url=
When clients install/update they will see this property in the
(signed) summary and update the url in the config, making this
essentially a permanent redirect.
2017-05-09 17:02:00 +02:00
Alexander Larsson
c7f770bd7a install: Fix automatic metadata update
We should update the metadata when installing from
a regular repo, not from a bundle.
2017-05-09 17:00:55 +02:00
Alexander Larsson
21778f1075 Add support for adding new gpg keys via signed summary 2017-05-09 16:43:20 +02:00
Alexander Larsson
c89aa03695 remote-add/modify: Break out gpg loading code to helper 2017-05-09 15:56:31 +02:00
Alexander Larsson
44cf5076fa update: Split update into check_for_update and update
This way we can avoid printing "updating foo" for every
app even if there is no update.
2017-05-09 14:08:27 +02:00
Alexander Larsson
864f2def12 transaction: Always update metadata for remotes on update/install
All remotes involved in an update are updated before starting
transaction.
2017-05-09 13:25:21 +02:00
Alexander Larsson
b25987255e remote-modify: Don't modify if no arguments are specified
For instance, if we pass only --update-metadata we don't
want to get a polkit request for a no-op change.
2017-05-09 13:25:21 +02:00
Alexander Larsson
b106fd9c67 remote-modify: Never update explicitly set values
Whenever you explicitly specify some value (e.g. for
title or default-branch) we set a $KEY-is-set option
to True, and if that is set we never automatically update it.
2017-05-09 13:25:21 +02:00
Matthias Clasen
b04529dfd0 info: Print some more information
Make sure that info prints at least the same amount of
information as list -d.
2017-05-08 11:29:22 +02:00
Alexander Larsson
2b5af6a036 install: Make already-installed a warning, not an error
This seems to match what dnf and apt does, and it makes it
easier to ensure a set of apps are installed.
2017-05-04 13:48:27 +02:00
Alexander Larsson
858a4b6044 build: Kill sandbox when flatpak build dies
This ensures that no processes from the build lives
past the return of the build itself, which might
accidentally happen.

We still allow apps to stay around after the regular
flatpak run command finished though, as this is sometimes
done on purpose.
2017-05-04 10:53:48 +02:00
Alexander Larsson
08397923bf remote-ls: Fix up the column titles
The index for these were wrong.
2017-05-04 10:16:21 +02:00
Alexander Larsson
93e13a42ec run: Only forward as document if the target app can't see the file 2017-05-03 18:23:30 +02:00
Matthias Clasen
20c40149af Enable file forwarding in flatpak run
Add a --file-forwarding option for the run command, which triggers
the rest argument processing that was implemented in the previous
commit.

This is how it is used:

flatpak run --file-forwarding --command=cat \
        org.gnome.Recipes @@ $HOME/todo @@

Note that the @@ are passed as separate arguments.
2017-05-03 13:27:52 +02:00
Matthias Clasen
75b84b4bfe Include the generated document portal code in common
Move the sources from app/ to common/. We will use this
code from common/ in subsequent commits.
2017-05-03 13:27:52 +02:00
Alexander Larsson
a4b16255d5 info/list: Move subpath list to info
We just show "partial" on the list and then
the details are in flatpak info.
2017-05-03 11:28:07 +02:00
Alexander Larsson
fb6695e9a4 Add macros for common ANSI tty escape codes 2017-05-03 11:17:41 +02:00
Alexander Larsson
52be2e86c6 info: Use flatpak_fancy_output 2017-05-03 11:08:54 +02:00
Matthias Clasen
ae93d66d39 info: Preserve the previous output format
At least, to the extent that it is needed for tests to pass.
If any of --show-ref, --show-commit, --show-origin or --show-size
are given, emit the previous one-line format. Otherwise, use the
new, friendly multi-line format.
2017-05-03 11:07:52 +02:00
Matthias Clasen
91f48f51ae Don't use escape sequences unless on a tty 2017-05-03 11:07:52 +02:00
Matthias Clasen
35ca4534b3 Fix compiler warnings
Some unused variables.
2017-05-03 11:07:52 +02:00
Matthias Clasen
fb06477ff5 Improve info output
Emit more information, and format it in a better way.
2017-05-03 11:07:52 +02:00
Matthias Clasen
b176edcf07 remotes: Improve output formatting
Set column titles.
2017-05-03 11:06:43 +02:00
Matthias Clasen
4af266660c list: Improve output formatting
Set column titles, and align the size column.
2017-05-03 11:06:43 +02:00
Matthias Clasen
6d8e83f375 remote-ls: Improve the output
Add column titles, and align the size columns at the decimal point.
2017-05-03 11:06:43 +02:00
Matthias Clasen
c3e017d9de repo: Use the new number column support
This code was moved to the table printer itself.
2017-05-03 11:06:43 +02:00
Matthias Clasen
b07240f525 Use the new output helper
Instead of open-coding isatty(), use flatpak_fancy_output().
2017-05-03 11:06:43 +02:00
Joaquim Rocha
de2c6cc85b Add the possibility of installing/updating without static deltas
Sometimes we need to pull a commit without using static deltas to e.g.
make sure that an app with a corrupted commit can still be updated by
pulling the new commit in full.

This option has been added to the FlatpakUpdateFlags,
FlatpakInstallFlags, as well as a parameter for the CLI.
2017-05-02 15:05:48 +02:00
Matthias Clasen
363e03cb26 Make flatpak remote-ls show more details
Show the installed and download size for each ref,
when --show-details is given. The tabular display
could be improved by making FlatpakTablePrinter support
alignment at the decimal point.
2017-05-02 15:00:07 +02:00
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
1577c1a08e repo: Set column titles
Set column titles when printing branch information using the
table printer.
2017-05-02 14:56:04 +02:00
Matthias Clasen
ffef508830 repo: Improve formatting of size columns
Use the new aligned column support in the table printer.
2017-05-02 14:56:04 +02:00
Matthias Clasen
e958c15808 repo command: use FlatpakTablePrinter
This makes the output more similar to the other commands,
and will make us benefit from future improvements to the
table printer.
2017-05-02 14:56:04 +02:00
Matthias Clasen
17dd7b7861 Revise the flatpak repo command slightly
Make --info only print out general information, and add a new
option --branches which lists the per-branch information.
2017-05-02 14:56:04 +02:00
Matthias Clasen
917d404773 Merge pull request #734 from matthiasclasen/partial-extension-size
Improve display of partial extension sizes
2017-04-30 07:54:28 -04:00
Matthias Clasen
7ad15edb62 Improve display of partial extension sizes
The installed size in the metadata refers to the full
extension. If we have subpaths, the actual installed
size may be much smaller. Unfortunately, it appears
hard to obtain the actual size, so just hint at this
fact by displaying a '<' before the size.
2017-04-25 15:24:11 -04:00
Alexander Larsson
dddb4a2e44 export: Always make directories accessible
There is no reason ever to make a flatpak with a
directory that is not accessible, so make them all
readable and executable.
2017-04-24 15:51:56 +02:00
Alexander Larsson
b4ee8581c3 build-update-repo: Spawn subprocesses when generating deltas
This means we can be parallel just like we were with threads,
but we're not using an enourmous amount of memory.
2017-04-19 22:16:17 +02:00
Alexander Larsson
9e80b3a1c1 build-update-repo: Add internal function to create a single delta
We will use this later to fork per-process delta creation instead
of threaded in order to use less memory.
2017-04-19 21:20:05 +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
7da0726514 build: Ensure we add the default dbus permissions
When using flatpak build, use the same default dbus
permissions (portal.*) as we do in flatpak run.

Fixes https://github.com/flatpak/flatpak/issues/717
2017-04-19 16:55:01 +02:00
Matthias Clasen
91c78e553c Quiet compiler warnings
These variables were unused.
2017-04-18 12:36:23 +02:00
Matthias Clasen
16a5188a64 Add a repo command
For now, this just prints bits of summary information in
human-readable form. This command could grow over time
to provide other functionality for managing local repositories.
2017-04-18 12:36:23 +02:00
Matthias Clasen
dbfd5d82e7 Fix a compiler warning
Unused variable...
2017-04-18 12:34:19 +02:00
Matthias Clasen
9b002821ad flatpak info: Properly handle unmaintained extensions
We were misreporting these as uninstalled.
2017-04-18 12:34:19 +02:00
Matthias Clasen
9a661fd926 flatpak info: Show more information for extensions
Show the same data the we show for other refs, when we
list extensions. In addition, show the subpaths if there
are any. Note that this reveals that the installed size
for subpath'ed extensions is misleading, since it is
the installed size for the full extension.
2017-04-18 12:34:19 +02:00
Matthias Clasen
77cec62f51 Add a --show-extensions option to flatpak info
This option makes flatpak info list the found extension
that match the given ref.
2017-04-18 12:34:19 +02:00