Gentoo Archives: gentoo-commits

From: "Michał Górny" <mgorny@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: app-alternatives/sh/, profiles/arch/s390/
Date: Mon, 28 Nov 2022 14:31:44
Message-Id: 1669645897.57378b29433826126d1cd5daa0b35c5055b4492f.mgorny@gentoo
1 commit: 57378b29433826126d1cd5daa0b35c5055b4492f
2 Author: Michał Górny <mgorny <AT> gentoo <DOT> org>
3 AuthorDate: Tue Nov 22 21:23:40 2022 +0000
4 Commit: Michał Górny <mgorny <AT> gentoo <DOT> org>
5 CommitDate: Mon Nov 28 14:31:37 2022 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=57378b29
7
8 app-alternatives/sh: Add an ebuild for /bin/sh symlink
9
10 Closes: https://github.com/gentoo/gentoo/pull/28390
11 Signed-off-by: Michał Górny <mgorny <AT> gentoo.org>
12
13 app-alternatives/sh/metadata.xml | 29 ++++++++++++++++++++++
14 app-alternatives/sh/sh-0.ebuild | 48 +++++++++++++++++++++++++++++++++++++
15 profiles/arch/s390/package.use.mask | 4 ++++
16 3 files changed, 81 insertions(+)
17
18 diff --git a/app-alternatives/sh/metadata.xml b/app-alternatives/sh/metadata.xml
19 new file mode 100644
20 index 000000000000..b91b8f41c94c
21 --- /dev/null
22 +++ b/app-alternatives/sh/metadata.xml
23 @@ -0,0 +1,29 @@
24 +<?xml version="1.0" encoding="UTF-8"?>
25 +<!DOCTYPE pkgmetadata SYSTEM "https://www.gentoo.org/dtd/metadata.dtd">
26 +<pkgmetadata>
27 + <maintainer type="project">
28 + <email>base-system@g.o</email>
29 + <name>Gentoo Base System</name>
30 + </maintainer>
31 + <maintainer type="person">
32 + <email>mgorny@g.o</email>
33 + <name>Michał Górny</name>
34 + </maintainer>
35 + <use>
36 + <flag name="bash">
37 + Symlink to <pkg>app-shells/bash</pkg>
38 + </flag>
39 + <flag name="dash">
40 + Symlink to <pkg>app-shells/dash</pkg>
41 + </flag>
42 + <flag name="ksh">
43 + Symlink to <pkg>app-shells/ksh</pkg>
44 + </flag>
45 + <flag name="lksh">
46 + Symlink to lksh from <pkg>app-shells/mksh</pkg>
47 + </flag>
48 + <flag name="mksh">
49 + Symlink to mksh from <pkg>app-shells/mksh</pkg>
50 + </flag>
51 + </use>
52 +</pkgmetadata>
53
54 diff --git a/app-alternatives/sh/sh-0.ebuild b/app-alternatives/sh/sh-0.ebuild
55 new file mode 100644
56 index 000000000000..5da158c80cab
57 --- /dev/null
58 +++ b/app-alternatives/sh/sh-0.ebuild
59 @@ -0,0 +1,48 @@
60 +# Copyright 2022 Gentoo Authors
61 +# Distributed under the terms of the GNU General Public License v2
62 +
63 +EAPI=8
64 +
65 +DESCRIPTION="/bin/sh (POSIX shell) symlink"
66 +HOMEPAGE="https://wiki.gentoo.org/wiki/Project:Base/Alternatives"
67 +SRC_URI=""
68 +S=${WORKDIR}
69 +
70 +LICENSE="CC0-1.0"
71 +SLOT="0"
72 +KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~loong ~m68k ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86 ~x64-cygwin ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris"
73 +IUSE="+bash dash ksh lksh mksh"
74 +REQUIRED_USE="^^ ( bash dash ksh lksh mksh )"
75 +
76 +RDEPEND="
77 + bash? ( app-shells/bash )
78 + dash? ( app-shells/dash )
79 + ksh? ( app-shells/ksh )
80 + lksh? ( app-shells/mksh[lksh] )
81 + mksh? ( app-shells/mksh )
82 + !!app-eselect/eselect-sh
83 +"
84 +
85 +src_install() {
86 + if use bash; then
87 + dosym bash /bin/sh
88 + elif use dash; then
89 + dosym dash /bin/sh
90 + elif use ksh; then
91 + dosym ksh /bin/sh
92 + elif use lksh; then
93 + dosym lksh /bin/sh
94 + elif use mksh; then
95 + dosym mksh /bin/sh
96 + else
97 + die "Invalid USE flag combination (broken REQUIRED_USE?)"
98 + fi
99 +}
100 +
101 +pkg_postrm() {
102 + # make sure we don't leave the user without /bin/sh, since it's not
103 + # been owned by any other package
104 + if [[ ! -h ${EROOT}/bin/sh ]]; then
105 + ln -s bash "${EROOT}/bin/sh" || die
106 + fi
107 +}
108
109 diff --git a/profiles/arch/s390/package.use.mask b/profiles/arch/s390/package.use.mask
110 index 1f332436d88b..32b5b218cfa8 100644
111 --- a/profiles/arch/s390/package.use.mask
112 +++ b/profiles/arch/s390/package.use.mask
113 @@ -1,6 +1,10 @@
114 # Copyright 1999-2022 Gentoo Authors
115 # Distributed under the terms of the GNU General Public License v2
116
117 +# Michał Górny <mgorny@g.o> (2022-11-25)
118 +# Unkeyworded shells.
119 +app-alternatives/sh lksh mksh
120 +
121 # Florian Schmaus <flow@g.o> (2022-11-23)
122 # avoid larger deptree, bug #882593
123 dev-python/bracex doc