forked from mirrored-repos/manjaro-tools
[util-iso] use reset_pac_conf()
This commit is contained in:
parent
cd376c8b4f
commit
5ae0bd5f20
2 changed files with 32 additions and 21 deletions
|
@ -59,25 +59,6 @@ run_safe() {
|
|||
set +e
|
||||
}
|
||||
|
||||
# clean_pacman_conf(){
|
||||
# local repositories=$(get_repos "${pacman_conf}") uri='file://'
|
||||
# msg "Cleaning [%s/etc/pacman.conf] ..." "$1"
|
||||
# for repo in ${repositories[@]}; do
|
||||
# case ${repo} in
|
||||
# 'options'|'core'|'extra'|'community'|'multilib') continue ;;
|
||||
# *)
|
||||
# msg2 "parsing [%s] ..." "${repo}"
|
||||
# parse_section "${repo}" "${pacman_conf}"
|
||||
# if [[ ${pc_value} == $uri* ]]; then
|
||||
# msg2 "Removing local repo [%s] ..." "${repo}"
|
||||
# sed -i "/^\[${repo}/,/^Server/d" $1/etc/pacman.conf
|
||||
# fi
|
||||
# ;;
|
||||
# esac
|
||||
# done
|
||||
# msg "Done cleaning [%s/etc/pacman.conf]" "$1"
|
||||
# }
|
||||
|
||||
# $1: image path
|
||||
make_sqfs() {
|
||||
if [[ ! -d "$1" ]]; then
|
||||
|
@ -217,6 +198,9 @@ make_image_root() {
|
|||
copy_overlay "${profile_dir}/root-overlay" "${path}"
|
||||
configure_root_image "${path}"
|
||||
# ${is_custom_pac_conf} && clean_pacman_conf "${path}"
|
||||
|
||||
reset_pac_conf "${path}"
|
||||
|
||||
clean_up_image "${path}"
|
||||
: > ${work_dir}/build.${FUNCNAME}
|
||||
msg "Done [Base installation] (root-image)"
|
||||
|
@ -239,6 +223,8 @@ make_image_custom() {
|
|||
configure_custom_image "${path}"
|
||||
# ${is_custom_pac_conf} && clean_pacman_conf "${path}"
|
||||
|
||||
reset_pac_conf "${path}"
|
||||
|
||||
umount_image
|
||||
clean_up_image "${path}"
|
||||
: > ${work_dir}/build.${FUNCNAME}
|
||||
|
@ -269,6 +255,8 @@ make_image_live() {
|
|||
configure_live_image "${path}"
|
||||
# ${is_custom_pac_conf} && clean_pacman_conf "${path}"
|
||||
|
||||
reset_pac_conf "${path}"
|
||||
|
||||
umount_image
|
||||
|
||||
# Clean up GnuPG keys
|
||||
|
@ -289,6 +277,8 @@ make_image_mhwd() {
|
|||
|
||||
# ${is_custom_pac_conf} && clean_pacman_conf "${path}"
|
||||
|
||||
reset_pac_conf "${path}"
|
||||
|
||||
download_to_cache "${path}" "${packages}"
|
||||
|
||||
copy_cache_mhwd "${work_dir}/mhwd-image"
|
||||
|
|
25
lib/util.sh
25
lib/util.sh
|
@ -53,10 +53,31 @@
|
|||
# echo ${repos[@]}
|
||||
# }
|
||||
|
||||
# clean_pacman_conf(){
|
||||
# local repositories=$(get_repos "${pacman_conf}") uri='file://'
|
||||
# msg "Cleaning [%s/etc/pacman.conf] ..." "$1"
|
||||
# for repo in ${repositories[@]}; do
|
||||
# case ${repo} in
|
||||
# 'options'|'core'|'extra'|'community'|'multilib') continue ;;
|
||||
# *)
|
||||
# msg2 "parsing [%s] ..." "${repo}"
|
||||
# parse_section "${repo}" "${pacman_conf}"
|
||||
# if [[ ${pc_value} == $uri* ]]; then
|
||||
# msg2 "Removing local repo [%s] ..." "${repo}"
|
||||
# sed -i "/^\[${repo}/,/^Server/d" $1/etc/pacman.conf
|
||||
# fi
|
||||
# ;;
|
||||
# esac
|
||||
# done
|
||||
# msg "Done cleaning [%s/etc/pacman.conf]" "$1"
|
||||
# }
|
||||
|
||||
reset_pac_conf(){
|
||||
local conf=$1
|
||||
msg "Restoring [%s/etc/pacman.conf] ..." "$1"
|
||||
sed -e "s|^.*HoldPkg = pacman glibc|HoldPkg = pacman glibc manjaro-system|" \
|
||||
-e "s|^.*#CheckSpace|CheckSpace|" -i "$1"
|
||||
-e "s|^.*#CheckSpace|CheckSpace|" \
|
||||
-i "$1/etc/pacman.conf"
|
||||
msg "Done restoring [%s/etc/pacman.conf]" "$1"
|
||||
}
|
||||
|
||||
read_set(){
|
||||
|
|
Loading…
Reference in a new issue