1171 Commits

Author SHA1 Message Date
Matthias Clasen
d65ebf19f3 list: Add a runtime column
This is useful information, so we should allow showing it.

Closes: #2815
Approved by: alexlarsson
2019-04-12 09:13:34 +00:00
Umang Jain
e17b2635d6 run: Support migration from old app-ids to new app-id
flatpak run checks if there is any previous-ids for the app and
sees if there is a corresponding app-dir in ~/.var/app/ .
If so, it renames that app-dir to the new app-id and provides
a symlink from old app-id dir to new app-id dir, and exposes
these symlinks to the sandbox. The symlink is needed because even
though the XDG_DATA_DIR and other environment variables are set
to the new ID by flatpak run, the app itself could've stored
(eg in GSettings, or other files) paths which contained the old ID.

https://phabricator.endlessm.com/T23532

Closes: #2775
Approved by: alexlarsson
2019-04-12 08:59:35 +00:00
Ryan Gonzalez
7357b2bc63 cli-transaction: Use the new rebase support
Switch to the new eol signal and call flatpak_transaction_add_rebase()
if a rebase was requested.

Closes: #2775
Approved by: alexlarsson
2019-04-12 08:59:35 +00:00
Alexander Larsson
6d757f865e dir: Tweak flatpak_ensure_data_dir() function
Instead of returning the data dir it now takes it as an argument
This will help us later avoid recomputing it.

Closes: #2775
Approved by: alexlarsson
2019-04-12 08:59:35 +00:00
Alexander Larsson
b01a52e7c6 build-commit-from: Add support for--end-of-life-rebase=OLD=NEW
This lets you rebase an app, as well as other matching refs (OLD is
used as a prefix match) such as locale and debug extensions.

r your changes. Lines starting

Closes: #2775
Approved by: alexlarsson
2019-04-12 08:59:35 +00:00
Ryan Gonzalez
440bee1d51 build-export: Add --end-of-life-rebase
Closes: #2775
Approved by: alexlarsson
2019-04-12 08:59:35 +00:00
Alexander Larsson
889e3b862a build-update-repo: Support setting comment/description/homepage/icon
This just sets the option in the "flatpak" group, similar to how
the title works. Nothing uses this yet.

Closes: #2814
Approved by: alexlarsson
2019-04-10 14:34:32 +00:00
Alexander Larsson
69e869c9d2 Support comment/description/homepage/icon in remote-add too
Closes: #2814
Approved by: alexlarsson
2019-04-10 14:34:32 +00:00
Matthias Clasen
720ef6b72f repo: Show new remote config fields
Print out comment, description, homepage and icon if they are set.

Closes: #2812
Approved by: alexlarsson
2019-04-10 11:57:16 +00:00
Matthias Clasen
624099f039 remote-modify: Allow setting the new remote fields
Add --comment, --description, --homepage and --icon options.

Closes: #2812
Approved by: alexlarsson
2019-04-10 11:57:16 +00:00
Matthias Clasen
dc32aae658 remote-add: Add -is-set keys for the new fields
This lets us keep track of which fields have been
explicitly set.

Closes: #2812
Approved by: alexlarsson
2019-04-10 11:57:16 +00:00
Matthias Clasen
43b58b1b19 remotes: Add columns for flatpakrepo fields
Allow showing all information that we have
about remotes.

Closes: #2812
Approved by: alexlarsson
2019-04-10 11:57:15 +00:00
Matthias Clasen
ec9e55f140 remote-add: Store all .flatpakrepo keys
Application installers want to have access to
these fields to present repositories to the user,
so store them in our repo config, using xa.
prefixed keys.

