mkarchroot: Respect makepkg.conf and pacman.conf when running a command

This commit is contained in:
Pierre Schmitz 2011-11-06 10:27:55 +01:00
parent b7a3c74c50
commit a030cdc532
1 changed files with 10 additions and 8 deletions

View File

@ -129,6 +129,14 @@ copy_hostconf () {
chroot "${working_dir}" /bin/findmnt -rnu -o SOURCE,TARGET,FSTYPE,OPTIONS > "${working_dir}/etc/mtab"
cp /etc/resolv.conf "${working_dir}/etc/resolv.conf"
echo "Server = ${host_mirror}" > ${working_dir}/etc/pacman.d/mirrorlist
if [ "$pac_conf" != "" -a "$NOCOPY" = "n" ]; then
cp ${pac_conf} ${working_dir}/etc/pacman.conf
fi
if [ "$makepkg_conf" != "" -a "$NOCOPY" = "n" ]; then
cp ${makepkg_conf} ${working_dir}/etc/makepkg.conf
fi
}
chroot_umount () {
@ -206,19 +214,13 @@ else
ldconfig -r "${working_dir}"
fi
if [ "$pac_conf" != "" -a "$NOCOPY" = "n" ]; then
cp ${pac_conf} ${working_dir}/etc/pacman.conf
fi
if [ "$makepkg_conf" != "" -a "$NOCOPY" = "n" ]; then
cp ${makepkg_conf} ${working_dir}/etc/makepkg.conf
fi
if [ -e "${working_dir}/etc/locale.gen" ]; then
sed -i 's@^#\(en_US\|de_DE\)\(\.UTF-8\)@\1\2@' "${working_dir}/etc/locale.gen"
chroot "${working_dir}" /usr/sbin/locale-gen
fi
copy_hostconf
if [ ! -e "${working_dir}/.arch-chroot" ]; then
date +%s > "${working_dir}/.arch-chroot"
fi