Commit Graph

3153 Commits

Author SHA1 Message Date
Alexander Larsson
eaa780ea63 ld.so.cache: Fix order of extension libs
We include the app extension ld.so.conf files before the app
and after that the runtime extension conf files.

This matches what is described in https://github.com/flatpak/flatpak/issues/1075

Closes: #1076
Approved by: alexlarsson
2017-10-04 15:13:13 +00:00
Alexander Larsson
aa28d9c7b4 run: Make extension ld.so.conf files have nicer numbering
We were creating names for all extensions, even those that did
not get a ld.so.conf file created, so the count in was weirdly
inconsistent.

Closes: #1076
Approved by: alexlarsson
2017-10-04 15:13:13 +00:00
Alexander Larsson
129ab559ee Strip some more common environment variables from the host
We strip PYTHONPATH, PERLLIB, PERL5LIB and XCURSOR_PATH from the
environment in the sandbox, because these kind of path variables
can badly affect the sandbox (e.g. pulling in host-side code).

Closes: #1078
Approved by: alexlarsson
2017-10-04 15:12:30 +00:00
Philip Withnall
166a4e144d common: Don’t commit arbitrary files into the ostree-metadata branch
When building the ostree-metadata branch (which only happens when
configured with --enable-p2p), we are supposed to create empty commits
which contain only metadata. However, the code to do this was wrong, and
was instead pulling in all the files from the current working directory
and committing them.

Fix that code to actually create an empty commit.

This could have been a fairly serious bug were it not for the fact that
nobody’s using this code because it’s all experimental.

Spotted as part of https://github.com/ostreedev/ostree/pull/1158.

Signed-off-by: Philip Withnall <withnall@endlessm.com>

Closes: #1066
Approved by: alexlarsson
2017-10-04 12:54:30 +00:00
Piotr Drąg
badf74bdd9 Update Polish translation
Closes: #1061
Approved by: alexlarsson
2017-10-04 12:47:11 +00:00
Matthew Leeds
71f4a87f51 dir: Print debug output when opening flatpak dirs
It's easy to end up with multiple flatpak installations on a system, and
it's not always clear which one(s) flatpak is using. So this commit adds
some debug output in some cases when flatpak opens an installation
directory such as /var/lib/flatpak. This is especially important for
people who build flatpak themselves because if you omit --prefix=/usr
or use --with-system-install-dir your flatpak will look in non-standard
locations like /usr/local/var/lib/flatpak.

If we were to print this every time a flatpak directory is opened, it
would flood the log. So instead add a utility function and use it
strategically. Many flatpak commands will log the directory when they
use flatpak_option_context_parse(), others in
flatpak_find_deploy_for_ref(), and for others the logging has been
added manually.

Closes: #1067
Approved by: alexlarsson
2017-10-04 12:39:43 +00:00
Philip Withnall
6e6354b877 lib/installation: Fix some typos in error message strings
Signed-off-by: Philip Withnall <withnall@endlessm.com>

Closes: #1070
Approved by: alexlarsson
2017-10-04 12:32:56 +00:00
Kukuh Syafaat
78df4117b7 Update Indonesian translation
Closes: #1072
Approved by: alexlarsson
2017-10-04 12:25:56 +00:00
Valentin David
845a0b3bf7 Use ld.so.cache instead of LD_LIBRARY_PATH (when not building)
Instead of setting LD_LIBRARY_PATH to make the app load the right
libraries we run ldconfig to generate a ld.so.cache that we feed
to the sandbox as /etc/ld.so.cache. The cache itself is generated
by running ldconfig at run time, but for apps we cache the
result in $HOME/.var/app/$APPID/.ld.so/cache based on the
current app/runtime/extensions commit ids.

We also unset LD_LIBRARY_PATH, to ensure any host-side value
does not mess with the sandbox.

