mirror of
https://gitlab.com/square-game-liberation-front/F.E.I.S.git
synced 2025-03-01 07:50:25 +01:00
fix debian packaging and version bumping script
This commit is contained in:
parent
1302543400
commit
e48aefdf2a
@ -9,9 +9,8 @@ Depends: libsfml-system2.5 (>= 2.5.1), libsfml-window2.5 (>= 2.5.1), libsfml-gra
|
||||
Architecture: amd64
|
||||
Description: jubeat chart editor
|
||||
F.E.I.S is a GUI chart editor for jubeat and its simulators, inspired by ArrowVortex
|
||||
Links: /opt/f.e.i.s/bin/f.e.i.s /usr/bin/f.e.i.s
|
||||
Files: f.e.i.s /opt/f.e.i.s/bin
|
||||
assets.tar.gz /opt/f.e.i.s/bin
|
||||
Files: f.e.i.s /usr/bin
|
||||
assets.tar.gz /tmp/f.e.i.s
|
||||
f.e.i.s.desktop /usr/share/applications
|
||||
f.e.i.s.svg /usr/share/icons/hicolor/scalable/apps
|
||||
Postinst: postinst
|
||||
|
@ -5,12 +5,11 @@
|
||||
/usr/bin/gtk-update-icon-cache /usr/share/icons/* &>/dev/null || true
|
||||
|
||||
# extract assets
|
||||
mkdir -p /usr/share/f.e.i.s
|
||||
tar \
|
||||
--extract \
|
||||
--gzip \
|
||||
--directory /opt/f.e.i.s/bin \
|
||||
--file /opt/f.e.i.s/bin/assets.tar.gz
|
||||
rm -f /opt/f.e.i.s/bin/assets.tar.gz
|
||||
|
||||
mkdir -p /opt/f.e.i.s/bin/settings
|
||||
chmod 777 /opt/f.e.i.s/bin/settings
|
||||
--directory /usr/share/f.e.i.s \
|
||||
--strip-components=1 \
|
||||
--file /tmp/f.e.i.s/assets.tar.gz
|
||||
rm -f /tmp/f.e.i.s/assets.tar.gz
|
@ -5,4 +5,4 @@
|
||||
/usr/bin/gtk-update-icon-cache /usr/share/icons/* &>/dev/null || true
|
||||
|
||||
# remove extracted assets not tracked by the .deb package
|
||||
rm -rf /opt/f.e.i.s/bin/assets
|
||||
rm -rf /usr/share/f.e.i.s
|
@ -2,6 +2,7 @@ import argparse
|
||||
import re
|
||||
import subprocess
|
||||
from dataclasses import dataclass
|
||||
from pathlib import Path
|
||||
|
||||
@dataclass
|
||||
class Version:
|
||||
@ -24,11 +25,25 @@ def parse_version(text: str) -> Version:
|
||||
else:
|
||||
raise ValueError(f"Couldn't parse {text} as a version number")
|
||||
|
||||
def rewrite_debian_control_file():
|
||||
path = Path(__file__).parents[1] / "debian_packaging/f.e.i.s-control"
|
||||
with path.open(mode="r+") as f:
|
||||
debian_control_lines = f.readlines()
|
||||
for i in range(len(debian_control_lines)):
|
||||
line = debian_control_lines[i]
|
||||
if line.startswith("Version:"):
|
||||
debian_control_lines[i] = f"Version: {args.version}\n"
|
||||
|
||||
f.truncate(0)
|
||||
f.seek(0)
|
||||
f.writelines(debian_control_lines)
|
||||
|
||||
|
||||
parser = argparse.ArgumentParser()
|
||||
parser.add_argument("version", type=parse_version)
|
||||
args = parser.parse_args()
|
||||
|
||||
rewrite_debian_control_file()
|
||||
subprocess.check_call(["meson", "rewrite", "kwargs", "set", "project", "/", "version", str(args.version)])
|
||||
subprocess.check_call(["git", "add", "meson.build"])
|
||||
subprocess.check_call(["git", "commit", "-m", f"bump to v{args.version}"])
|
||||
|
Loading…
x
Reference in New Issue
Block a user