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 | |
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>
-rw-r--r-- | ChangeLog | 7 | ||||
-rwxr-xr-x | bin/eselect.in | 10 | ||||
-rw-r--r-- | doc/user-guide.txt | 9 | ||||
-rw-r--r-- | man/eselect.1 | 13 |
4 files changed, 32 insertions, 7 deletions
@@ -1,3 +1,10 @@ +2023-02-26 Ulrich Müller <ulm@gentoo.org> + + * bin/eselect.in: New global option --eprefix. + (es_do_help): Document it. + * doc/user-guide.txt: + * man/eselect.1: Document the --eprefix option. + 2023-02-26 James Le Cuirot <chewi@gentoo.org> * bin/eselect.in: Allow EPREFIX to be overridden for manipulating 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 diff --git a/doc/user-guide.txt b/doc/user-guide.txt index 16c2629..2932b7f 100644 --- a/doc/user-guide.txt +++ b/doc/user-guide.txt @@ -91,11 +91,12 @@ eselect should be called as shown below: :: eselect [<global-options>] <module> <action> <options> eselect features consistently named actions among most of its modules. -There are only three global options as of now; --brief, which makes +There are only four global options as of now; --brief, which makes eselect's output shorter (e.g., to use it as input for other programs); ---colour, which controls coloured output; and --root, which specifies -the path that eselect should use as the target root filesystem for its -operations. +--colour, which controls coloured output; --eprefix, which allows to +override the EPREFIX variable for a cross-prefix build; and --root, +which specifies the path that eselect should use as the target root +filesystem for its operations. The following are standard action names -- each module may provide a subset of these actions: diff --git a/man/eselect.1 b/man/eselect.1 index fad2aac..a331dee 100644 --- a/man/eselect.1 +++ b/man/eselect.1 @@ -1,8 +1,8 @@ .\" -*- coding: utf-8 -*- -.\" Copyright 2005-2022 Gentoo Authors +.\" Copyright 2005-2023 Gentoo Authors .\" Distributed under the terms of the GNU GPL version 2 or later .\" -.TH ESELECT 1 "January 2022" "Gentoo Linux" eselect +.TH ESELECT 1 "February 2023" "Gentoo Linux" eselect .SH NAME eselect \- Gentoo's multi\-purpose configuration and management tool .SH SYNOPSIS @@ -33,6 +33,15 @@ The default is for which colour output is enabled only if standard output is connected to a terminal. .TP +.BI \-\-eprefix= path +The +.I path +that eselect should use as the offset-prefix path for its operations. +Only relevant for a cross-prefix build. If neither this option nor the +.I EPREFIX +environment variable are specified, the hardcoded prefix of the build +host is used as a default. +.TP .BI \-\-root= path The .I path |