Closes: #2812
Approved by: alexlarsson
2019-04-10 11:57:15 +00:00
Rafael Fontenelle
95e692794b Fix misspellings
Closes: #2807
Approved by: matthiasclasen
2019-04-08 12:50:42 +00:00
Matthew Leeds
0b20f3d48f run: Try to determine the branch if unspecified
Currently when the user doesn't specify a branch to the run command, for
apps it will use the current branch and for runtimes it just tries to
use "master" and fails if that doesn't work. Since runtimes don't have
current branches, it would be nice if we could determine the right one
to use rather than just erroring out. So this commit changes the
implementation so that it looks at each installed runtime and if only
one matches it is used. If there's more than one match the user is
prompted to choose. This is the first interactivity added to the run
command but I don't think that's an issue; any time it's run in a
non-interactive shell it will error out upon encountering ambiguity.

Also, add a couple unit tests for the success path and error paths.

Fixes https://github.com/flatpak/flatpak/issues/2780

Closes: #2788
Approved by: matthiasclasen
2019-03-30 13:02:10 +00:00
Matthew Leeds
ec234d7d6c app: Rename a variable for clarity
Calling this variable disable_interaction doesn't make sense because
there's still interaction if there's more than one option, so rename it
to assume_yes.

Closes: #2788
Approved by: matthiasclasen
2019-03-30 13:02:10 +00:00
Umang Jain
dcde1473d3 trivial: Use g_autoptr to automatically free GErrors
Closes: #2785
Approved by: matthiasclasen
2019-03-26 12:10:52 +00:00
Alexander Larsson
c9a7dd9425 Fix flatpak-list --arch
It was looking at the wrong part of the ref...

Closes: #2765
Approved by: mwleeds
2019-03-19 18:43:11 +00:00
Matthew Leeds
d690497549 cli transaction: Fix "required runtime found" prompt
On the next lines after this prompt we list each remote so it doesn't
make much sense to mention the first one in the prompt.

Closes: #2761
Approved by: alexlarsson
2019-03-19 13:44:29 +00:00
Alexander Larsson
d0026af959 build-update-repo: Add --static-delta-ignore-ref=PATTERN
This is useful if you don't want to e.g. generate deltas for debug
or source refs.
2019-03-12 14:53:36 +01:00
Alexander Larsson
aa978ea88a build-update-repo: Fix typo delete -> delta 2019-03-12 14:53:36 +01:00
Alexander Larsson
e3357bacad utils: Add some mtree helpers and rename create_root to something more correct
Closes: #2753
Approved by: alexlarsson
2019-03-12 09:08:12 +00:00
Matthew Leeds
4e81789167 Consistently use flatpak_load_http_uri()
Currently Flatpak has a few different implementations of helper
functions to download a URI using libsoup, but the best one seems to be
in common/flatpak-utils-http.c. So this commit deletes the others and
makes use of flatpak_load_http_uri() in place of download_uri() in a
few places. This has a couple consequences:
1) It means that we're now properly checking HTTP status codes rather
than assuming that the request was successful, in the install command,
remote-add command, and in FlatpakTransaction. This fixes an assertion
failure seen by a user when they tried to use a flatpakref URL that hit
a 404.
2) It means that in the places where we're using flatpak_load_http_uri()
we are only supporting http:// and https:// URLs not, say, file:// ones.
For the install and remote-add commands this was already being enforced.
For the handling of flatpakref files and bundles in FlatpakTransaction,
I believe it's just convention because it doesn't make much sense to
do anything else; this commit enforces that convention.

Also, add a unit test for the case of trying to install a flatpakref at
a URL that hits a 404 error.

Fixes https://github.com/flatpak/flatpak/issues/2727

Closes: #2740
Approved by: matthiasclasen
2019-03-06 23:44:50 +00:00
Alexander Larsson
26b6bb4990 build-update-repo: Add --no-update-[summary,appstream]
We'd like to use these in flat-manager for more detailed updates
of the repo.

