How to use the conan.LAYER_TAR_FILE function in conan

To help you get started, we’ve selected a few conan examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github nexB / conan / src / conan / image_v11.py View on Github external
'in: %(layer_format_version_file)r. '
                    'Supported version: %(supported_format_version)r') % locals()
        else:
            print('Missing layer VERSION for:', layer_dir)

        if not LAYER_JSON_FILE in files:
            print('Missing layer json for:', layer_dir)
            return Layer(layer_id=layer_id)

        # load data
        with open(join(layer_dir, LAYER_JSON_FILE)) as layer_json:
            layer_data = json.load(layer_json, object_pairs_hook=OrderedDict)

        # Note: it is possible to have an EMPTY layer.tar that is a link to another
        # non-empty layer.tar
        if LAYER_TAR_FILE in files:
            layer_tar = join(layer_dir, LAYER_TAR_FILE)
            layer_digest = sha256_digest(layer_tar)
            layer_size = filetype.get_size(layer_tar)
        else:
            layer_digest = None
            layer_size = 0

        # do not rely on this
        if 'Size' in layer_data:
            del layer_data['Size']

        # do not rely on this
        if 'id' in layer_data:
            lid = layer_data.pop('id')
            # make some basic checks
            assert layer_id == lid
github nexB / conan / src / conan / image_v11.py View on Github external
'Supported version: %(supported_format_version)r') % locals()
        else:
            print('Missing layer VERSION for:', layer_dir)

        if not LAYER_JSON_FILE in files:
            print('Missing layer json for:', layer_dir)
            return Layer(layer_id=layer_id)

        # load data
        with open(join(layer_dir, LAYER_JSON_FILE)) as layer_json:
            layer_data = json.load(layer_json, object_pairs_hook=OrderedDict)

        # Note: it is possible to have an EMPTY layer.tar that is a link to another
        # non-empty layer.tar
        if LAYER_TAR_FILE in files:
            layer_tar = join(layer_dir, LAYER_TAR_FILE)
            layer_digest = sha256_digest(layer_tar)
            layer_size = filetype.get_size(layer_tar)
        else:
            layer_digest = None
            layer_size = 0

        # do not rely on this
        if 'Size' in layer_data:
            del layer_data['Size']

        # do not rely on this
        if 'id' in layer_data:
            lid = layer_data.pop('id')
            # make some basic checks
            assert layer_id == lid