Prepare webOSbrew publishing audit and safe symlink autostart

This commit is contained in:
matze19999 committed 2026-10-06 13:43:00 +02:00
1 parent aaa8aa82e6
commit b81cb9a8a0
16 files changed
+185 -31

No files matched your search

+3 -3
View File
@@ -1,9 +1,9 @@
"""Package own app and executable; no Signify or LG binaries are included."""
import io, json, struct, tarfile, zlib
import io, json, tarfile
from pathlib import Path
ROOT=Path(__file__).resolve().parent
ID='org.webosbrew.histogramhyperion'
VERSION=json.loads((ROOT/'app/appinfo.json').read_text())['version']
VERSION=json.loads((ROOT/'app/appinfo.json').read_text(encoding='utf-8'))['version']
def tar_bytes(entries):
stream=io.BytesIO()
with tarfile.open(fileobj=stream,mode='w:gz') as tar:
@@ -14,7 +14,7 @@ def tar_bytes(entries):
entries=[]
for directory,target in [('app','applications/'+ID),('service','services/'+ID+'.service'),('package','packages/'+ID)]:
for path in sorted((ROOT/directory).iterdir()):
if path.is_file() and path.name not in {"led-mapping.txt", "led-interpolation.txt"}:entries.append(('usr/palm/'+target+'/'+path.name,path.read_bytes(),0o755 if path.name=='histogram-service' else 0o644))
if path.is_file() and path.name not in {"led-mapping.txt", "led-interpolation.txt"}:entries.append(('usr/palm/'+target+'/'+path.name,path.read_bytes(),0o755 if path.name in {'histogram-service','boot.sh'} else 0o644))
control=f'Package: {ID}\nVersion: {VERSION}\nArchitecture: arm\nMaintainer: Local development\nDescription: HyperDRM ambient light for webOS and Hyperion\nSection: misc\nPriority: optional\n\n'.encode()
members=[('debian-binary',b'2.0\n'),('control.tar.gz',tar_bytes([('control',control,0o644)])),('data.tar.gz',tar_bytes(entries))]
out=bytearray(b'!<arch>\n')