pacstrap: add -C option for using an alternate config

I grappled with the inability of pacstrap to do this while trying to
setup an i686 chroot for myself based on a pacman config from devtools,
rather than my own config which bombs on a "missing" multilib repo.
This commit is contained in:
Dave Reisner 2012-10-03 22:55:49 -04:00
parent 4f3ef5bfa7
commit ea41f437d2

View File

@ -22,6 +22,7 @@ usage() {
usage: ${0##*/} [options] root [packages...]
Options:
-C config Use an alternate config file for pacman
-c Use the package cache on the host, rather than the target
-d Allow installation to a non-mountpoint directory
-G Avoid copying the host's pacman keyring to the target
@ -41,8 +42,11 @@ fi
(( EUID == 0 )) || die 'This script must be run with root privileges'
while getopts ':cdGiM' flag; do
while getopts ':C:cdGiM' flag; do
case $flag in
C)
pacman_config=$OPTARG
;;
d)
directory=1
;;
@ -80,6 +84,10 @@ if (( ! interactive )); then
pacman_args+=(--noconfirm)
fi
if [[ $pacman_config ]]; then
pacman_args+=(--config="$pacman_config")
fi
[[ -d $newroot ]] || die "%s is not a directory" "$newroot"
if ! mountpoint -q "$newroot" && (( ! directory )); then
die '%s is not a mountpoint!' "$newroot"