Skip to content

Commit 62d908f

Browse files
committed
[update] : use for to set pacman.conf
1 parent 3a2720c commit 62d908f

File tree

1 file changed

+7
-9
lines changed

1 file changed

+7
-9
lines changed

build.sh

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -546,15 +546,13 @@ prepare_build() {
546546
make_pacman_conf() {
547547
# Pacman configuration file used only when building
548548
# If there is pacman.conf for each channel, use that for building
549-
if [[ -f "${channel_dir}/pacman-${arch}.conf" ]]; then
550-
build_pacman_conf="${channel_dir}/pacman-${arch}.conf"
551-
else
552-
build_pacman_conf="${script_path}/system/pacman-${arch}.conf"
553-
fi
554-
555-
if [[ -f "${script_path}/pacman-${arch}.conf" ]]; then
556-
build_pacman_conf="${script_path}/pacman-${arch}.conf"
557-
fi
549+
local _pacman_conf _pacman_conf_list=("${script_path}/pacman-${arch}.conf" "${channel_dir}/pacman-${arch}.conf" "${script_path}/system/pacman-${arch}.conf")
550+
for _pacman_conf in "${_pacman_conf_list[@]}"; do
551+
if [[ -f "${_pacman_conf}" ]]; then
552+
build_pacman_conf="${_pacman_conf}"
553+
break
554+
fi
555+
done
558556

559557
msg_debug "Use ${build_pacman_conf}"
560558
sed -r "s|^#?\\s*CacheDir.+|CacheDir = ${cache_dir}|g" "${build_pacman_conf}" > "${build_dir}/pacman-${arch}.conf"

0 commit comments

Comments
 (0)