update new compile so it doesent force updates

This commit is contained in:
2026-08-23 21:58:42 -04:00
parent 3d298bd609
commit fcf729b4c4
16 changed files with 52 additions and 17 deletions
+31 -5
View File
@@ -2,8 +2,8 @@
import hashlib
import json
import shutil
import tarfile
import shutil, io
import tarfile, gzip
from pathlib import Path
ROOT = Path(__file__).resolve().parent
@@ -14,7 +14,7 @@ PACKAGE_DIR = PACKAGE_ROOT / "raw"
# main repo
API_ROOT = "https://git.astronand.dev/Astronand/HyperionOS-packages/raw/branch/main"
#local repo
# local repo
#API_ROOT = "http://localhost:8001"
DEFAULT_VERSION = "0.0.0"
@@ -89,6 +89,15 @@ def read_dependencies(folder):
return dependencies if dependencies else DEFAULT_DEPENDENCIES
def reproducible_filter(info):
info.mtime = 0
info.uid = 0
info.gid = 0
info.uname = ""
info.gname = ""
return info
def create_package(folder):
name = folder.name
@@ -102,8 +111,25 @@ def create_package(folder):
debug(f"Packing {name}")
with tarfile.open(tarball, "w:gz") as archive:
archive.add(folder, arcname=name, filter=exclude)
# Create deterministic TAR
tar_data = io.BytesIO()
with tarfile.open(fileobj=tar_data, mode="w") as archive:
archive.add(
folder,
arcname=name,
filter=reproducible_filter,
)
# Create deterministic gzip
compressed = gzip.compress(
tar_data.getvalue(),
compresslevel=9,
mtime=0,
)
with open(tarball, "wb") as file:
file.write(compressed)
package_hash = sha256(tarball)