| Server IP : 198.38.94.13 / Your IP : 216.73.217.33 Web Server : Apache System : Linux d4744.dxb1.stableserver.net 5.14.0-611.49.1.el9_7.x86_64 #1 SMP PREEMPT_DYNAMIC Tue Apr 21 16:39:08 EDT 2026 x86_64 User : revivere ( 1140) PHP Version : 8.2.33 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : OFF | Pkexec : OFF Directory : /opt/saltstack/salt/lib/python3.10/site-packages/relenv/ |
Upload File : |
# Copyright 2022-2026 Broadcom.
# SPDX-License-Identifier: Apache-2.0
#
"""
Relenv manifest.
"""
from __future__ import annotations
import hashlib
import os
import pathlib
import sys
def manifest(root: str | os.PathLike[str] | None = None) -> None:
"""
List all the file in a relenv and their hashes.
"""
base = pathlib.Path(root) if root is not None else pathlib.Path(getattr(sys, "RELENV", os.getcwd()))
for dirpath, _dirs, files in os.walk(base):
directory = pathlib.Path(dirpath)
for file in files:
hsh = hashlib.sha256()
file_path = directory / file
try:
with open(file_path, "rb") as fp:
while True:
chunk = fp.read(9062)
if not chunk:
break
hsh.update(chunk)
except OSError:
pass
print(f"{file_path} => {hsh.hexdigest()}")
if __name__ == "__main__":
manifest()