From 9b7fb4c2bec40f0428f75a98f2dfb87cd0985da7 Mon Sep 17 00:00:00 2001 From: Michael Schroeder Date: Thu, 13 Feb 2025 10:33:38 +0100 Subject: [PATCH] Tell the build script to disable repos/containers handling for normal builds This disables following symlinks in the source copy. The options used are only supported in version 20250206 and above, so add a conflicts with older versions to the spec file as well. --- contrib/osc.spec | 2 ++ osc/build.py | 8 ++++++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/contrib/osc.spec b/contrib/osc.spec index 82c9c573..af53cc3c 100644 --- a/contrib/osc.spec +++ b/contrib/osc.spec @@ -104,6 +104,8 @@ Recommends: %{use_python_pkg}-keyring-keyutils Recommends: %{use_python_pkg}-zstandard Recommends: %{obs_build_pkg} +# need support for --repos-directory option +Conflicts: %{obs_build_pkg} < 20250206 Recommends: ca-certificates Recommends: diffstat Recommends: powerpc32 diff --git a/osc/build.py b/osc/build.py index 46c89209..794c350b 100644 --- a/osc/build.py +++ b/osc/build.py @@ -1273,9 +1273,9 @@ def main(apiurl, store, opts, argv): # Make packages from buildinfo available as repos for kiwi/docker/fissile if build_type in ('kiwi', 'docker', 'podman', 'fissile', 'productcompose'): - if os.path.exists('repos'): + if os.path.lexists('repos'): shutil.rmtree('repos') - if os.path.exists('containers'): + if os.path.lexists('containers'): shutil.rmtree('containers') os.mkdir('repos') for i in bi.deps: @@ -1349,6 +1349,10 @@ def main(apiurl, store, opts, argv): else: os.symlink(path, tffn) + else: + buildargs.append("--repos-directory=-") + buildargs.append("--containers-directory=-") + if build_type == 'kiwi': # Is a obsrepositories tag used? try: