Commit Graph

344 Commits

Author SHA1 Message Date
Alexander Larsson
ff6839a291 utils: Add flatpak_is_in_sandbox() helper 2016-09-05 11:54:12 +02:00
Alexander Larsson
4865d1edd2 common: Export flatpak_run_add_app_info_args
We want to use this from flatpak build too
2016-09-05 11:54:12 +02:00
Alexander Larsson
3ec0ecba93 common: add_app_info_args() talk GFile *app_files instead of a deploy
We don't really need the full deploy anyway.
2016-09-05 11:54:12 +02:00
Alexander Larsson
e50f7a363f build-update-repo: Reuse cache info from old summary
This makes rebuilding partial changes much faster.
2016-09-02 11:13:11 +02:00
Alexander Larsson
ba377b29e6 common: Add utility function to load summary file from local repo 2016-09-02 11:10:29 +02:00
Dan Nicholson
d2d9804187 utils: Only collect cache data once per revision
If there are multiple refs pointing to the same revision, then
collecting the size and metadata info for each of them is wasteful.
Maintain a hash table of the data so that it's only collected once per
revision.

This slightly widens an existing race where a ref could be updated
before the summary file is regenerated. In that case, the data in the
xa.cache variant would correspond to the wrong revision. I don't believe
this can be fixed unless there's locking at the ostree level.
2016-09-01 10:11:13 -07:00
Dan Nicholson
e86ae01ba0 utils: Only update summary info for flatpak refs
If there are non-flatpak refs in the ostree repo, there's no use in
collecting size or metadata information for them. Instead, only operate
on refs in the appstream, app or runtime prefixes.
2016-09-01 10:11:13 -07:00
Dan Nicholson
d304c4eca1 utils: Free list of refs in flatpak_repo_update
Although the data is owned by the hash table, the list storage needs to
be freed with g_list_free(). Use g_autoptr for that.
2016-09-01 10:11:07 -07:00
Alexander Larsson
509bb33a2b Merge pull request #237 from mwleeds/add-trace-msg
utils: Print a debug message when launching subprocesses
2016-08-30 09:22:02 +02:00
Alexander Larsson
b39c2e81ee Merge pull request #265 from ipuustin/fix-build
Create directories before attempting to generate code into them
2016-08-29 12:35:29 +02:00
Alexander Larsson
b678431197 Treat remotes with empty url as disabled
This happens with e.g. remotes from a bundle with no origin.

Fixes https://github.com/flatpak/flatpak/issues/270
2016-08-29 12:03:33 +02:00
Ismo Puustinen
2d26a7d0a6 Create directories before attempting to generate code into them
If flatpak is built from a separate build directory, code generation
fails because the directory structure is not in place. Create the
necessary directories before code generation.
2016-08-26 12:36:35 +03:00
Alexander Larsson
becb1b88bd Fix crash in "flatpak update" with no args
This crashed, trying to split NULL into parts..
2016-08-24 16:42:36 +02:00
Alexander Larsson
d637d471fb Fix double-free during install/update 2016-08-24 15:42:01 +02:00
Alexander Larsson
24c691f645 run: Mount /run/user/$uid/app/$appid in the sandbox
This directory is shared between all instances of the app, as well
as the host. In many ways this is similar to the ~/.var/app/$appid
directory, but the directory is guaranteed to not be persistent (/run
is on tmpfs), local to the host (not NFS), as well as nice support
for features like locks and mmap (due to being tmpfs).
2016-08-24 14:11:45 +02:00
Alexander Larsson
54c5f9a59e Allow specifying partial refs as name in commands
The commands: install, update, uninstall, info, make-current and run
now supports specifying a partial ref for the name. This is a different
way of specifying optional arch and branch arguments.

For instance org.app.App//master is the same as "org.app.App master" or
"--branch=master org.app.App".

This is useful if you're cutting and pasting from e.g. the list -d output.
2016-08-24 09:18:00 +02:00
Alexander Larsson
522ac5200b update: Disable update shortcut for local repos
These may not have up-to-date summaries
2016-08-23 14:33:48 +02:00
Alexander Larsson
c17e073f81 update: Add early check for nop updates using cached summary
This makes flatpak update a lot faster.
2016-08-23 12:30:41 +02:00
Alexander Larsson
cfba1431b4 Spew less when updating appstream branch
Missing icons are now only visible in verbose logs, and we don't
print warnings about missing appdata for runtimes (such as locale
and debug extensions).
2016-08-23 10:33:22 +02:00
Alexander Larsson
6578d37984 Drop libgsystem dependency 2016-08-22 16:00:33 +02:00
Alexander Larsson
467932e418 Drop use of gs_file_enumerator_iterate 2016-08-22 15:56:35 +02:00
Alexander Larsson
540a3a49df Drop use of gs_file_open_in_tmpdir_at
We import a copy of this
2016-08-22 15:44:52 +02:00
Alexander Larsson
c14fbc3efb Drop calls to gs_file_rename
We make an equivalent helper inline.
2016-08-22 15:28:17 +02:00
Alexander Larsson
289ae4474b Use glnx_gen_temp_name instead of gs_fileutil_gen_tmp_name
+      enter the commit message for your changes. Lines starting
2016-08-22 15:20:39 +02:00
Alexander Larsson
be8dae4693 Convert to glxn_* console helpers instead of gs_* 2016-08-22 15:08:59 +02:00
Alexander Larsson
fcffefee26 Replace openat() calls from libgsystem 2016-08-22 14:12:31 +02:00
Alexander Larsson
65f1cf993d Create and use flatpak_file_get_path_cached
This is simpler that the one in libgs, as well as lockless. Also, it
removes one more use of libgs.
2016-08-22 10:22:42 +02:00
Alexander Larsson
9c907c992d Replace gs_shutil_rm_rf with small helper wrapper over libglnx 2016-08-22 10:06:08 +02:00
Alexander Larsson
e0bd22bfe8 Add flatpak_mkdir_p helper and use it
This replaces all current callers of gs_file_ensure_directory with
equivalent code.

