diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index eb9522b7..1a382925 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -20,9 +20,6 @@ jobs: distro: ubuntu_latest steps: - uses: actions/checkout@v4.2.2 - with: - submodules: true - set-safe-directory: true - uses: uraimo/run-on-arch-action@v2.8.1 name: Build @@ -33,9 +30,6 @@ jobs: githubToken: ${{ github.token }} - setup: | - git submodule update --init --recursive - install: | apt-get update -q -y apt-get install -q -y python3 automake libtool autotools-dev git make cmake pkg-config gcc wget xz-utils libjansson-dev diff --git a/Containerfile b/Containerfile index b249382e..3f4ade7e 100644 --- a/Containerfile +++ b/Containerfile @@ -16,5 +16,5 @@ COPY . libocispec RUN cd libocispec && \ ./autogen.sh && \ ./configure CFLAGS='-Wall -Wextra -Werror' && \ - make -j $(nproc) distcheck DISTCHECK_CONFIGURE_FLAGS="--enable-embedded-yajl" AM_DISTCHECK_DVI_TARGET="" TESTS="" && \ - make clean \ No newline at end of file + make -j $(nproc) distcheck AM_DISTCHECK_DVI_TARGET="" TESTS="" && \ + make clean diff --git a/ocispec.pc.in b/ocispec.pc.in index 32673036..e380ffcf 100644 --- a/ocispec.pc.in +++ b/ocispec.pc.in @@ -5,7 +5,7 @@ includedir=@includedir@ Name: @PACKAGE_NAME@ Description: A library for easily parsing [OCI runtime](https://github.com/opencontainers/runtime-spec) and [OCI image](https://github.com/opencontainers/image-spec) files. -Requires: yajl jansson +Requires: jansson Version: @PACKAGE_VERSION@ Libs: -L${libdir} -locispec Cflags: -I${includedir}/ocispec diff --git a/src/ocispec/json_common.c b/src/ocispec/json_common.c index 6d56b4ff..a7e050b0 100644 --- a/src/ocispec/json_common.c +++ b/src/ocispec/json_common.c @@ -5,9 +5,6 @@ #include #include "ocispec/json_common.h" -#define YAJL_GET_OBJECT_NO_CHECK(v) (&(v)->u.object) -#define YAJL_GET_STRING_NO_CHECK(v) ((v)->u.string) - #define MAX_NUM_STR_LEN 21 char * @@ -893,4 +890,4 @@ json_t *copy_unmatched_fields(json_t *src, const char **exclude_keys, size_t num } return dst; -} \ No newline at end of file +} diff --git a/src/ocispec/sources.py b/src/ocispec/sources.py index 0d9ae742..424eba3f 100755 --- a/src/ocispec/sources.py +++ b/src/ocispec/sources.py @@ -131,34 +131,6 @@ def parse_obj_type_array(obj, c_file, prefix, obj_typename): c_file.append(' }\n') c_file.append(' }\n') c_file.append(' while (0);\n') - elif obj.subtyp == 'byte': - c_file.append(' do\n') - c_file.append(' {\n') - c_file.append(f' yajl_val tmp = get_val (tree, "{obj.origname}", yajl_t_string);\n') - c_file.append(' if (tmp != NULL)\n') - c_file.append(' {\n') - if obj.doublearray: - c_file.append(' yajl_val *items = YAJL_GET_ARRAY_NO_CHECK(tmp)->values;\n') - c_file.append(f' ret->{obj.fixname} = calloc ( YAJL_GET_ARRAY_NO_CHECK(tmp)->len + 1, sizeof (*ret->{obj.fixname}));\n') - c_file.append(f' if (ret->{obj.fixname}[i] == NULL)\n') - c_file.append(' return NULL;\n') - c_file.append(' size_t j;\n') - c_file.append(' for (j = 0; j < YAJL_GET_ARRAY_NO_CHECK(tmp)->len; j++)\n') - c_file.append(' {\n') - c_file.append(' char *str = YAJL_GET_STRING (itmes[j]);\n') - c_file.append(f' ret->{obj.fixname}[j] = (uint8_t *)strdup (str ? str : "");\n') - c_file.append(f' if (ret->{obj.fixname}[j] == NULL)\n') - c_file.append(" return NULL;\n") - c_file.append(' };\n') - else: - c_file.append(' char *str = YAJL_GET_STRING (tmp);\n') - c_file.append(f' ret->{obj.fixname} = (uint8_t *)strdup (str ? str : "");\n') - c_file.append(f' if (ret->{obj.fixname} == NULL)\n') - c_file.append(' return NULL;\n') - c_file.append(f' ret->{obj.fixname}_len = str != NULL ? strlen (str) : 0;\n') - c_file.append(' }\n') - c_file.append(' }\n') - c_file.append(' while (0);\n') else: c_file.append(' do\n') c_file.append(' {\n') @@ -682,8 +654,6 @@ def read_val_generator(c_file, level, src, dest, typ, keyname, obj_typename): c_file.append(f'{" " * (level + 1)}sinvalid = json_double_to_{num_type} (json_number_value(val), {dest});\n') c_file.append(f"{' ' * (level + 1)}if (invalid)\n") c_file.append(f'{" " * (level + 1)} {{\n') - c_file.append(f'{" " * (level + 1)} if (asprintf (err, "Invalid value \'%s\' with type \'{typ}\' ' \ - f'for key \'{keyname}\': %s", YAJL_GET_NUMBER (val), strerror (-invalid)) < 0)\n') c_file.append(f'{" " * (level + 1)} *err = strdup ("error allocating memory");\n') c_file.append(f"{' ' * (level + 1)} return NULL;\n") c_file.append(f'{" " * (level + 1)}}}\n')