Skip to content

Commit 1ce6430

Browse files
committed
[update] : Add pacman.conf to preset
1 parent 33b8c41 commit 1ce6430

2 files changed

Lines changed: 31 additions & 0 deletions

File tree

build.sh

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,8 @@ source "${script_path}/lib/make_channel.sh"
2323
source "$script_path/lib/make_prepare_modules.sh"
2424
# shellcheck source=./lib/make_profiledef.sh
2525
source "${script_path}/lib/make_profiledef.sh"
26+
# shellcheck source=./lib/make_pacmanconf.sh
27+
source "${script_path}/lib/make_pacmanconf.sh"
2628
# shellcheck source=./lib/template_parser.sh
2729
source "${script_path}/lib/template_parser.sh"
2830
# shellcheck source=./lib/list_parser.sh
@@ -65,6 +67,7 @@ call_func make_prepare_modules
6567
call_func make_default
6668
call_func make_parsed_vars
6769
call_func make_profiledef
70+
call_func make_pacmanconf
6871
call_func make_packages
6972
call_func make_aur_packages
7073
call_func make_bootstrap_packages

lib/make_pacmanconf.sh

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
#!/usr/bin/env bash
2+
3+
make_pacmanconf(){
4+
# Pacman configuration file used only when building
5+
# If there is pacman.conf for each channel, use that for building
6+
local _use="" _pacman_conf=""
7+
local _pacman_conf_list=(
8+
"${script_path}/pacman-${arch}.conf"
9+
"${channel_dir}/pacman-${arch}.conf"
10+
"${script_path}/system/pacman-conf/pacman-${arch}.conf")
11+
for _pacman_conf in "${_pacman_conf_list[@]}"; do
12+
if [[ -f "${_pacman_conf}" ]]; then
13+
_use="${_pacman_conf}"
14+
break
15+
fi
16+
done
17+
18+
if [[ -z "${_use}" ]]; then
19+
msg_err "There is no pacman.conf"
20+
exit 1
21+
fi
22+
23+
msg_debug "Use $_use as pacman.conf"
24+
25+
# Todo: Change cache_dir
26+
27+
cp "$_use" "$work_dir/profile/pacman.conf"
28+
}

0 commit comments

Comments
 (0)