From fae33a1faf3f94ea46049664ef483b2a3e0d3f01 Mon Sep 17 00:00:00 2001 From: Andrew Gregory Date: Sun, 16 Apr 2017 00:31:57 -0400 Subject: add --sysroot option --root is not sufficient to properly operate on a mounted guest system. Using --root still uses the host system's configuration and there is no way to correctly use the guest configuration without manually modifying any Include directives. --sysroot provides an easier way to operate on a guest system by chrooting immediately after option parsing before configuration parsing or performing any operations. It is currently limited to the root user, but that's enough for restoring a guest system to a working state, which is the primary intended use case. Signed-off-by: Andrew Gregory --- src/pacman/util.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src/pacman/util.c') diff --git a/src/pacman/util.c b/src/pacman/util.c index 64ea8c57..ae8a74d3 100644 --- a/src/pacman/util.c +++ b/src/pacman/util.c @@ -103,6 +103,9 @@ int trans_release(void) int needs_root(void) { + if(config->sysroot) { + return 1; + } switch(config->op) { case PM_OP_DATABASE: return !config->op_q_check; -- cgit v1.2.3-24-g4f1b