update utils scripts

This commit is contained in:
Stepland 2023-07-28 13:48:55 +02:00
parent d589a7746d
commit c3e797f9e0
2 changed files with 7 additions and 6 deletions

View File

@ -28,7 +28,7 @@ def ldd(files):
# split output into lines # split output into lines
ldd_lines = ldd_output.split(os.linesep) ldd_lines = ldd_output.split(os.linesep)
# parse lines that match this format : <file name> ==> <file path> (<memory address>) # parse lines that match this format : <file name> ==> <file path> (<memory address>)
file_pattern = cygpath("/") + "mingw(32|64)/bin/.*" file_pattern = cygpath("/") + "(ucrt64|(mingw(32|64)))/bin/.*"
print(file_pattern) print(file_pattern)
pattern = "(.*) => (" + file_pattern + r") \((.*)\)" pattern = "(.*) => (" + file_pattern + r") \((.*)\)"
regex = re.compile(pattern) regex = re.compile(pattern)

View File

@ -6,13 +6,15 @@ import shutil
import subprocess import subprocess
from pathlib import Path from pathlib import Path
git_version = subprocess.check_output(["git", "describe", "--tags"]).strip().decode("utf-8")
parser = argparse.ArgumentParser() parser = argparse.ArgumentParser()
parser.add_argument("release_name") parser.add_argument("--release-version", default=git_version)
parser.add_argument("--timestamp", action="store_true") parser.add_argument("--timestamp", action="store_true")
parser.add_argument("--build-dir", type=Path, default=Path("build")) parser.add_argument("--build-dir", type=Path, default=Path("build"))
args = parser.parse_args() args = parser.parse_args()
release_folder = Path(args.release_name) release_folder = Path(f"FEIS-{args.release_version}")
if release_folder.exists(): if release_folder.exists():
shutil.rmtree(release_folder) shutil.rmtree(release_folder)
release_folder.mkdir() release_folder.mkdir()
@ -27,11 +29,10 @@ subprocess.run([
"-f", release_folder / "FEIS.exe" "-f", release_folder / "FEIS.exe"
]) ])
archive_name = args.release_name archive_name = release_folder
if args.timestamp: if args.timestamp:
timestamp = datetime.datetime.utcnow().strftime("%Y%m%dT%H%M%S") timestamp = datetime.datetime.utcnow().strftime("%Y%m%dT%H%M%S")
archive_name = f"{args.release_name}+{timestamp}" archive_name = f"{release_folder}+{timestamp}"
shutil.make_archive( shutil.make_archive(
archive_name, archive_name,