Move xattr handling into libgsystem, fix sysroot to handle directory ownership/perms

This large patch moves the core xattr logic down into libgsystem,
which allows the gs_shutil_cp_a() API to copy them.  In turn, this
allows us to just use that API instead of rolling our own recursive
copy here.

As noted in the new comment though, one case that we are explicitly
regressing is where the new /etc removes a parent directory that's
needed by a modified file.  This seems unlikely for most vendors now,
but let's do that as a separate bug.

https://bugzilla.gnome.org/show_bug.cgi?id=711058
This commit is contained in:
Colin Walters committed 2013-11-28 23:28:13 -05:00
1 parent a897b42a7a
commit a24afd68f0
11 files changed
+122 -311

No files matched your search

+4 -4
View File
@@ -92,7 +92,7 @@ commit_loose_object_trusted (OstreeRepo *self,
*/
if (xattrs != NULL)
{
if (!_ostree_set_xattrs (temp_file, xattrs, cancellable, error))
if (!gs_file_set_all_xattrs (temp_file, xattrs, cancellable, error))
goto out;
}
}
@@ -131,7 +131,7 @@ commit_loose_object_trusted (OstreeRepo *self,
if (xattrs)
{
if (!_ostree_set_xattrs_fd (fd, xattrs, cancellable, error))
if (!gs_fd_set_all_xattrs (fd, xattrs, cancellable, error))
goto out;
}
}
@@ -1722,7 +1722,7 @@ write_directory_to_mtree_internal (OstreeRepo *self,
g_debug ("Adding: %s", gs_file_get_path_cached (dir));
if (!(modifier && (modifier->flags & OSTREE_REPO_COMMIT_MODIFIER_FLAGS_SKIP_XATTRS) > 0))
{
if (!ostree_get_xattrs_for_file (dir, &xattrs, cancellable, error))
if (!gs_file_get_all_xattrs (dir, &xattrs, cancellable, error))
goto out;
}
@@ -1818,7 +1818,7 @@ write_directory_to_mtree_internal (OstreeRepo *self,
if (!(modifier && (modifier->flags & OSTREE_REPO_COMMIT_MODIFIER_FLAGS_SKIP_XATTRS) > 0))
{
g_clear_pointer (&xattrs, (GDestroyNotify) g_variant_unref);
if (!ostree_get_xattrs_for_file (child, &xattrs, cancellable, error))
if (!gs_file_get_all_xattrs (child, &xattrs, cancellable, error))
goto out;
}