Gentoo Archives: gentoo-commits

From: "Ulrich Müller" <ulm@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] proj/eselect:master commit in: man/, doc/, /, bin/
Date: Mon, 27 Feb 2023 07:28:13
Message-Id: 1677455832.72ca0786ec4fe322088efb201d87308d9199ca6a.ulm@gentoo
1 commit: 72ca0786ec4fe322088efb201d87308d9199ca6a
2 Author: Ulrich Müller <ulm <AT> gentoo <DOT> org>
3 AuthorDate: Sun Feb 26 23:57:12 2023 +0000
4 Commit: Ulrich Müller <ulm <AT> gentoo <DOT> org>
5 CommitDate: Sun Feb 26 23:57:12 2023 +0000
6 URL: https://gitweb.gentoo.org/proj/eselect.git/commit/?id=72ca0786
7
8 New global option --eprefix
9
10 * bin/eselect.in: New global option --eprefix.
11 (es_do_help): Document it.
12 * doc/user-guide.txt:
13 * man/eselect.1: Document the --eprefix option.
14
15 Signed-off-by: Ulrich Müller <ulm <AT> gentoo.org>
16
17 ChangeLog | 7 +++++++
18 bin/eselect.in | 10 +++++++++-
19 doc/user-guide.txt | 9 +++++----
20 man/eselect.1 | 13 +++++++++++--
21 4 files changed, 32 insertions(+), 7 deletions(-)
22
23 diff --git a/ChangeLog b/ChangeLog
24 index 41d4bab..b442b8b 100644
25 --- a/ChangeLog
26 +++ b/ChangeLog
27 @@ -1,3 +1,10 @@
28 +2023-02-26 Ulrich Müller <ulm@g.o>
29 +
30 + * bin/eselect.in: New global option --eprefix.
31 + (es_do_help): Document it.
32 + * doc/user-guide.txt:
33 + * man/eselect.1: Document the --eprefix option.
34 +
35 2023-02-26 James Le Cuirot <chewi@g.o>
36
37 * bin/eselect.in: Allow EPREFIX to be overridden for manipulating
38
39 diff --git a/bin/eselect.in b/bin/eselect.in
40 index 6a0fdbc..8afbd7e 100755
41 --- a/bin/eselect.in
42 +++ b/bin/eselect.in
43 @@ -1,6 +1,6 @@
44 #!@BASH@
45 # -*-eselect-*- vim: ft=eselect
46 -# Copyright (c) 2005-2022 Gentoo Authors
47 +# Copyright (c) 2005-2023 Gentoo Authors
48 #
49 # This file is part of the 'eselect' tools framework.
50 #
51 @@ -91,6 +91,8 @@ es_do_help() {
52 write_kv_list_entry "--brief" "Make output shorter"
53 write_kv_list_entry "--colour=<yes|no|auto>" \
54 "Enable or disable colour output (default 'auto')"
55 + write_kv_list_entry "--eprefix=<path>" \
56 + "Override the EPREFIX variable for a cross-prefix build"
57 write_kv_list_entry "--root=<path>" \
58 "The target root path for eselect's operations"
59 echo
60 @@ -152,6 +154,12 @@ while [[ ${1##--} != "$1" ]]; do
61 [[ -z ${action} ]] || die -q "Too many parameters"
62 action=${1##--}
63 ;;
64 + eprefix=*|eprefix)
65 + [[ ${1#*=} == "$1" ]] && die -q "Option $1 requires an argument"
66 + # set EPREFIX and recalculate EROOT
67 + EPREFIX=${1#*=}
68 + EROOT="${ROOT%${EPREFIX:+/}}${EPREFIX}"
69 + ;;
70 root=*|root)
71 [[ ${1#*=} == "$1" ]] && die -q "Option $1 requires an argument"
72 # set ROOT and recalculate EROOT
73
74 diff --git a/doc/user-guide.txt b/doc/user-guide.txt
75 index 16c2629..2932b7f 100644
76 --- a/doc/user-guide.txt
77 +++ b/doc/user-guide.txt
78 @@ -91,11 +91,12 @@ eselect should be called as shown below: ::
79 eselect [<global-options>] <module> <action> <options>
80
81 eselect features consistently named actions among most of its modules.
82 -There are only three global options as of now; --brief, which makes
83 +There are only four global options as of now; --brief, which makes
84 eselect's output shorter (e.g., to use it as input for other programs);
85 ---colour, which controls coloured output; and --root, which specifies
86 -the path that eselect should use as the target root filesystem for its
87 -operations.
88 +--colour, which controls coloured output; --eprefix, which allows to
89 +override the EPREFIX variable for a cross-prefix build; and --root,
90 +which specifies the path that eselect should use as the target root
91 +filesystem for its operations.
92
93 The following are standard action names -- each module may provide a
94 subset of these actions:
95
96 diff --git a/man/eselect.1 b/man/eselect.1
97 index fad2aac..a331dee 100644
98 --- a/man/eselect.1
99 +++ b/man/eselect.1
100 @@ -1,8 +1,8 @@
101 .\" -*- coding: utf-8 -*-
102 -.\" Copyright 2005-2022 Gentoo Authors
103 +.\" Copyright 2005-2023 Gentoo Authors
104 .\" Distributed under the terms of the GNU GPL version 2 or later
105 .\"
106 -.TH ESELECT 1 "January 2022" "Gentoo Linux" eselect
107 +.TH ESELECT 1 "February 2023" "Gentoo Linux" eselect
108 .SH NAME
109 eselect \- Gentoo's multi\-purpose configuration and management tool
110 .SH SYNOPSIS
111 @@ -33,6 +33,15 @@ The default is
112 for which colour output is enabled only if standard output is
113 connected to a terminal.
114 .TP
115 +.BI \-\-eprefix= path
116 +The
117 +.I path
118 +that eselect should use as the offset-prefix path for its operations.
119 +Only relevant for a cross-prefix build. If neither this option nor the
120 +.I EPREFIX
121 +environment variable are specified, the hardcoded prefix of the build
122 +host is used as a default.
123 +.TP
124 .BI \-\-root= path
125 The
126 .I path