diff options
author | Ulrich Müller <ulm@gentoo.org> | 2023-02-27 00:57:12 +0100 |
---|---|---|
committer | Ulrich Müller <ulm@gentoo.org> | 2023-02-27 00:57:12 +0100 |
commit | 72ca0786ec4fe322088efb201d87308d9199ca6a (patch) | |
tree | b3898cb74780a8c4e182f689ae762e819e54c4ca /bin | |
parent | Allow EPREFIX to be overridden for manipulating prefixed ROOT (diff) | |
download | eselect-72ca0786ec4fe322088efb201d87308d9199ca6a.tar.gz eselect-72ca0786ec4fe322088efb201d87308d9199ca6a.tar.bz2 eselect-72ca0786ec4fe322088efb201d87308d9199ca6a.zip |
New global option --eprefix
* bin/eselect.in: New global option --eprefix.
(es_do_help): Document it.
* doc/user-guide.txt:
* man/eselect.1: Document the --eprefix option.
Signed-off-by: Ulrich Müller <ulm@gentoo.org>
Diffstat (limited to 'bin')
-rwxr-xr-x | bin/eselect.in | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/bin/eselect.in b/bin/eselect.in index 6a0fdbc..8afbd7e 100755 --- a/bin/eselect.in +++ b/bin/eselect.in @@ -1,6 +1,6 @@ #!@BASH@ # -*-eselect-*- vim: ft=eselect -# Copyright (c) 2005-2022 Gentoo Authors +# Copyright (c) 2005-2023 Gentoo Authors # # This file is part of the 'eselect' tools framework. # @@ -91,6 +91,8 @@ es_do_help() { write_kv_list_entry "--brief" "Make output shorter" write_kv_list_entry "--colour=<yes|no|auto>" \ "Enable or disable colour output (default 'auto')" + write_kv_list_entry "--eprefix=<path>" \ + "Override the EPREFIX variable for a cross-prefix build" write_kv_list_entry "--root=<path>" \ "The target root path for eselect's operations" echo @@ -152,6 +154,12 @@ while [[ ${1##--} != "$1" ]]; do [[ -z ${action} ]] || die -q "Too many parameters" action=${1##--} ;; + eprefix=*|eprefix) + [[ ${1#*=} == "$1" ]] && die -q "Option $1 requires an argument" + # set EPREFIX and recalculate EROOT + EPREFIX=${1#*=} + EROOT="${ROOT%${EPREFIX:+/}}${EPREFIX}" + ;; root=*|root) [[ ${1#*=} == "$1" ]] && die -q "Option $1 requires an argument" # set ROOT and recalculate EROOT |