Make build helper play nicer with binary package build
authorJakob Cornell <jakob+gpg@jcornell.net>
Mon, 26 Sep 2022 04:34:55 +0000 (23:34 -0500)
committerJakob Cornell <jakob+gpg@jcornell.net>
Mon, 26 Sep 2022 04:34:55 +0000 (23:34 -0500)
build_helper.py

index c6c6ec95c15798b19725419c3430a1a7dd399d45..33d234957c7a26645f00c1f3bd7dc717e10f7406 100644 (file)
@@ -5,6 +5,7 @@ A few tools to help keep Debian packages and artifacts well organized.
 from argparse import ArgumentParser
 from pathlib import Path
 from subprocess import run
+import os
 import re
 
 
@@ -51,10 +52,16 @@ if args.cmd == "build":
        # build the source package
        run(["debuild", "-i", "-us", "-uc", "-S"], cwd = upstream_root, check = True)
 
+       [orig_path] = project_root.glob("strikebot_*.orig.tar.xz")
+       orig_name = orig_path.name
+
        # move outputs to build directory
        for p in project_root.iterdir():
                if _is_output(p):
                        p.rename(build_dir.joinpath(p.relative_to(project_root)))
+
+       # create temporary link for orig tarball to satisfy binary package build
+       orig_path.symlink_to(build_dir.joinpath(orig_name).relative_to(project_root))
 elif args.cmd == "clean":
        for p in build_dir.iterdir():
                if _is_output(p):