sandcastle-ng

Scripts for the deployment of Sandcastle (GNU Taler)
Log | Files | Refs | README

commit 40cc8c887e0ac0ffd19aee6d2f67cf632f0a33c9
parent 457f3084ee2fe86489959d2d7e3560562b67de1d
Author: Florian Dold <florian@dold.me>
Date:   Tue,  9 Jun 2026 22:12:08 +0200

bump, install build dependencies automatically

Diffstat:
MDockerfile | 5++++-
Mbuildconfig/taler-merchant.tag | 2+-
Mbuildscripts/sandcastle-build-generic | 31++++++++++++++++++-------------
3 files changed, 23 insertions(+), 15 deletions(-)

diff --git a/Dockerfile b/Dockerfile @@ -67,7 +67,10 @@ RUN DEBIAN_FRONTEND=noninteractive \ python3-requests \ python3-click \ pybuild-plugin-pyproject \ - pandoc + pandoc \ + devscripts \ + equivs \ + ; # FIXME: Try to use debian packages where possible and otherwise really use # a venv or per-user installation of the package. diff --git a/buildconfig/taler-merchant.tag b/buildconfig/taler-merchant.tag @@ -1 +1 @@ -v1.5.18-dev.11 +v1.6.2-dev.1 diff --git a/buildscripts/sandcastle-build-generic b/buildscripts/sandcastle-build-generic @@ -28,10 +28,6 @@ def run_cmd(cmd, shell=False, cwd=None, env=None): subprocess.check_call(cmd, shell=shell, cwd=cwd, env=command_env) -def get_output(cmd, shell=False, cwd=None): - """Helper to get command output as string.""" - return subprocess.check_output(cmd, shell=shell, cwd=cwd, text=True).strip() - def get_tag_debver(tag): """Get a debian version string from a git tag""" if tag.startswith("v"): @@ -73,6 +69,20 @@ def main(): with open(f"/buildconfig/{package}.tag", 'r') as f: tag = f.read().strip() + outdir = f"/packages/{package}/" + + os.makedirs(outdir, exist_ok=True) + + os.chdir("/packages/") + + # Using shell=True here to easily handle the pipe logic + run_cmd("dpkg-scanpackages . | xz - > /packages/Packages.xz", shell=True) + + with open("/etc/apt/sources.list.d/taler-packaging-local.list", "w") as f: + f.write("deb [trusted=yes] file:/packages ./\n") + + run_cmd(["apt-get", "update"]) + # Prepare Build Directory if not os.path.exists("/build"): os.makedirs("/build") @@ -95,6 +105,10 @@ def main(): os.chdir(build_pkg_path) + # Install build-time dependencies + tool_cmd = "apt-get -o Debug::pkgProblemResolver=yes --no-install-recommends --yes" + run_cmd(["mk-build-deps", "--install", f"--tool={tool_cmd}", "debian/control"]) + # Sparse checkout hint with open(".version", "w") as f: f.write(f"{deb_version}\n") @@ -129,20 +143,11 @@ def main(): deb_files = glob.glob("../*.deb") ddeb_files = glob.glob("../*.ddeb") - outdir = f"/packages/{package}/" - - os.makedirs(outdir, exist_ok=True) - for f in deb_files: shutil.copy(f, outdir) for f in ddeb_files: shutil.copy(f, outdir) - print(f"Installing built packages from {build_pkg_path}/..", file=sys.stderr) - pkgdir_debs = glob.glob(f"{build_pkg_path}/../*.deb") - if pkgdir_debs: - run_cmd(["apt", "install", "-y"] + pkgdir_debs) - if __name__ == "__main__": main()