obs: srcpkg.py: Run generate_build_dep.sh for all projects

Adjust srcpkg.py to run a generate_build_dep.sh not only for
osmo_dia2gsup, but for any Osmocom project that has such a script. This
is in preparation for osmo-epdg, which will also have one.

Change-Id: Icd9dc734ec938398668640f77ec83aae4a1ee0f4
This commit is contained in:
Oliver Smith 2023-10-05 17:35:02 +02:00
parent 9b9b2a2780
commit 3f037f4a73
1 changed files with 14 additions and 7 deletions

View File

@ -103,13 +103,6 @@ def get_epoch(project):
return "" return ""
def prepare_project_osmo_dia2gsup():
""" Run erlang/osmo_dia2gsup's generate_build_dep.sh script to download
sources for dependencies. """
lib.run_cmd("contrib/generate_build_dep.sh",
cwd=lib.git.get_repo_path("erlang/osmo_dia2gsup"))
def prepare_project_open5gs(): def prepare_project_open5gs():
""" Download the subproject sources here, so the package can be built in """ Download the subproject sources here, so the package can be built in
OBS without Internet access. """ OBS without Internet access. """
@ -124,6 +117,17 @@ def prepare_project_limesuite():
"-i", "debian/control"], cwd=lib.git.get_repo_path("limesuite")) "-i", "debian/control"], cwd=lib.git.get_repo_path("limesuite"))
def run_generate_build_dep(project):
""" Run contrib/generate_build_dep.sh if it exists in the given project, to
to download sources for dependencies (see e.g. osmo_dia2gsup.git). """
repo_path = lib.git.get_repo_path(project)
script_path = "contrib/generate_build_dep.sh"
if os.path.exists(f"{repo_path}/{script_path}"):
print(f"{project}: running {script_path}")
lib.run_cmd(script_path, cwd=repo_path)
def write_tarball_version(project, version): def write_tarball_version(project, version):
repo_path = lib.git.get_repo_path(project) repo_path = lib.git.get_repo_path(project)
@ -182,6 +186,9 @@ def build(project, gerrit_id=0):
print(f"{project}: running {project_specific_func}") print(f"{project}: running {project_specific_func}")
globals()[project_specific_func]() globals()[project_specific_func]()
if project in lib.config.projects_osmocom:
run_generate_build_dep(project)
lib.debian.build_source_package(project) lib.debian.build_source_package(project)
lib.debian.move_files_to_output(project) lib.debian.move_files_to_output(project)