repo: Introduce ostree_repo_open_at() and ostree_repo_create_at()

This essentially completes our fd-relative conversion.

While here, I cleaned up the semantics of `ostree_repo_create()` and
`ostree_repo_create_at()` to be more atomic - basically various scripts were
testing for the `objects` subdirectory, so let's formalize that.

Closes: #820
Approved by: jlebon
This commit is contained in:
Colin Walters authored and Atomic Bot committed 2017-08-15 12:35:10 +00:00
1 parent 64b7c42025
commit fd98bda3c7
10 files changed
+297 -156

No files matched your search

+1 -5
View File
@@ -70,7 +70,6 @@ static void
teardown (Fixture *fixture,
gconstpointer test_data)
{
glnx_fd_close int parent_repo_dfd = -1;
g_autoptr(GError) error = NULL;
/* Recursively remove the temporary directory. */
@@ -81,10 +80,7 @@ teardown (Fixture *fixture,
/* The repo also needs its source files to be removed. This is the inverse
* of setup_test_repository() in libtest.sh. */
g_autofree gchar *parent_repo_path = g_file_get_path (ostree_repo_get_path (fixture->parent_repo));
glnx_opendirat (-1, parent_repo_path, TRUE, &parent_repo_dfd, &error);
g_assert_no_error (error);
int parent_repo_dfd = ostree_repo_get_dfd (fixture->parent_repo);
glnx_shutil_rm_rf_at (parent_repo_dfd, "../files", NULL, NULL);
glnx_shutil_rm_rf_at (parent_repo_dfd, "../repo", NULL, NULL);
+1 -5
View File
@@ -73,7 +73,6 @@ static void
teardown (Fixture *fixture,
gconstpointer test_data)
{
glnx_fd_close int parent_repo_dfd = -1;
g_autoptr(GError) error = NULL;
/* Recursively remove the temporary directory. */
@@ -84,10 +83,7 @@ teardown (Fixture *fixture,
/* The repo also needs its source files to be removed. This is the inverse
* of setup_test_repository() in libtest.sh. */
g_autofree gchar *parent_repo_path = g_file_get_path (ostree_repo_get_path (fixture->parent_repo));
glnx_opendirat (-1, parent_repo_path, TRUE, &parent_repo_dfd, &error);
g_assert_no_error (error);
int parent_repo_dfd = ostree_repo_get_dfd (fixture->parent_repo);
glnx_shutil_rm_rf_at (parent_repo_dfd, "../files", NULL, NULL);
glnx_shutil_rm_rf_at (parent_repo_dfd, "../repo", NULL, NULL);