HEX
Server: Apache
System: Linux server.enlacediseno.com 4.18.0-553.62.1.el8_10.x86_64 #1 SMP Wed Jul 16 04:08:25 EDT 2025 x86_64
User: maor (1069)
PHP: 7.3.33
Disabled: exec,passthru,shell_exec,system
Upload Files
File: //opt/saltstack/salt/lib/python3.10/site-packages/relenv/manifest.py
# Copyright 2025 Broadcom.
# SPDX-License-Identifier: Apache-2.0
#
"""
Relenv manifest.
"""
import hashlib
import os
import sys


def manifest(root=None):
    """
    List all the file in a relenv and their hashes.
    """
    if root is None:
        root = getattr(sys, "RELENV", os.getcwd())
    for root, dirs, files in os.walk(root):
        for file in files:
            hsh = hashlib.sha256()
            try:
                with open(root + os.path.sep + file, "rb") as fp:
                    while True:
                        chunk = fp.read(9062)
                        if not chunk:
                            break
                        hsh.update(chunk)
            except OSError:
                pass
            print(f"{root + os.path.sep + file} => {hsh.hexdigest()}")


if __name__ == "__main__":
    manifest()