Actually, two instances were calling gs_file_ensure_directory with
FALSE, i.e. error out on EEXIST, but those cases seem fine with the
do-nothing-if-exists semantics.
2016-08-22 09:29:24 +02:00
Alexander Larsson
1970ecbea1 common: Add utility for g_auto style ostree transaction abortions 2016-08-19 16:51:56 +02:00
Alexander Larsson
5ee07d79c8 common: Add flatpak_complete_ref()
This is for commandline completion of ref:s
2016-08-19 16:51:24 +02:00
Matthew Leeds
392c597c5f utils: Print a debug message when launching subprocesses
This commit makes flatpak print a debug message (which only appears to
the user if the -v option is used) whenever a subprocess is launched.
This should make debugging easier, both for flatpak users and
developers.
2016-08-05 14:15:19 -04:00
Matthias Clasen
1e7bd752bf Don't handle already-installed error too early
Leave this to the callers which may well print out a
different message depending on whether the update did
anything or not.
2016-08-04 18:41:01 -04:00
Matthias Clasen
75218c4a65 Fix license headers
We were referring to the nonexisting "version 2" of the
Lesser GPL. It should be "version 2.1".
2016-07-29 14:27:49 -04:00
Alexander Larsson
764cb91cbe Remove workaround for issue #144 now that ostree is fixed
The fix for this is in ostree 2016.7

https://github.com/flatpak/flatpak/issues/144
2016-07-29 01:20:40 +02:00
Alexander Larsson
003ef9ee2e Revert "Set up logging to the journal" 2016-07-29 00:24:43 +02:00
Matthias Clasen
772d2ab562 Fix dbus logging
We were adding the --log option in the wrong spot of the dbus-proxy
commandline, causing it to a) not accept it and b) spew a warning.
2016-07-28 09:06:23 -04:00
Matthias Clasen
d7da128818 Optionally redirect stdout and stderr to the journal
Arrange for stdout and stderr to be redirected to the systemd
journal, before exec'ing bwrap. This is under the control of
a pair of run flags. By default, we try to be smart and only
redirect if stderr is not a tty.
2016-07-25 10:36:00 -04:00
Matthias Clasen
549a2849c4 Consistency fixes
Strip newlines from commandline parsing error messages, and make
sure we report all allowed values.
2016-07-23 15:02:01 -04:00
Matthias Clasen
8732c5a8fb Translate errors
These show up in the UI and often refer to (translated) parts of
the UI.
2016-07-23 14:37:02 -04:00
Matthias Clasen
43da58db5f Mark commandline options for translations 2016-07-23 11:01:50 -04:00
Cosimo Cecchi
3d2a42ddf3 utils: fix double loop when extracting icons for appstream
When trying to extract icons to regenerate the appstream, we are looping
over the entire file every time, instead of only trying to copy icons
for the application ID we're looking at the moment.
This is most likely benign, but it causes a lot of "Error copying icon:
No such file or directory:" spew when calling flatpak build-update-repo.
2016-07-21 13:17:36 -07:00
Cosimo Cecchi
692125c115 run: plug a few memory leaks 2016-07-14 17:27:11 -07:00
Cosimo Cecchi
a8e3e1826f FlatpakDir: use correct function to free FlatpakContext refs
These are not keyfiles. This fixes a crash when launching applications
through gnome-sofware.
2016-07-14 17:26:02 -07:00
Alexander Larsson
92ab585e6f Merge pull request #171 from mariospr/no-desktop
flatpak-run: Add a new --no-desktop option to prevent creation of cgroups
2016-07-02 00:05:30 +02:00
Mario Sanchez Prada
8c8b91609c flatpak-run: Add a new --no-desktop option to prevent creation of cgroups
This is not intented for normal use, but it can be useful in cases where
we don't have a running session and sandboxing is not strictly required.
2016-07-01 22:12:04 +01:00
Alexander Larsson
51663de427 Remove unused variables 2016-07-01 14:45:53 +02:00
Alexander Larsson
b5204c908d builder: Clear mtime to 1, not 0, to match what new ostree does 2016-07-01 14:25:22 +02:00
Alexander Larsson
5da7a0411a lib: Support listing related refs 2016-07-01 10:32:57 +02:00
Alexander Larsson
4a40fece78 Add flatpak_dir_install_or_update
This is needed in the case where we can do any, such as when
installing related refs, which may be already installed.
2016-06-30 16:55:31 +02:00