Commit Graph

334 Commits

Author SHA1 Message Date
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
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
Alexander Larsson
8293527dbd FlatpakDir: Add flatpak_dir_find_remote/local_related
This lets us find all the "related" refs to a ref in a particular
remote, or locally.  These are the things we should automatically
download or delete when installing/updating/uninstalling the ref.

The implementation currently looks at all the extensions handled by the
app/runtime. For debug extensions and extensions marked no-autodownload we
only consider them related if its already locally installed. For locale
extensions we always consider them related, but we only pull the current
locale data for it.
2016-06-30 16:55:26 +02:00
Alexander Larsson
81e61391be utils: Add flatpak_summary_match_subrefs
This is useful to do extension matching in summaries
2016-06-30 11:42:39 +02:00
Alexander Larsson
5897ddd7ef utils: Add flatpak_get_current_locale_subpaths() 2016-06-30 11:41:12 +02:00
Alexander Larsson
9be05bc511 common: Remove unused functions 2016-06-29 16:43:02 +02:00
Alexander Larsson
0be93ed1dc extensions: Always create a tmpfs for subdirectory extensions.
This makes sure we can actually create a directory as needed, and not
having to have every subdirectory pre-created in the runtime.
2016-06-29 15:56:28 +02:00
Alexander Larsson
853227a3d6 extensions: Minor cleanup
We now store the path to the extension files in the FlatpakExtension
returned from list_extensions instead of having each called look
them up.
2016-06-29 12:20:16 +02:00
Alexander Larsson
de8d8a36c2 Merge pull request #158 from hadess/wip/use-git-patch
Add "use-git" option for patch source types
2016-06-28 15:24:49 +02:00
Alexander Larsson
7070dbf96c Make journal always available in the sandbox
I don't think it makes sense to have to enable this for everything.
It should be safe in the sense that you can't ever do more than
the user can do anyway, and there is no way to use this to communicate
with the rest of the system because you can't read from it.
The worst this could ever cause is to overload the system, but the
sandbox doesn't protect against that in any other way anyway.
2016-06-28 15:05:01 +02:00
Bastien Nocera
2facf8bbf0 utils: Add flatpak_spawnv() helper
This will allow callers to easily add new parameters without tearing
their hair out with varargs.
2016-06-28 14:24:16 +02:00
Alexander Larsson
44b6c31efc fix warning 2016-06-28 11:41:35 +02:00