mirror of
https://github.com/aclist/dztui.git
synced 2026-08-30 03:37:00 +02:00
Compare commits
No commits in common. "88ebbf4b49ac00376f04d96bfccd384933ee6225" and "460b07a4c552b966850195056a9c089a291e8e56" have entirely different histories.
88ebbf4b49
...
460b07a4c5
9
scripts/dl_pyapp.sh
Executable file
9
scripts/dl_pyapp.sh
Executable file
@ -0,0 +1,9 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
echo "$PWD"
|
||||
url="https://github.com/ofek/pyapp/releases/latest/download/source.tar.gz"
|
||||
output="${PWD}/pyapp-source.tar.gz"
|
||||
curl "$url" -Lo "$output"
|
||||
tar -xzf "$output"
|
||||
mv ${PWD}/pyapp-v* ${PWD}/pyapp-latest
|
||||
rm "$output"
|
||||
@ -1,3 +1,4 @@
|
||||
from pprint import pprint
|
||||
import tomllib
|
||||
from pathlib import Path
|
||||
|
||||
|
||||
@ -9,11 +9,6 @@ from concat_licenses import concat_license
|
||||
from parse_toml import get_entrypoint
|
||||
from prebuild import get_pyapp, rebuild_cpython
|
||||
|
||||
def update_uname(info: tarfile.TarInfo) -> tarfile.TarInfo:
|
||||
info.uname = "dzgui"
|
||||
info.gname = "users"
|
||||
return info
|
||||
|
||||
root = Path(__file__).resolve().parents[1]
|
||||
output = root.joinpath("dist")
|
||||
build_dir = root.joinpath("build")
|
||||
@ -65,18 +60,30 @@ if proc.returncode == 0:
|
||||
release_exe = subfolder.joinpath(appname)
|
||||
output_exe.rename(release_exe)
|
||||
tarpath = output.joinpath(tarname)
|
||||
|
||||
with tarfile.open(tarpath, "w:gz") as tar:
|
||||
info = tar.gettarinfo(subfolder)
|
||||
tar.add(subfolder, arcname="dzgui", filter=update_uname)
|
||||
info.type = tarfile.DIRTYPE
|
||||
info.uname = appname
|
||||
info.name = appname
|
||||
#with open(subfolder, "rb") as f:
|
||||
# tar.add(info, f)
|
||||
|
||||
tar.add(subfolder, arcname="dzgui")
|
||||
|
||||
#for file in subfolder.iterdir():
|
||||
# info = tar.gettarinfo(file)
|
||||
# info.uname = appname
|
||||
# info.name = appname
|
||||
# with open(file, "rb") as f:
|
||||
# tar.addfile(info, f)
|
||||
print(f"Wrote tarfile to '{tarpath}'")
|
||||
|
||||
proc = subprocess.run([release_exe, "-v"], capture_output=True, text=True)
|
||||
assert proc.stdout.rstrip() == version
|
||||
|
||||
# TODO: clean up staging directory
|
||||
release_exe.unlink()
|
||||
license_file.unlink()
|
||||
subfolder.rmdir()
|
||||
Path(wheel).unlink()
|
||||
|
||||
# TODO: clean up staging directory
|
||||
|
||||
Loading…
Reference in New Issue
Block a user