- r = raw_import_new(&import, event, arg_image_root, on_raw_finished, event);
- if (r < 0)
- return log_error_errno(r, "Failed to allocate importer: %m");
-
- r = raw_import_pull(import, url, local, arg_force);
- if (r < 0)
- return log_error_errno(r, "Failed to pull image: %m");
-
- r = sd_event_loop(event);
- if (r < 0)
- return log_error_errno(r, "Failed to run event loop: %m");
-
- log_info("Exiting.");
-
- return 0;
-}
-
-static void on_dkr_finished(DkrImport *import, int error, void *userdata) {
- sd_event *event = userdata;
- assert(import);
-
- if (error == 0)
- log_info("Operation completed successfully.");
- else
- log_error_errno(error, "Operation failed: %m");
-
- sd_event_exit(event, error);
-}
-
-static int pull_dkr(int argc, char *argv[], void *userdata) {
- _cleanup_(dkr_import_unrefp) DkrImport *import = NULL;
- _cleanup_event_unref_ sd_event *event = NULL;
- const char *name, *tag, *local;
- int r;
-
- if (!arg_dkr_index_url) {
- log_error("Please specify an index URL with --dkr-index-url=");
- return -EINVAL;
- }
-
- tag = strchr(argv[1], ':');
- if (tag) {
- name = strndupa(argv[1], tag - argv[1]);
- tag++;