[util-iso] set a flag for custom pacman.conf

This commit is contained in:
udeved 2015-05-10 20:22:46 +02:00 committed by Ramon Buldó
parent a8c0e2195e
commit 27e4752ea9

View file

@ -490,6 +490,16 @@ check_plymouth(){
done done
} }
check_custom_pacman_conf(){
if [[ -f pacman-${pacman_conf_arch}.conf ]]; then
pacman_conf="pacman-${pacman_conf_arch}.conf"
is_custom_pac_conf=true
else
pacman_conf="${PKGDATADIR}/pacman-${pacman_conf_arch}.conf"
is_custom_pac_conf=false
fi
}
# $1: profile # $1: profile
load_profile(){ load_profile(){
msg3 "Profile: [$1]" msg3 "Profile: [$1]"
@ -504,11 +514,9 @@ load_profile(){
custom=${packages_custom#*-} custom=${packages_custom#*-}
custom=${custom,,} custom=${custom,,}
iso_file="${iso_name}-${custom}-${dist_release}-${arch}.iso" iso_file="${iso_name}-${custom}-${dist_release}-${arch}.iso"
if [[ -f pacman-${pacman_conf_arch}.conf ]]; then
pacman_conf="pacman-${pacman_conf_arch}.conf" check_custom_pacman_conf
else
pacman_conf="${PKGDATADIR}/pacman-${pacman_conf_arch}.conf"
fi
create_args+=(-C ${pacman_conf}) create_args+=(-C ${pacman_conf})
work_dir=${chroots_iso}/$1/${arch} work_dir=${chroots_iso}/$1/${arch}
@ -592,7 +600,7 @@ build_images(){
fi fi
make_isolinux make_isolinux
make_isomounts make_isomounts
[[ -n ${keep_repos} ]] && clean_pacman_conf "${work_dir}/root-image" ${is_custom_pac_conf} && clean_pacman_conf "${work_dir}/root-image"
msg3 "Time ${FUNCNAME}: $(elapsed_time ${timer}) minutes" msg3 "Time ${FUNCNAME}: $(elapsed_time ${timer}) minutes"
} }