Commit Graph

260 Commits

Author SHA1 Message Date
Alexander Larsson
8ef84cc3d1 Move shared bundle install code to flatpak_dir_install_bundle 2016-06-03 14:30:25 +02:00
Alexander Larsson
21ab14b19a Improve deployment of appstream data
This has several improvements:
 * Writes to a temporary location and renames at the end, so
   we never end up with partial checkouts.
 * Don't fsync each file during checkout, instead syncfs() at
   the end
 * Pre-create the target deployment directory so that we get the right
   permissions for it.
2016-06-03 14:30:25 +02:00
Alexander Larsson
72118a40b6 Merge pull request #67 from smspillaz/fix-gh-56
completion: Don't show one-time switches already in use
2016-06-02 17:23:01 +02:00
Sam Spilsbury
7bd6c9b277 completion: Don't show one-time switches already in use 2016-06-02 21:38:16 +08:00
Sam Spilsbury
082821288e completion: Store original argv and argc
We deep-free the original argv here, since it isn't modified.
2016-06-02 21:38:16 +08:00
Alexander Larsson
13707f6b18 system-helper: Support directly pulling local remotes
For a local (file:// uri) remote, do an (untrusted) direct pull instead
of pulling into the users cached repo first. This way we do less copies,
as well as guaranteeing the source of the data. The later means its
mostly safe to also allow this for non-gpg signed remotes.
2016-06-02 15:30:08 +02:00
Alexander Larsson
5c23f9bd9d Don't create empty "repo*" directories in the CWD
We were using the wrong dirfd, so we created empty files in the
current directory.
2016-06-01 10:23:52 +02:00
Sam Spilsbury
4fb1ae0b45 remote: Make the error message when summary_bytes == NULL more informative
It seems like one common user-error that could cause this is when
the remote URL was invalid.
2016-06-01 06:03:47 +00:00
Sam Spilsbury
c533e1aee6 summary: Make flatpak_cache_dir_summary static void
This function always returned NULL, and the return value was never
checked.
2016-06-01 05:59:54 +00:00
Sam Spilsbury
d9ec859878 summary: Don't cache summary if none was returned
ostree_repo_remote_fetch_summary can set out_summary to NULL but
still return TRUE according to the documentation, so don't assume
that *out_summary will always be set.
2016-06-01 05:58:21 +00:00
Alexander Larsson
733a28c9c4 Deply: Disable per-file fsync and do a single syncfs when deploy is done
This should perform a lot better
2016-05-31 14:41:04 +02:00
Alexander Larsson
bd7cf1af93 install: Better check for pre-existing installation
We need an actual active installation, not just the base directory.

This caused a failure if the user had tried to install and app but the
installation failed. After that installation failed due to it claiming
to be installed, while uninstall failed due it it *not* being
installed.
2016-05-30 16:35:50 +02:00
Alexander Larsson
8533f06dc0 Add more completions 2016-05-30 14:54:22 +02:00
Alexander Larsson
eeaa832095 Replace bash completion shell script with C-based version
This doesn't do everything yet, but its got the basics covered.
2016-05-27 16:30:13 +02:00
Josh Soref
c33b5b52d7 spelling: whether 2016-05-27 06:49:26 +00:00
Josh Soref
8412bcf4c1 spelling: whereas 2016-05-27 06:49:15 +00:00
Josh Soref
da0d6f052d spelling: running 2016-05-27 06:46:11 +00:00
Josh Soref
56e61e6a4a spelling: deployments 2016-05-27 06:39:17 +00:00
Alexander Larsson
1d8408e381 uninstall: When uninstalling the current branch, make other version current (if any) 2016-05-26 20:03:51 +02:00
Alexander Larsson
c48272c6db uninstall: Default to whatever branch is installed 2016-05-26 19:08:46 +02:00
Alexander Larsson
bf294fb7c5 install: Be smarter about choosing the default branch name
We look for any matching ref on the remote and use that if there is a single match.
2016-05-26 19:06:51 +02:00
Alexander Larsson
33c0d49212 builder: Support permission ops with --run 2016-05-26 12:24:43 +02:00
Alexander Larsson
bde6fa52dc build: Handle setting LD_LIBRARY_PATH when bwrap is setuid
We need to pass LD_LIBRARY_PATH as --setennv, because the setuid
helper strips that. We did this already for run, but this moves it
so its used by build too.
2016-05-26 09:43:56 +02:00
Alexander Larsson
282709d9ec Fix resolv.conf in "flatpak build"
This regressed when we moved to bubblewrap. We need to always use
a direct bind for building, because it may not necessarily happen
in a real user session where the session-helper works.
2016-05-25 16:38:50 +02:00
Alexander Larsson
3703837336 run: Don't crash if referencing an xdg-dir that is not configured 2016-05-25 14:12:36 +02:00
Alexander Larsson
b85e7f0de7 Don't use a local child repo of the system one if root
This is unnecessary, and risks creating files as root in the users
home directory if run under sudo.
2016-05-24 09:55:50 +02:00
Alexander Larsson
578d2cc9cf bwrap: Use --unshare-user-try
This makes the user ns optional, as it is not supported everywhere.
For instance Arch disables it by default.
2016-05-23 09:10:39 +02:00
Alexander Larsson
910328e535 Support no-deploy and no-pull via system helper 2016-05-20 13:30:50 +02:00
Alexander Larsson
24d4b60f60 Fix build if SCMP_ARCH_AARCH64 not defined 2016-05-20 11:07:34 +02:00
Alexander Larsson
e020803554 utils: remove_dangling_symlinks() - fix leak
We were not freeing the iterator.
2016-05-18 13:42:58 +02:00
Alexander Larsson
3d232bbe15 Merge pull request #161 from smcv/spelling
Fix various spelling mistakes
2016-05-17 17:51:20 +02:00
Alexander Larsson
b697a78dd3 system-helper: Support running unprivileged on session bus
This is only useful for testing.
2016-05-17 13:06:59 +02:00
Simon McVittie
a4641280a7 Fix various spelling mistakes
Mostly detected by Debian's Lintian tool.

Signed-off-by: Simon McVittie <smcv@debian.org>
2016-05-17 11:43:32 +01:00
Alexander Larsson
18992c2fa0 Look at FLATPAK_SYSTEM_DIR env var for default system dir
This is useful for testing
2016-05-17 11:55:41 +02:00
Alexander Larsson
251dcdb680 system-helper: Never use a system helper recursively 2016-05-17 11:54:44 +02:00
Tristan Van Berkom
b13fc460df flatpak-run.c: Handle arm and aarch64 arches
Allows 32bit applications to run in the sandbox on a 64bit aarch64 host.

https://bugs.freedesktop.org/show_bug.cgi?id=95421
2016-05-16 16:28:55 +02:00
Alexander Larsson
d1d73bd2b2 run: Remove old seccomp arch code
There was a merge error when we switched to bubblewrap, this
code was replaced with the code that only adds the target
arch, but we forgot to remove this old code.
2016-05-16 10:45:27 +02:00
Alexander Larsson
90c909a932 Fix clang warnings 2016-05-13 16:26:47 +02:00
Alexander Larsson
1504f7bd7f system-helper: Support add/modify/delete of remotes 2016-05-13 16:23:43 +02:00
Alexander Larsson
2875cdead5 remote-delete: Move to FlatpakDir and add checks for installed refs
You can't remove a remote unless you --force or there are no installs
from it.
2016-05-13 14:17:46 +02:00
Alexander Larsson
753cdc97fd Fix typo: flatpak_dir_modify_remove -> flatpak_dir_modify_remote 2016-05-13 13:59:48 +02:00
Alexander Larsson
392f80a4aa FlatpakDir: Add in-memory summary cache
Remote summary files are cached for 5 minutes.
2016-05-13 13:15:45 +02:00
Alexander Larsson
fa6e6c51ef Duplicate ostree_repo_remote_list_refs in FlatpakDir
This way we can later add a local summary cache to it.
2016-05-13 11:32:40 +02:00
Alexander Larsson
0098164cd6 Register dbus errors for FLATPAK_ERROR
This allows us to transparently pass them from the system helper.
2016-05-12 22:03:42 +02:00
Alexander Larsson
29390fff39 Change portal error names to not contain Flatpak 2016-05-12 22:03:09 +02:00
Alexander Larsson
5407b8efc6 system-helper: Support uninstall 2016-05-12 21:23:36 +02:00
Alexander Larsson
3964504438 Fix triggers with installation dir on a symlink 2016-05-12 21:16:40 +02:00
Alexander Larsson
fe0a1be5f8 common: Add flags for flatpak_dir_uninstall
This is better than a list of booleans.
2016-05-12 19:52:48 +02:00
Alexander Larsson
c5e178f339 Use flatpak_dir_uninstall for app and lib 2016-05-12 17:18:14 +02:00
Alexander Larsson
712fc9fc08 Use the installed/not-installed errors more consequently 2016-05-12 17:17:27 +02:00