return arch;
}
+static int pakfire_oci_writer_write_oci_layout(struct pakfire_oci_writer* self) {
+ struct json_object* o = NULL;
+ int r;
+
+ // Make a new object
+ o = pakfire_json_new_object();
+ if (!o) {
+ r = -errno;
+ goto ERROR;
+ }
+
+ // Set version
+ r = pakfire_json_add_string(o, "imageLayoutVersion", "1.0.0");
+ if (r < 0)
+ goto ERROR;
+
+ // Write the file
+ r = pakfire_archive_writer_create_file_from_json(self->image, "oci-layout", 0644, o);
+ if (r < 0)
+ goto ERROR;
+
+ERROR:
+ if (o)
+ json_object_put(o);
+
+ return r;
+}
+
static int pakfire_oci_writer_write_layer_version(struct pakfire_oci_writer* self) {
char filename[PATH_MAX];
int r;
if (r < 0)
goto ERROR;
+ // Write oci-layout file
+ r = pakfire_oci_writer_write_oci_layout(&writer);
+ if (r < 0) {
+ ERROR(writer.ctx, "Failed to write the OCI layout file: %s\n", strerror(-r));
+ goto ERROR;
+ }
+
// Make the layer
r = pakfire_oci_writer_make_layer(&writer);
if (r < 0)