]> git.ipfire.org Git - pakfire.git/commitdiff
oci: Remove creating Docker metadata
authorMichael Tremer <michael.tremer@ipfire.org>
Sat, 8 Feb 2025 15:02:15 +0000 (15:02 +0000)
committerMichael Tremer <michael.tremer@ipfire.org>
Sat, 8 Feb 2025 15:02:15 +0000 (15:02 +0000)
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
src/pakfire/oci.c

index 18da4def91a521e77e999bcdcaf5a16c542f4af2..4afe91710e234889d7abe410028e3340677b7c64 100644 (file)
@@ -102,99 +102,6 @@ ERROR:
        return r;
 }
 
-static int pakfire_oci_writer_write_layer_version(struct pakfire_oci_writer* self) {
-       char filename[PATH_MAX];
-       int r;
-
-       const char* version = "1.0";
-
-       // Make the filename of the layer version
-       r = pakfire_path_format(filename, "%s/VERSION", self->layer_hexdigest);
-       if (r < 0)
-               return r;
-
-       // Write the version file
-       r = pakfire_archive_writer_create_file(self->image,
-                       filename, 0644, version, strlen(version));
-       if (r < 0)
-               return r;
-
-       return 0;
-}
-
-static int pakfire_oci_writer_write_layer_json(struct pakfire_oci_writer* self) {
-       struct json_object* o = NULL;
-       char filename[PATH_MAX];
-       char created[64];
-       int r;
-
-       // Make a new object
-       o = pakfire_json_new_object();
-       if (!o) {
-               r = -errno;
-               goto ERROR;
-       }
-
-       // Add the ID
-       r = pakfire_json_add_string(o, "id", self->layer_hexdigest);
-       if (r < 0)
-               goto ERROR;
-
-       // Format the current time
-       r = pakfire_strftime_now(created, "%Y-%m-%dT%H:%M:%SZ");
-       if (r < 0)
-               goto ERROR;
-
-       // Add the creation timestamp
-       r = pakfire_json_add_string(o, "created", created);
-       if (r < 0)
-               goto ERROR;
-
-       // Vendor
-       const char* vendor = pakfire_get_distro_vendor(self->pakfire);
-       if (vendor) {
-               r = pakfire_json_add_string(o, "author", vendor);
-               if (r < 0)
-                       goto ERROR;
-       }
-
-       const char* arch = pakfire_oci_arch(self->pakfire);
-
-       // Architecture
-       r = pakfire_json_add_string(o, "architecture", arch);
-       if (r < 0)
-               goto ERROR;
-
-       // OS
-       r = pakfire_json_add_string(o, "os", "linux");
-       if (r < 0)
-               goto ERROR;
-
-       // Version ID
-       const char* version_id = pakfire_get_distro_version_id(self->pakfire);
-       if (version_id) {
-               r = pakfire_json_add_string(o, "os.version", version_id);
-               if (r < 0)
-                       goto ERROR;
-       }
-
-       // Make the path
-       r = pakfire_path_format(filename, "%s/json", self->layer_hexdigest);
-       if (r < 0)
-               goto ERROR;
-
-       // Write the file to the image
-       r = pakfire_archive_writer_create_file_from_json(self->image, filename, 0644, o);
-       if (r < 0)
-               goto ERROR;
-
-ERROR:
-       if (o)
-               json_object_put(o);
-
-       return r;
-}
-
 static int pakfire_oci_writer_make_layer(struct pakfire_oci_writer* self) {
        char path[PATH_MAX] = PAKFIRE_TMP_DIR "/pakfire-oci-layer.XXXXXX";
        struct pakfire_archive_writer* layer = NULL;
@@ -247,16 +154,6 @@ static int pakfire_oci_writer_make_layer(struct pakfire_oci_writer* self) {
        if (r < 0)
                goto ERROR;
 
-       // Write the version file
-       r = pakfire_oci_writer_write_layer_version(self);
-       if (r < 0)
-               goto ERROR;
-
-       // Write the json file
-       r = pakfire_oci_writer_write_layer_json(self);
-       if (r < 0)
-               goto ERROR;
-
        // Make the filename of the layer file
        r = pakfire_path_format(filename, "%s/layer.tar", self->layer_hexdigest);
        if (r < 0)