Skip to content

Commit 22ff86b

Browse files
committed
Final solution
Signed-off-by: Tomasz Gromadzki <tomasz.gromadzki@hpe.com> Priority: 2 Skip-unit-tests:true Skip-unit-test: true Skip-NLT: true Skip-unit-test-memcheck: true Skip-func-test-el8: true Skip-func-test-el9: true Skip-func-test-leap15: false Skip-fault-injection-test: true Skip-test-el-9.6-rpms: true Skip-test-leap-15-rpms: false Skip-func-hw-test: true
1 parent 2096fee commit 22ff86b

1 file changed

Lines changed: 16 additions & 13 deletions

File tree

utils/rpms/packaging/rpm_chrootbuild

Lines changed: 16 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -54,10 +54,11 @@ repo_adds=()
5454
repo_dels=()
5555

5656
# Only for Leap 15.6 chroot
57+
# see ../../docker/Dockerfile.leap.15 for more details
5758
if [[ "${CHROOT_NAME}" == *opensuse-leap-15.6* ]]; then
58-
repo_adds+=("--enablerepo=*-lua-*")
59-
repo_adds+=("--enablerepo=opensuse-network-cluster-proxy-artifactory")
60-
repo_adds+=("--enablerepo=opensuse-oss-proxy-artifactory")
59+
repo_adds+=("--enablerepo=*opensuse-devel-languages-lua-*")
60+
repo_adds+=("--enablerepo=*opensuse-network-cluster-*")
61+
repo_adds+=("--enablerepo=*opensuse-oss-*")
6162
fi
6263

6364
echo -e "config_opts['yum.conf'] += \"\"\"\n" >> mock.cfg
@@ -129,18 +130,20 @@ done
129130
echo "\"\"\"" >> mock.cfg
130131

131132
# Only for Leap 15.6 chroot
133+
# see ../../docker/Dockerfile.leap.15 for more details
132134
if [[ "${CHROOT_NAME}" == *opensuse-leap-15.6* ]]; then
133135
# Ensure lua-lmod is installed in the chroot
134-
echo "" >> mock.cfg
135-
echo "_pkgs = config_opts.get('chroot_additional_packages')" >> mock.cfg
136-
echo "if _pkgs is None:" >> mock.cfg
137-
echo " config_opts['chroot_additional_packages'] = ['lua-lmod']" >> mock.cfg
138-
echo "elif isinstance(_pkgs, str):" >> mock.cfg
139-
echo " config_opts['chroot_additional_packages'] = (_pkgs + ' lua-lmod').strip()" >> mock.cfg
140-
echo "elif isinstance(_pkgs, (list, tuple)):" >> mock.cfg
141-
echo " config_opts['chroot_additional_packages'] = list(_pkgs) + ['lua-lmod']" >> mock.cfg
142-
echo "else:" >> mock.cfg
143-
echo " raise TypeError(f\"Unexpected type for chroot_additional_packages: {type(_pkgs)}\")" >> mock.cfg
136+
cat >> mock.cfg <<'EOF'
137+
138+
_pkgs = config_opts.get('chroot_additional_packages')
139+
if _pkgs is None:
140+
config_opts['chroot_additional_packages'] = ['lua-lmod']
141+
elif isinstance(_pkgs, str):
142+
config_opts['chroot_additional_packages'] = f"{_pkgs} lua-lmod".strip()
143+
else:
144+
config_opts['chroot_additional_packages'] = list(_pkgs) + ['lua-lmod']
145+
EOF
146+
144147
fi
145148

146149
if [ -n "$DISTRO_VERSION" ]; then

0 commit comments

Comments
 (0)