summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSimon McVittie <smcv@collabora.com>2022-03-12 11:35:25 +0000
committerSimon McVittie <smcv@collabora.com>2022-03-14 13:21:27 +0000
commit79df7151b68a78f98c012eaf552a0609728fc533 (patch)
tree418bbd0d4273734a2db556f416b36aabe1c2ca20
parent6196a7aa13b8ad1a1d700c07ac3e9331f9575dee (diff)
downloadflatpak-79df7151b68a78f98c012eaf552a0609728fc533.tar.gz
dir: Consistently use relative paths for libostree subpaths
The subpath is resolved relative to the root of the commit, so we can use either an absolute or a relative path interchangeably. When using libostree < 2021.6 with GLib >= 2.71, absolute paths cause an assertion failure here; that was a libostree bug and was fixed in 2021.6, but we can interoperate with more versions by sticking to relative paths, and there's no real reason to prefer absolute. Resolves: https://github.com/flatpak/flatpak/issues/4805 Co-authored-by: Corentin Noël <corentin.noel@collabora.com> Signed-off-by: Simon McVittie <smcv@collabora.com> (cherry picked from commit 2df1b1628c277cd4ce2d40c31bd6a3eb3ee9662e)
-rw-r--r--common/flatpak-dir.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/common/flatpak-dir.c b/common/flatpak-dir.c
index 7521adbf..3f8f2567 100644
--- a/common/flatpak-dir.c
+++ b/common/flatpak-dir.c
@@ -8406,7 +8406,7 @@ flatpak_dir_deploy (FlatpakDir *self,
if (!g_file_make_directory_with_parents (files, cancellable, error))
return FALSE;
- options.subpath = "/metadata";
+ options.subpath = "metadata";
if (!ostree_repo_checkout_at (self->repo, &options,
AT_FDCWD, checkoutdirpath,
@@ -8419,7 +8419,7 @@ flatpak_dir_deploy (FlatpakDir *self,
for (i = 0; subpaths[i] != NULL; i++)
{
- g_autofree char *subpath = g_build_filename ("/files", subpaths[i], NULL);
+ g_autofree char *subpath = g_build_filename ("files", subpaths[i], NULL);
g_autofree char *dstpath = g_build_filename (checkoutdirpath, "/files", subpaths[i], NULL);
g_autofree char *dstpath_parent = g_path_get_dirname (dstpath);
g_autoptr(GFile) child = NULL;