From 7d8ef4c74718b3527cb4d97f1ad0acf2f28c5d3e Mon Sep 17 00:00:00 2001 From: Tom Gundersen Date: Fri, 22 Jun 2012 19:14:09 +0200 Subject: [PATCH] pacstrap: store cache on target system by default However, add a '-c' switch to use the host cache instead. The default is useful for when installing a system from an install media (which has possibly constrained storage), but the '-c' switch is useful when e.g. creating build-chroots. I considered doing this the other way around ('-c' being the default). However, I think it makes sense to default to the expected behavior for install both because a new user is less likely to know that they need to add a switch, and because the errormessage they'd get when they run out of space/memory is nonsensical and would cause lots of annoying questions. [dave: use proper array addition, nuke readlink, use arithmetic flag] Signed-off-by: Tom Gundersen --- pacstrap.in | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/pacstrap.in b/pacstrap.in index 397655e..8d1816f 100644 --- a/pacstrap.in +++ b/pacstrap.in @@ -12,7 +12,8 @@ shopt -s extglob m4_include(common) -declare newroot=/mnt +newroot=/mnt +hostcache=1 usage() { cat </dev/null' EXIT api_fs_mount "$newroot" || die "failed to setup API filesystems in new root" msg 'Installing packages to %s' "$newroot" -if ! pacman -r "$newroot" -Sy --noconfirm "${packages[@]}"; then +if ! pacman -r "$newroot" -Sy --noconfirm "${pacman_args[@]}"; then die 'Failed to install packages to new root' fi