Port to GLnxTmpfile
There's lots of mechanically replacing `OtTmpFile` with `GLnxTmpfile`; the biggest changes are in the commit path. Symlink commits are now very clearly separated from regular files. Symlinks are `OtCleanupUnlinkat`, and regular files are `GLnxTmpfile`. The commit codepath separates those as `_ostree_repo_commit_path_final()` and `_ostree_repo_commit_tmpf_final()`. A nice aspect of all of this is that they both *consume* the temporary on success. This avoids an extra spurious `unlink()` call. One of the biggest bits of code motion is in `commit_loose_regfile_object()`, which no longer needs to care about symlinks. For the most parth though it's just removing conditionals. Update submodule: libglnx Closes: #958 Approved by: jlebon
This commit is contained in:
1 parent
79f285d188
commit
5776d5dcc0
13 files changed
+278
-358
No files matched your search
@@ -941,12 +941,10 @@ content_fetch_on_complete (GObject *object,
|
||||
|
||||
if (!have_object)
|
||||
{
|
||||
if (!_ostree_repo_commit_loose_final (pull_data->repo, checksum, OSTREE_OBJECT_TYPE_FILE,
|
||||
tmp_unlinker.dfd, -1, tmp_unlinker.path,
|
||||
cancellable, error))
|
||||
if (!_ostree_repo_commit_path_final (pull_data->repo, checksum, objtype,
|
||||
&tmp_unlinker,
|
||||
cancellable, error))
|
||||
goto out;
|
||||
/* The path was consumed */
|
||||
ot_cleanup_unlinkat_clear (&tmp_unlinker);
|
||||
}
|
||||
pull_data->n_fetched_content++;
|
||||
}
|
||||
@@ -954,6 +952,7 @@ content_fetch_on_complete (GObject *object,
|
||||
{
|
||||
/* Non-mirroring path */
|
||||
|
||||
/* If it appears corrupted, we'll delete it below */
|
||||
if (!ostree_content_file_parse_at (TRUE, _ostree_fetcher_get_dfd (fetcher),
|
||||
tmp_unlinker.path, FALSE,
|
||||
&file_in, &file_info, &xattrs,
|
||||
|
||||
Reference in new issue
Block a user