From ea392f1b6955e0b90cfe3e85f7b9743468b719fc Mon Sep 17 00:00:00 2001 From: Ludwig Nussel Date: Thu, 20 Jan 2022 11:19:49 +0100 Subject: [PATCH] Prefer distro config repo if none specified --- build | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/build b/build index 1e4ee458e..1bae97594 100755 --- a/build +++ b/build @@ -1406,16 +1406,21 @@ if test -n "$CCACHE" ; then fi fi +set_build_arch + if test -z "$RPMLIST" -a -z "$RUNNING_IN_VM" ; then if test -z "$repos" -a -z "$BUILD_RPMS" -a "$BUILD_DIST" = "${BUILD_DIST#obs:/}"; then - repos=(--repository 'zypp://') + repos=(--repository) + repos+=(`"$BUILD_DIR/queryconfig" repourl --dist "$BUILD_DIST" --configdir "$CONFIG_DIR" --archpath "$BUILD_ARCH"`) + if test "${#repos[@]}" = 1; then + echo "Distribution config provides no default repo, using system repos" + repos+=('zypp://') + fi fi else repos=() fi -set_build_arch - if test "$DO_INIT" = false -a -n "$RUN_SHELL"; then mount_stuff BUILD_USER=root