diff --git a/src/ostree/ot-builtin-create-usb.c b/src/ostree/ot-builtin-create-usb.c index 02b55b94..07a214c6 100644 --- a/src/ostree/ot-builtin-create-usb.c +++ b/src/ostree/ot-builtin-create-usb.c @@ -201,11 +201,7 @@ ostree_builtin_create_usb (int argc, /* FIXME: It should be possible to work without this, but find_remotes_cb() in * ostree-repo-pull.c currently assumes a summary file (signed or unsigned) is * present. */ - struct stat stbuf; - if (!glnx_fstatat_allow_noent (ostree_repo_get_dfd (dest_repo), "summary", &stbuf, 0, error)) - return FALSE; - if (errno == ENOENT && - !ostree_repo_regenerate_summary (dest_repo, NULL, cancellable, error)) + if (!ostree_repo_regenerate_summary (dest_repo, NULL, cancellable, error)) return FALSE; /* Add the symlinks .ostree/repos.d/@symlink_name → @dest_repo_path, unless diff --git a/tests/test-create-usb.sh b/tests/test-create-usb.sh index 310385d9..392352fd 100755 --- a/tests/test-create-usb.sh +++ b/tests/test-create-usb.sh @@ -96,7 +96,10 @@ ${CMD_PREFIX} ostree --repo=dest-mount3/.ostree/repos.d/00-generated refs --coll assert_file_has_content dest-refs "^(org.example.Collection1, test-1)$" assert_file_has_content dest-refs "^(org.example.Collection1, test-2)$" assert_file_has_content dest-refs "^(org.example.Collection1, test-3)$" -assert_has_file dest-mount3/.ostree/repos.d/00-generated/summary +${CMD_PREFIX} ostree --repo=dest-mount3/.ostree/repos.d/00-generated summary -v > dest-summary +assert_file_has_content dest-summary "(org.example.Collection1, test-1)$" +assert_file_has_content dest-summary "(org.example.Collection1, test-2)$" +assert_file_has_content dest-summary "(org.example.Collection1, test-3)$" echo "ok 4 adding ref to an existing usb"