Closes: #2730
Approved by: alexlarsson
2019-02-27 11:20:58 +00:00
AsciiWolf
75690a08bb Fix missing translatable string
Closes: #2724
Approved by: mwleeds
2019-02-25 22:10:10 +00:00
Matthew Leeds
e8816b7663 Remove extra newlines in variable definiton blocks
Uncrustify has an option "nl_func_var_def_blk" which is supposed to
ensure there's a newline character between the block of variable
definitions and the rest of the function body, but it gets confused and
thinks that the first instance of "g_autoptr" or "g_auto" being used on
a variable is the start of the function body. So this commit removes
those extra newline characters and removes that option in uncrustify.cfg
so they don't get re-added the next time uncrustify is run.

Here's the command I used:

perl -0777 -i -pe 's/\n(\n\s*g_auto\()/\1/g' `git ls-tree --name-only
-r HEAD | grep \\\.[ch]$ | grep -v common/valgrind-private.h |
grep -v app/flatpak-polkit-agent-text-listener\\\.[ch]`

I ran it again with "g_autoptr" in place of "g_auto", and made a few
manual edits to add back the newline when the g_auto* was in the middle
of a function body rather than at the top.

Closes: #2715
Approved by: matthiasclasen
2019-02-25 18:12:30 +00:00
Matthew Leeds
a0d3d65476 Remove extra newlines near curly braces
Edit uncrustify.cfg to add options to remove extra newlines near opening
and closing braces, and run uncrustify again.

Closes: #2715
Approved by: matthiasclasen
2019-02-25 18:12:30 +00:00
Matthew Leeds
8d962a686f Run uncrustify
I had to make a few manual edits but other than those the changes look
reasonable.

Closes: #2715
Approved by: matthiasclasen
2019-02-25 18:12:30 +00:00
Matthias Clasen
ce0981cb6d table printer: Use cell width, throughout
This should make it safe to use Escape sequences
in table content without messing up the alignment.

Closes: #2689
Approved by: alexlarsson
2019-02-14 09:12:40 +00:00
Matthias Clasen
71b5b66da6 Add utilities for 'cell width'
These functions are like g_utf8_strlen and g_utf8_offset_to_pointer,
but know to skip the Escape sequences we use.

Closes: #2689
Approved by: alexlarsson
2019-02-14 09:12:40 +00:00
Matthias Clasen
e9382b34bd cli transaction: Make the checks green
Success ought to be green.

Related: #2671

Closes: #2676
Approved by: mwleeds

Closes: #2689
Approved by: alexlarsson
2019-02-14 09:12:40 +00:00
Matthew Leeds
4607739677 Delete stray semicolons
Closes: #2703
Approved by: matthiasclasen
2019-02-14 06:14:59 +00:00
Alexander Larsson
2ea428a541 Revert "cli transaction: Make the checks green"
This reverts commit e209ac9e10.

We're counting thee escape sequences as width, until we fix
this we disable this.

Closes: #2686
Approved by: alexlarsson
2019-02-06 09:17:49 +00:00
Alexander Larsson
06a2f4d82d Actually always return non-null from flatpak_dir_get_display_name()
This also changes this to a non-const as we need to generate it.

Closes: #2683
Approved by: alexlarsson
2019-02-05 11:45:54 +00:00
Matthias Clasen
f8dfcf66f8 Only install polkit agent when needed
We don't need a polkit agent for simple things like
flatpak --installations. Only install it for running
actual commands.

Closes: #2679
Approved by: alexlarsson
2019-02-05 10:35:26 +00:00
Mathieu Velten
65634d214c build-init: use the sdk branch from the sdk ref when checking extensions
Closes: #2664
Approved by: alexlarsson
2019-02-04 09:51:54 +00:00
Matthias Clasen
e209ac9e10 cli transaction: Make the checks green
Success ought to be green.

Related: #2671

Closes: #2676
Approved by: mwleeds
2019-02-02 01:38:32 +00:00
Alexander Larsson
f74b54503a build-commit-from: Fix the collection-ref binding
We accidentally got an extra variant making the
type variant(a(ss)) instead of just a(ss).

