aboutsummaryrefslogtreecommitdiffstats
path: root/pacstrap.in
diff options
context:
space:
mode:
authorLibravatarUnit 193 <unit193@ubuntu.com>2019-11-15 19:29:18 -0500
committerLibravatarUnit 193 <unit193@ubuntu.com>2019-11-15 19:29:18 -0500
commite1f5028f2c3adc68d125ddcdb290a34b03bc6809 (patch)
tree86e0bb8ced92854127331c2128a5707fd3d029ec /pacstrap.in
parent0d2edecb2be14c0ed92a33c7508358d648cd3d2f (diff)
New upstream version 23upstream/23
Diffstat (limited to 'pacstrap.in')
-rw-r--r--pacstrap.in9
1 files changed, 7 insertions, 2 deletions
diff --git a/pacstrap.in b/pacstrap.in
index 231a154..703df11 100644
--- a/pacstrap.in
+++ b/pacstrap.in
@@ -15,6 +15,7 @@ m4_include(common)
hostcache=0
copykeyring=1
copymirrorlist=1
+pacmode=-Sy
usage() {
cat <<EOF
@@ -26,6 +27,7 @@ usage: ${0##*/} [options] root [packages...]
-G Avoid copying the host's pacman keyring to the target
-i Prompt for package confirmation when needed (run interactively)
-M Avoid copying the host's mirrorlist to the target
+ -U Use pacman -U to install packages
-h Print this help message
@@ -42,7 +44,7 @@ fi
(( EUID == 0 )) || die 'This script must be run with root privileges'
-while getopts ':C:cdGiM' flag; do
+while getopts ':C:cdGiMU' flag; do
case $flag in
C)
pacman_config=$OPTARG
@@ -62,6 +64,9 @@ while getopts ':C:cdGiM' flag; do
M)
copymirrorlist=0
;;
+ U)
+ pacmode=-U
+ ;;
:)
die '%s: option requires an argument -- '\''%s'\' "${0##*/}" "$OPTARG"
;;
@@ -107,7 +112,7 @@ if (( copykeyring )); then
fi
msg 'Installing packages to %s' "$newroot"
-if ! pacman -r "$newroot" -Sy "${pacman_args[@]}"; then
+if ! unshare --fork --pid pacman -r "$newroot" $pacmode "${pacman_args[@]}"; then
die 'Failed to install packages to new root'
fi