The default ld.so.conf we set (if the runtime has none, or an empty
one) is:

 include /run/flatpak/ld.so.conf.d/*.conf
 include /app/etc/ld.so.conf
 /app/lib

Additionally all the extension points that have add_ld_path set gets a
ld.so.conf snippet in /run/flatpak/ld.so.conf.d.

This allows applications and extensions to install their own paths if
needed, and if the runtime wants more location they can install a
custom ld.so.conf that includes the above.

In the flatpak build case we still use LD_LIBRARY_PATH like before,
because there is no good key (like the commit ids) for keeping the
cache up-to-date. Also, the behaviour is different when building an
app for instance. If /app/lib is not in LD_LIBRARY_PATH then the
sandbox-wide /etc/ld.so.cache must be updated for a newly installed
library to work, but the sandbox is not allowed to update
/etc/ld.so.cache.

This code was originally written by Valentin David <valentin.david@gmail.com>
with changes by Alexander Larsson <alexl@redhat.com>.

Closes: #1073
Approved by: alexlarsson
2017-10-04 10:27:14 +00:00
Alexander Larsson
f06cae1556 run: Break out /usr link creation to helper
This is the code needed to set up the symlinks into the runtime
to make stuff work. We will need this separately for minimal runtime
use.

Closes: #1073
Approved by: alexlarsson
2017-10-04 10:27:14 +00:00
Alexander Larsson
5cd8db035b common: Add flatpak_switch_symlink_and_remove
This creates a symlink pointing to a target, but if the symlink
already exists, it ensures (atomically) that the previous target
is deleted. This is useful to keep a single-item cache around.

Closes: #1073
Approved by: alexlarsson
2017-10-04 10:27:14 +00:00
Alexander Larsson
73f44dd656 Add extensions to /.flatpak-info
This fixes https://github.com/flatpak/flatpak/issues/502

Closes: #1069
Approved by: alexlarsson
2017-10-03 08:01:46 +00:00
Alexander Larsson
acdf869693 common: Add commit id to FlatpakExtension
Closes: #1069
Approved by: alexlarsson
2017-10-03 08:01:46 +00:00
Alexander Larsson
f04bc43eef Add commit ids for app and runtime to /.flatpak-info
Closes: #1069
Approved by: alexlarsson
2017-10-03 08:01:46 +00:00
Alexander Larsson
0ab0e94647 Add flatpak_deploy_get_deploy_data helpers
Closes: #1069
Approved by: alexlarsson
2017-10-03 08:01:46 +00:00
Alexander Larsson
1fbdda5d0e run: Add some helpers to add fds to the argv array
This cleans up a bunch of repeated code.
2017-10-02 14:53:04 +02:00
Alexander Larsson
160f4e6224 Don't fail update if we can't update remote metadata
This blocks the entire update just for one remote failing.
2017-10-02 10:10:07 +02:00
Alexander Larsson
bbdf2d11c8 build: Export FLATPAK_ID and FLATPAK_ARCH
These are useful to have when building things.

Closes: #1052
Approved by: alexlarsson
2017-09-29 09:35:26 +00:00
AsciiWolf
bc2d72adeb Update Czech translation
Closes: #1050
Approved by: alexlarsson
2017-09-28 17:17:44 +00:00
Sam Spilsbury
88be75cbb3 lib: Add flatpak_installation_prune_local_repo
This is a method to explicitly prune the local repo, which
users might want to use if they had explicitly removed refs from
the underlying flatpak repo and want to ensure that the objects
referred to by those refs are cleared to save on disk space.

Closes: #1034
Approved by: alexlarsson
2017-09-28 15:39:05 +00:00
Sam Spilsbury
d0af046a2f system-helper: Add PruneLocalRepo method
We might want to prune the repo from within the library or
the command line and may not be in a privileged context, so
we'll need to jump through the system helper to prune the refs.

Closes: #1034
Approved by: alexlarsson
2017-09-28 15:39:05 +00:00
Sam Spilsbury
27a76acb5d dir: Don't prune refs immediately after calling flatpak_dir_remove_ref
It might be more efficient to perform this operation at the end of
removing a batch of refs, so perform it there instead.

Closes: #1034
Approved by: alexlarsson
2017-09-28 15:39:05 +00:00
Sam Spilsbury
96b4c5ed13 dir: Add gtkdoc comment for flatpak_dir_remove_ref
Closes: #1034
Approved by: alexlarsson
2017-09-28 15:39:05 +00:00
Sam Spilsbury
f05e87d6bf dir: No need to query remote in filter_out_deployed_refs
Closes: #1034
Approved by: alexlarsson
2017-09-28 15:39:05 +00:00
Sam Spilsbury
284138fa61 dir: Add FindMatchingRefsFlags flag argument find_matching_refs
In some cases, we want to include the repo part of the refspec,
for instance, if we are to pass refs directly to flatpak_dir_remove_ref

Closes: #1034
Approved by: alexlarsson
2017-09-28 15:39:05 +00:00
Sam Spilsbury
3f91b4d883 system-helper: Add RemoveLocalRef helper function
This depends on the modify-repo privilege

Closes: #1034
Approved by: alexlarsson
2017-09-28 15:39:05 +00:00
Sam Spilsbury
6236a60a1b lib: Add methods to clean up refs in the local repository
In some cases, a user might pull a ref into the local repository and
not deploy it by using FLATPAK_INSTALL_FLAGS_NO_DEPLOY. Later on, that
user might decide that they don't want to deploy the ref after all,
but there was no way to remove that ref from the local repository
in the public API, so it takes up disk space.

Add flatpak_installation_remove_local_ref_sync to remove a given
ref from the local repository if the ref is known and
flatpak_installation_cleanup_local_refs_sync to remove all undeployed
refs.

Fixes #1031

Closes: #1034
Approved by: alexlarsson
2017-09-28 15:39:05 +00:00
Sam Spilsbury
cdbfb001df lib: Fix copy-paste errors in documentation
Closes: #1034
Approved by: alexlarsson
2017-09-28 15:39:05 +00:00
Sam Spilsbury
99611aed52 dir: Add flatpak_dir_cleanup_undeployed_refs
This can be used to remove any undeployed refs from the local repo
in order to save on disk space.

Closes: #1034
Approved by: alexlarsson
2017-09-28 15:39:05 +00:00
Colin Walters
747f66158d tree-wide: Bump libglnx
A few fixes worth having, also just testing Homu.

```
Colin Walters (2):
      fdio: Open target dirname for glnx_file_copy_at()
      lockfile: Use an `initialized` member rather than explicit init

Jonathan Lebon (1):
      macros: use size_t for glnx_strjoina len

Philip Withnall (1):
      shutil: Fix assertion failure in glnx_shutil_mkdir_p_at()
```

Closes: #1046
Approved by: alexlarsson
2017-09-27 18:53:46 +00:00
Alexander Larsson
a77b96faec Use packaged ostree from updates-testing
This is faster than always rebuilding it

Closes: #1047
Approved by: alexlarsson
2017-09-27 18:12:32 +00:00
Alexander Larsson
d97f6dbf24 Whitespace change
Closes: #1045
Approved by: cgwalters
2017-09-27 14:26:05 +00:00
Alexander Larsson
ab27dfc014 Update pofiles 0.9.98.2 2017-09-27 00:36:51 +02:00
Alexander Larsson
6e49640eeb Update release to 0.9.98.2 2017-09-27 00:29:46 +02:00
Alexander Larsson
69d7474bcd Don't lock the system repo when pulling to a child repo
This causes permission denied when installing to the system
repo using the helper.
2017-09-26 23:24:18 +02:00
Alexander Larsson
de26d28a17 Update pofiles 0.9.98.1 2017-09-26 22:28:55 +02:00
Alexander Larsson
53977aa364 Update NEWS for release 2017-09-26 22:25:10 +02:00
Alexander Larsson
237d91e1da Bump version to 0.9.98.1 2017-09-26 22:25:10 +02:00
Fran Diéguez
248da89117 Add Galician translations (#1041) 2017-09-26 20:15:07 +02:00
Alexander Larsson
a265436574 run: Fix exporting the homedir if also exporting host
The FAKE_MODE_DIR support did not work correctly because of
a MAX() with a fallback value of 0, which is greater than
FAKE_MODE_DIR.
2017-09-26 20:12:19 +02:00
Alexander Larsson
b35177e4bf appstream update: Don't skip all arches if one is unchanged
Move skip_commit from a function global to a per-loop variable so
that it is reset for each architecture.
2017-09-26 16:34:30 +02:00
Piotr Drąg
7f289ca5e2 Fix Spanish in LINGUAS as well 2017-09-26 12:07:41 +02:00
Piotr Drąg
ee7bb8b066 Fix Spanish language code 2017-09-26 11:59:31 +02:00
Alexander Larsson
c3cfc4aa78 Remove unused variables 2017-09-26 11:58:44 +02:00
Alexander Larsson
531f9dbf24 CI: Install gettext-devel for autopoint 2017-09-26 11:58:44 +02:00
Alexander Larsson
ea8ba7597e CI: Use exactly ostree 2017.11 2017-09-26 11:58:44 +02:00
Piotr Drąg
5da86fd102 Update Polish translation 2017-09-26 11:58:19 +02:00
Simon McVittie
f8e5c200bc tests: Use a more realistic bwrap invocation to check for support
The kernel used on some autobuilders for the Debian PA-RISC port
can do "bwrap --ro-bind / / /bin/true", but not the bwrap invocations
made during the actual testing, which fail with "Creating new namespace
failed: Invalid argument". Make the trial bwrap invocation more like
what Flatpak actually does, so that these tests will hopefully be
skipped on such kernels.

Bug-Debian: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=876743
Signed-off-by: Simon McVittie <smcv@debian.org>
2017-09-26 10:41:49 +02:00
Alexander Larsson
35744c3c27 Update pofiles 0.9.98 2017-09-25 17:27:51 +02:00
Alexander Larsson
d1b6d9b4b7 Update NEWS for release 2017-09-25 16:52:08 +02:00