From e8aaa29d9a00c178f8b6e07698a9f0382753ec93 Mon Sep 17 00:00:00 2001 From: Brijesh Krishna <63464137+Brijeshkrishna@users.noreply.github.com> Date: Fri, 16 Jun 2023 19:39:39 +0530 Subject: [PATCH] Update pacstrap.in Bypass file conflict checks and overwrite conflicting files. If the package that is about to be installed contains files that are already installed this option will cause all those files to be overwritten. --- pacstrap.in | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/pacstrap.in b/pacstrap.in index 9466aa8..cbd43cc 100644 --- a/pacstrap.in +++ b/pacstrap.in @@ -18,6 +18,7 @@ pacman_args=() pacmode=-Sy unshare=0 copyconf=0 +overwrite=0 pacman_config=/etc/pacman.conf m4_include(common) @@ -37,7 +38,7 @@ usage: ${0##*/} [options] root [packages...] -N Run in unshare mode as a regular user -P Copy the host's pacman config to the target -U Use pacman -U to install packages - + -O Bypass file conflict checks and overwrite conflicting files -h Print this help message pacstrap installs packages to the specified new root directory. If no packages @@ -122,6 +123,9 @@ while getopts ':C:cDGiKMNPU' flag; do U) pacmode=-U ;; + O) + overwrite=1 + ;; :) die '%s: option requires an argument -- '\''%s'\' "${0##*/}" "$OPTARG" ;; @@ -148,6 +152,10 @@ if (( ! interactive )); then pacman_args+=(--noconfirm) fi +if (( overwite )); then + pacman_args+=(--overwrite='!*') +fi + if (( unshare )); then setup=unshare_setup $mount_unshare bash -c "$(declare_all); pacstrap"