Closes: #2666
Approved by: alexlarsson
2019-02-01 16:48:09 +00:00
Matthias Clasen
d5e2970725 cli transaction: Adapt to an api change
In f7a566e2ab, the flatpak_installation_get_display_name()
api was changed to (almost) always return a non-NULL string. Adapt
to this change, in order to use the preferred messages here.

Closes: #2655

Closes: #2668
Approved by: alexlarsson
2019-02-01 16:30:17 +00:00
AsciiWolf
6075a5e7d0 Make the Nothing to do. string translatable 2019-01-31 15:19:29 +01:00
Simon McVittie
ea227187d4 build-export: Allow sandboxing on icon validator to be disabled
During build-time tests, we can't rely on bwrap working.

Signed-off-by: Simon McVittie <smcv@debian.org>

Closes: #2661
Approved by: alexlarsson
2019-01-31 14:02:24 +00:00
Matthew Leeds
2b40e68e16 build-commit-from: Fix handling of ostree.collection-refs-binding
In a previous iteration of the work for supporting multiple collection
bindings on a commit[1][2] the key ostree.collections-binding was used,
but it was decided that ostree.collection-refs-binding makes more sense.
So update build-commit-from in one place where the old key was still
being used. This impact of this bug is that we would overwrite the value
of ostree.collection-refs-binding on the new commit with the one on the
source commit (which may not have all the same collection-refs
associated with it).  However since the libostree support for that key
hasn't been merged that wouldn't cause any problems yet.

[1] https://github.com/flatpak/flatpak/pull/2634
[2] https://github.com/ostreedev/ostree/pull/1805

Closes: #2644
Approved by: matthiasclasen
2019-01-29 23:04:54 +00:00
Alexander Larsson
ed71e4680c Handle versions of appstream-glib prior to 0.5.15
These don't have AS_BUNDLE_KIND_FLATPAK, but we can just
assume all bundles are flatpak bundles in the appstream data
we get from flatpak.

Closes: #2650
Approved by: alexlarsson
2019-01-29 10:19:28 +00:00
Alexander Larsson
441c1f52ea build-commit-from: Support --extra-collection-id
If this is passed, we add an extra collection id binding to
the commit, as well as create a separate ref for that particular
collection id.

This weakly depends on:
  https://github.com/ostreedev/ostree/pull/1805
In that without that change ostree pull will not respect
multiple collection-id bindings. It will still work for
the main/first collection id though.

Closes: #2634
Approved by: alexlarsson
2019-01-28 08:37:51 +00:00
Matthias Clasen
c9430b15f8 cli transaction: Use raw mode
We don't want line editing to interfere with our
formatting, so we turn on raw mode while we do
fancy progress reporting. We use raw mode at the
same times as we hide the cursor.

This should prevent partial Escape sequences from
showing up in the output.

Closes: #2638
Approved by: alexlarsson
2019-01-25 12:03:47 +00:00
Matthias Clasen
370c667887 columns: Be more precise and helpful
Complain about ambiguous suffixes, and and spell out
the allowed values when complaining about suffixes.

Closes: #2624
Approved by: matthiasclasen
2019-01-23 12:45:00 +00:00
Matthias Clasen
1770a7b600 Mention ellipsization in --columns=help output
Closes: #2624
Approved by: matthiasclasen
2019-01-23 12:45:00 +00:00
Matthias Clasen
350456abdd Turn off completion debug
This accidentally snuck in.

Closes: #2623
Approved by: matthiasclasen
2019-01-21 22:16:34 +00:00
Ryan Gonzalez
3333069a68 remote-delete: Avoid a "remote not found" error when deleting an -origin remote
Closes: #2626
Approved by: matthiasclasen
2019-01-21 22:02:35 +00:00
Ryan Gonzalez
26d2fb18fe remote-delete: Avoid deleting all refs
Fixes #2625

Closes: #2626
Approved by: matthiasclasen
2019-01-21 22:02:35 +00:00