* [gentoo-dev] [PATCH 1/4] cvs.eclass: Add local declarations and die statements throughout
@ 2024-10-17 5:58 Ulrich Müller
2024-10-17 5:58 ` [gentoo-dev] [PATCH 2/4] cvs.eclass: Rewrite the ssh wrapper script in bash Ulrich Müller
` (2 more replies)
0 siblings, 3 replies; 6+ messages in thread
From: Ulrich Müller @ 2024-10-17 5:58 UTC (permalink / raw
To: gentoo-dev; +Cc: Ulrich Müller
Signed-off-by: Ulrich Müller <ulm@gentoo.org>
---
eclass/cvs.eclass | 120 ++++++++++++++++++++--------------------------
1 file changed, 52 insertions(+), 68 deletions(-)
diff --git a/eclass/cvs.eclass b/eclass/cvs.eclass
index dbacc2c09cfe..ec0ad2ec8f71 100644
--- a/eclass/cvs.eclass
+++ b/eclass/cvs.eclass
@@ -1,4 +1,4 @@
-# Copyright 1999-2023 Gentoo Authors
+# Copyright 1999-2024 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
# @ECLASS: cvs.eclass
@@ -268,13 +268,14 @@ cvs_fetch() {
# In case ECVS_TOP_DIR is a symlink to a dir, get the real path,
# otherwise addwrite() doesn't work.
- cd -P "${ECVS_TOP_DIR}" >/dev/null
+ cd -P "${ECVS_TOP_DIR}" >/dev/null || die
ECVS_TOP_DIR=$(pwd)
# Disable the sandbox for this dir
addwrite "${ECVS_TOP_DIR}"
# Determine the CVS command mode (checkout or update)
+ local mode
if [[ ! -d ${ECVS_TOP_DIR}/${ECVS_LOCALNAME}/CVS ]] ; then
mode=checkout
else
@@ -294,14 +295,14 @@ cvs_fetch() {
# Switch servers automagically if needed
if [[ ${mode} == "update" ]] ; then
- cd "/${ECVS_TOP_DIR}/${ECVS_LOCALNAME}"
- local oldserver=$(cat CVS/Root)
+ cd "/${ECVS_TOP_DIR}/${ECVS_LOCALNAME}" || die
+ local oldserver=$(cat CVS/Root || die)
if [[ ${server} != "${oldserver}" ]] ; then
einfo "Changing the CVS server from ${oldserver} to ${server}:"
debug-print "${FUNCNAME}: Changing the CVS server from ${oldserver} to ${server}:"
einfo "Searching for CVS directories ..."
- local cvsdirs=$(find . -iname CVS -print)
+ local cvsdirs=$(find . -iname CVS -print || die)
debug-print "${FUNCNAME}: CVS directories found:"
debug-print "${cvsdirs}"
@@ -309,21 +310,22 @@ cvs_fetch() {
local x
for x in ${cvsdirs} ; do
debug-print "In ${x}"
- echo "${server}" > "${x}/Root"
+ echo "${server}" > "${x}/Root" || die
done
fi
fi
# Prepare a cvspass file just for this session, we don't want to
# mess with ~/.cvspass
- touch "${T}/cvspass"
- export CVS_PASSFILE="${T}/cvspass"
+ local -x CVS_PASSFILE="${T}/cvspass"
+ touch "${CVS_PASSFILE}" || die
# The server string with the password in it, for login (only used for pserver)
- cvsroot_pass=":${connection}:${ECVS_USER}:${ECVS_PASS}@${ECVS_SERVER}"
+ local cvsroot_pass=":${connection}:${ECVS_USER}:${ECVS_PASS}@${ECVS_SERVER}"
# Ditto without the password, for checkout/update after login, so
# that the CVS/Root files don't contain the password in plaintext
+ local cvsroot_nopass
if [[ ${ECVS_AUTH} == "no" ]] ; then
cvsroot_nopass="${ECVS_USER}@${ECVS_SERVER}"
else
@@ -331,13 +333,21 @@ cvs_fetch() {
fi
# Commands to run
- cmdlogin=( ${ECVS_CVS_COMMAND} -d "${cvsroot_pass}" login )
- cmdupdate=( ${ECVS_CVS_COMMAND} -d "${cvsroot_nopass}" update ${ECVS_UP_OPTS} ${ECVS_LOCALNAME} )
- cmdcheckout=( ${ECVS_CVS_COMMAND} -d "${cvsroot_nopass}" checkout ${ECVS_CO_OPTS} ${ECVS_MODULE} )
+ local cmdlogin=(
+ ${ECVS_CVS_COMMAND} -d "${cvsroot_pass}" login
+ )
+ local cmdupdate=(
+ ${ECVS_CVS_COMMAND} -d "${cvsroot_nopass}" update
+ ${ECVS_UP_OPTS} ${ECVS_LOCALNAME}
+ )
+ local cmdcheckout=(
+ ${ECVS_CVS_COMMAND} -d "${cvsroot_nopass}" checkout
+ ${ECVS_CO_OPTS} ${ECVS_MODULE}
+ )
# Execute commands
- cd "${ECVS_TOP_DIR}"
+ cd "${ECVS_TOP_DIR}" || die
if [[ ${ECVS_AUTH} == "pserver" ]] ; then
einfo "Running ${cmdlogin[*]}"
"${cmdlogin[@]}" || die "cvs login command failed"
@@ -351,26 +361,11 @@ cvs_fetch() {
elif [[ ${ECVS_AUTH} == "ext" || ${ECVS_AUTH} == "no" ]] ; then
# Hack to support SSH password authentication
- # Backup environment variable values
- local CVS_ECLASS_ORIG_CVS_RSH="${CVS_RSH}"
-
- if [[ ${SSH_ASKPASS+set} == "set" ]] ; then
- local CVS_ECLASS_ORIG_SSH_ASKPASS="${SSH_ASKPASS}"
- else
- unset CVS_ECLASS_ORIG_SSH_ASKPASS
- fi
-
- if [[ ${DISPLAY+set} == "set" ]] ; then
- local CVS_ECLASS_ORIG_DISPLAY="${DISPLAY}"
- else
- unset CVS_ECLASS_ORIG_DISPLAY
- fi
-
if [[ ${CVS_RSH} == "ssh" ]] ; then
# Force SSH to use SSH_ASKPASS by creating python wrapper
- export CVS_RSH="${T}/cvs_sshwrapper"
- cat > "${CVS_RSH}"<<EOF
+ local -x CVS_RSH="${T}/cvs_sshwrapper"
+ cat > "${CVS_RSH}" <<EOF || die
#!${EPREFIX}/usr/bin/python
import fcntl
import os
@@ -391,52 +386,52 @@ EOF
# disable X11 forwarding which causes .xauth access violations
# - 20041205 Armando Di Cianno <fafhrd@gentoo.org>
echo "newarglist.insert(1, '-oClearAllForwardings=yes')" \
- >> "${CVS_RSH}"
+ >> "${CVS_RSH}" || die
echo "newarglist.insert(1, '-oForwardX11=no')" \
- >> "${CVS_RSH}"
+ >> "${CVS_RSH}" || die
# Handle SSH host key checking
- local CVS_ECLASS_KNOWN_HOSTS="${T}/cvs_ssh_known_hosts"
- echo "newarglist.insert(1, '-oUserKnownHostsFile=${CVS_ECLASS_KNOWN_HOSTS}')" \
- >> "${CVS_RSH}"
+ local known_hosts_file="${T}/cvs_ssh_known_hosts"
+ echo "newarglist.insert(1, '-oUserKnownHostsFile=${known_hosts_file}')" \
+ >> "${CVS_RSH}" || die
+ local strict_host_key_checking
if [[ -z ${ECVS_SSH_HOST_KEY} ]] ; then
ewarn "Warning: The SSH host key of the remote server will not be verified."
einfo "A temporary known hosts list will be used."
- local CVS_ECLASS_STRICT_HOST_CHECKING="no"
- touch "${CVS_ECLASS_KNOWN_HOSTS}"
+ strict_host_key_checking="no"
+ touch "${known_hosts_file}" || die
else
- local CVS_ECLASS_STRICT_HOST_CHECKING="yes"
- echo "${ECVS_SSH_HOST_KEY}" > "${CVS_ECLASS_KNOWN_HOSTS}"
+ strict_host_key_checking="yes"
+ echo "${ECVS_SSH_HOST_KEY}" > "${known_hosts_file}" || die
fi
echo -n "newarglist.insert(1, '-oStrictHostKeyChecking=" \
- >> "${CVS_RSH}"
- echo "${CVS_ECLASS_STRICT_HOST_CHECKING}')" \
- >> "${CVS_RSH}"
+ >> "${CVS_RSH}" || die
+ echo "${strict_host_key_checking}')" \
+ >> "${CVS_RSH}" || die
echo "os.execv('${EPREFIX}/usr/bin/ssh', newarglist)" \
- >> "${CVS_RSH}"
+ >> "${CVS_RSH}" || die
- chmod a+x "${CVS_RSH}"
+ chmod a+x "${CVS_RSH}" || die
# Make sure DISPLAY is set (SSH will not use SSH_ASKPASS
# if DISPLAY is not set)
- : "${DISPLAY:="DISPLAY"}"
- export DISPLAY
+ local -x DISPLAY="${DISPLAY:-DISPLAY}"
# Create a dummy executable to echo ${ECVS_PASS}
- export SSH_ASKPASS="${T}/cvs_sshechopass"
+ local -x SSH_ASKPASS="${T}/cvs_sshechopass"
if [[ ${ECVS_AUTH} != "no" ]] ; then
echo -en "#!/bin/bash\necho \"${ECVS_PASS}\"\n" \
- > "${SSH_ASKPASS}"
+ > "${SSH_ASKPASS}" || die
else
echo -en "#!/bin/bash\nreturn\n" \
- > "${SSH_ASKPASS}"
+ > "${SSH_ASKPASS}" || die
fi
- chmod a+x "${SSH_ASKPASS}"
+ chmod a+x "${SSH_ASKPASS}" || die
fi
if [[ ${mode} == "update" ]] ; then
@@ -446,20 +441,6 @@ EOF
einfo "Running ${cmdcheckout[*]}"
"${cmdcheckout[@]}" || die "cvs checkout command failed"
fi
-
- # Restore environment variable values
- export CVS_RSH="${CVS_ECLASS_ORIG_CVS_RSH}"
- if [[ ${CVS_ECLASS_ORIG_SSH_ASKPASS+set} == "set" ]] ; then
- export SSH_ASKPASS="${CVS_ECLASS_ORIG_SSH_ASKPASS}"
- else
- unset SSH_ASKPASS
- fi
-
- if [[ ${CVS_ECLASS_ORIG_DISPLAY+set} == "set" ]] ; then
- export DISPLAY="${CVS_ECLASS_ORIG_DISPLAY}"
- else
- unset DISPLAY
- fi
fi
}
@@ -508,12 +489,14 @@ cvs_src_unpack() {
debug-print "Copying module ${ECVS_MODULE} local_mode=${ECVS_LOCAL} from ${ECVS_TOP_DIR} ..."
# This is probably redundant, but best to make sure.
- mkdir -p "${WORKDIR}/${ECVS_LOCALNAME}"
+ mkdir -p "${WORKDIR}/${ECVS_LOCALNAME}" || die
if [[ -n ${ECVS_LOCAL} ]] ; then
- cp -f "${ECVS_TOP_DIR}/${ECVS_LOCALNAME}"/* "${WORKDIR}/${ECVS_LOCALNAME}"
+ cp -f "${ECVS_TOP_DIR}/${ECVS_LOCALNAME}"/* \
+ "${WORKDIR}/${ECVS_LOCALNAME}" || die
else
- cp -Rf "${ECVS_TOP_DIR}/${ECVS_LOCALNAME}" "${WORKDIR}/${ECVS_LOCALNAME}/.."
+ cp -Rf "${ECVS_TOP_DIR}/${ECVS_LOCALNAME}" \
+ "${WORKDIR}/${ECVS_LOCALNAME}/.." || die
fi
# Not exactly perfect, but should be pretty close #333773
@@ -522,6 +505,7 @@ cvs_src_unpack() {
LC_ALL=C sort | \
sha1sum | \
awk '{print $1}'
+ assert
)
# If the directory is empty, remove it; empty directories cannot
@@ -530,7 +514,7 @@ cvs_src_unpack() {
# the empty directory in workdir though.
if [[ $(ls -A "${ECVS_TOP_DIR}/${ECVS_LOCALNAME}") == "CVS" ]] ; then
debug-print "${FUNCNAME}: removing empty CVS directory ${ECVS_LOCALNAME}"
- rm -rf "${ECVS_TOP_DIR}/${ECVS_LOCALNAME}"
+ rm -rf "${ECVS_TOP_DIR}/${ECVS_LOCALNAME}" || die
fi
einfo "CVS module ${ECVS_MODULE} is now in ${WORKDIR}"
--
2.47.0
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [gentoo-dev] [PATCH 2/4] cvs.eclass: Rewrite the ssh wrapper script in bash
2024-10-17 5:58 [gentoo-dev] [PATCH 1/4] cvs.eclass: Add local declarations and die statements throughout Ulrich Müller
@ 2024-10-17 5:58 ` Ulrich Müller
2024-10-17 5:58 ` [gentoo-dev] [PATCH 3/4] cvs.eclass: New eclass variable ECVS_SSH_EXTRA_OPTS Ulrich Müller
2024-10-17 5:58 ` [gentoo-dev] [PATCH 4/4] app-shells/mksh: Restore live ebuild Ulrich Müller
2 siblings, 0 replies; 6+ messages in thread
From: Ulrich Müller @ 2024-10-17 5:58 UTC (permalink / raw
To: gentoo-dev; +Cc: Ulrich Müller
OpenSSH version 8.4 and later supports the SSH_ASKPASS_REQUIRE
environment variable which allows to force the use of the SSH_ASKPASS
program. This makes detaching the process from its controlling terminal
(TIOCNOTTY ioctl) unnecessary, as well as setting the DISPLAY variable.
Signed-off-by: Ulrich Müller <ulm@gentoo.org>
---
eclass/cvs.eclass | 62 +++++++++++++----------------------------------
1 file changed, 17 insertions(+), 45 deletions(-)
diff --git a/eclass/cvs.eclass b/eclass/cvs.eclass
index ec0ad2ec8f71..1289ee54cc3b 100644
--- a/eclass/cvs.eclass
+++ b/eclass/cvs.eclass
@@ -192,7 +192,7 @@ if [[ ${ECVS_AUTH} == "ext" ]] ; then
if [[ ${CVS_RSH} != "ssh" ]] ; then
die "Support for ext auth with clients other than ssh has not been implemented yet"
fi
- BDEPEND+=" net-misc/openssh"
+ BDEPEND+=" >=net-misc/openssh-8.4"
fi
# @FUNCTION: cvs_fetch
@@ -362,40 +362,9 @@ cvs_fetch() {
# Hack to support SSH password authentication
if [[ ${CVS_RSH} == "ssh" ]] ; then
- # Force SSH to use SSH_ASKPASS by creating python wrapper
-
- local -x CVS_RSH="${T}/cvs_sshwrapper"
- cat > "${CVS_RSH}" <<EOF || die
-#!${EPREFIX}/usr/bin/python
-import fcntl
-import os
-import sys
-try:
- fd = os.open('/dev/tty', 2)
- TIOCNOTTY=0x5422
- try:
- fcntl.ioctl(fd, TIOCNOTTY)
- except:
- pass
- os.close(fd)
-except:
- pass
-newarglist = sys.argv[:]
-EOF
-
- # disable X11 forwarding which causes .xauth access violations
- # - 20041205 Armando Di Cianno <fafhrd@gentoo.org>
- echo "newarglist.insert(1, '-oClearAllForwardings=yes')" \
- >> "${CVS_RSH}" || die
- echo "newarglist.insert(1, '-oForwardX11=no')" \
- >> "${CVS_RSH}" || die
-
# Handle SSH host key checking
local known_hosts_file="${T}/cvs_ssh_known_hosts"
- echo "newarglist.insert(1, '-oUserKnownHostsFile=${known_hosts_file}')" \
- >> "${CVS_RSH}" || die
-
local strict_host_key_checking
if [[ -z ${ECVS_SSH_HOST_KEY} ]] ; then
ewarn "Warning: The SSH host key of the remote server will not be verified."
@@ -407,28 +376,31 @@ EOF
echo "${ECVS_SSH_HOST_KEY}" > "${known_hosts_file}" || die
fi
- echo -n "newarglist.insert(1, '-oStrictHostKeyChecking=" \
- >> "${CVS_RSH}" || die
- echo "${strict_host_key_checking}')" \
- >> "${CVS_RSH}" || die
- echo "os.execv('${EPREFIX}/usr/bin/ssh', newarglist)" \
- >> "${CVS_RSH}" || die
+ # Create a wrapper script to pass additional options to SSH
+ # Disable X11 forwarding which causes .xauth access violations
+ local -x CVS_RSH="${T}/cvs_sshwrapper"
+ cat > "${CVS_RSH}" <<-EOF || die
+ #!${BROOT}/bin/bash
+ exec "${BROOT}/usr/bin/ssh" \\
+ -oStrictHostKeyChecking=${strict_host_key_checking} \\
+ -oUserKnownHostsFile="${known_hosts_file}" \\
+ -oForwardX11=no \\
+ -oClearAllForwardings=yes \\
+ "\$@"
+ EOF
chmod a+x "${CVS_RSH}" || die
- # Make sure DISPLAY is set (SSH will not use SSH_ASKPASS
- # if DISPLAY is not set)
-
- local -x DISPLAY="${DISPLAY:-DISPLAY}"
-
# Create a dummy executable to echo ${ECVS_PASS}
local -x SSH_ASKPASS="${T}/cvs_sshechopass"
+ local -x SSH_ASKPASS_REQUIRE="force"
+
if [[ ${ECVS_AUTH} != "no" ]] ; then
- echo -en "#!/bin/bash\necho \"${ECVS_PASS}\"\n" \
+ echo -en "#!${BROOT}/bin/bash\necho \"${ECVS_PASS}\"\n" \
> "${SSH_ASKPASS}" || die
else
- echo -en "#!/bin/bash\nreturn\n" \
+ echo -en "#!${BROOT}/bin/bash\nreturn\n" \
> "${SSH_ASKPASS}" || die
fi
chmod a+x "${SSH_ASKPASS}" || die
--
2.47.0
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [gentoo-dev] [PATCH 3/4] cvs.eclass: New eclass variable ECVS_SSH_EXTRA_OPTS
2024-10-17 5:58 [gentoo-dev] [PATCH 1/4] cvs.eclass: Add local declarations and die statements throughout Ulrich Müller
2024-10-17 5:58 ` [gentoo-dev] [PATCH 2/4] cvs.eclass: Rewrite the ssh wrapper script in bash Ulrich Müller
@ 2024-10-17 5:58 ` Ulrich Müller
2024-10-17 14:50 ` Mike Gilbert
2024-10-17 5:58 ` [gentoo-dev] [PATCH 4/4] app-shells/mksh: Restore live ebuild Ulrich Müller
2 siblings, 1 reply; 6+ messages in thread
From: Ulrich Müller @ 2024-10-17 5:58 UTC (permalink / raw
To: gentoo-dev; +Cc: Ulrich Müller
This allows passing additional options to ssh.
Signed-off-by: Ulrich Müller <ulm@gentoo.org>
---
eclass/cvs.eclass | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/eclass/cvs.eclass b/eclass/cvs.eclass
index 1289ee54cc3b..5148daa2d57d 100644
--- a/eclass/cvs.eclass
+++ b/eclass/cvs.eclass
@@ -174,6 +174,12 @@ _CVS_ECLASS=1
# WARNING: If a SSH host key is not specified using this variable, the
# remote host key will not be verified.
+# @ECLASS_VARIABLE: ECVS_SSH_EXTRA_OPTS
+# @DEFAULT_UNSET
+# @DESCRIPTION:
+# If SSH is used for "ext" authentication, this array variable can be
+# used to pass additional options to the SSH command.
+
# @ECLASS_VARIABLE: ECVS_CLEAN
# @DEFAULT_UNSET
# @DESCRIPTION:
@@ -387,6 +393,7 @@ cvs_fetch() {
-oUserKnownHostsFile="${known_hosts_file}" \\
-oForwardX11=no \\
-oClearAllForwardings=yes \\
+ ${ECVS_SSH_EXTRA_OPTS[*]} \\
"\$@"
EOF
chmod a+x "${CVS_RSH}" || die
--
2.47.0
^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [gentoo-dev] [PATCH 3/4] cvs.eclass: New eclass variable ECVS_SSH_EXTRA_OPTS
2024-10-17 5:58 ` [gentoo-dev] [PATCH 3/4] cvs.eclass: New eclass variable ECVS_SSH_EXTRA_OPTS Ulrich Müller
@ 2024-10-17 14:50 ` Mike Gilbert
2024-10-17 16:10 ` Ulrich Müller
0 siblings, 1 reply; 6+ messages in thread
From: Mike Gilbert @ 2024-10-17 14:50 UTC (permalink / raw
To: gentoo-dev; +Cc: Ulrich Müller
On Thu, Oct 17, 2024 at 1:58 AM Ulrich Müller <ulm@gentoo.org> wrote:
>
> This allows passing additional options to ssh.
>
> Signed-off-by: Ulrich Müller <ulm@gentoo.org>
> ---
> eclass/cvs.eclass | 7 +++++++
> 1 file changed, 7 insertions(+)
>
> diff --git a/eclass/cvs.eclass b/eclass/cvs.eclass
> index 1289ee54cc3b..5148daa2d57d 100644
> --- a/eclass/cvs.eclass
> +++ b/eclass/cvs.eclass
> @@ -174,6 +174,12 @@ _CVS_ECLASS=1
> # WARNING: If a SSH host key is not specified using this variable, the
> # remote host key will not be verified.
>
> +# @ECLASS_VARIABLE: ECVS_SSH_EXTRA_OPTS
> +# @DEFAULT_UNSET
> +# @DESCRIPTION:
> +# If SSH is used for "ext" authentication, this array variable can be
> +# used to pass additional options to the SSH command.
> +
> # @ECLASS_VARIABLE: ECVS_CLEAN
> # @DEFAULT_UNSET
> # @DESCRIPTION:
> @@ -387,6 +393,7 @@ cvs_fetch() {
> -oUserKnownHostsFile="${known_hosts_file}" \\
> -oForwardX11=no \\
> -oClearAllForwardings=yes \\
> + ${ECVS_SSH_EXTRA_OPTS[*]} \\
Why use an array if you're going to collapse it using the "*"
operator? Maybe use "${ECVS_SSH_EXTRA_OPTS[@]}" instead.
^ permalink raw reply [flat|nested] 6+ messages in thread
* [gentoo-dev] [PATCH 4/4] app-shells/mksh: Restore live ebuild
2024-10-17 5:58 [gentoo-dev] [PATCH 1/4] cvs.eclass: Add local declarations and die statements throughout Ulrich Müller
2024-10-17 5:58 ` [gentoo-dev] [PATCH 2/4] cvs.eclass: Rewrite the ssh wrapper script in bash Ulrich Müller
2024-10-17 5:58 ` [gentoo-dev] [PATCH 3/4] cvs.eclass: New eclass variable ECVS_SSH_EXTRA_OPTS Ulrich Müller
@ 2024-10-17 5:58 ` Ulrich Müller
2 siblings, 0 replies; 6+ messages in thread
From: Ulrich Müller @ 2024-10-17 5:58 UTC (permalink / raw
To: gentoo-dev; +Cc: Ulrich Müller
Closes: https://bugs.gentoo.org/911450
Signed-off-by: Ulrich Müller <ulm@gentoo.org>
---
app-shells/mksh/mksh-59c.ebuild | 6 +--
app-shells/mksh/mksh-9999.ebuild | 90 ++++++++++++++++++++++++++++++++
2 files changed, 93 insertions(+), 3 deletions(-)
create mode 100644 app-shells/mksh/mksh-9999.ebuild
diff --git a/app-shells/mksh/mksh-59c.ebuild b/app-shells/mksh/mksh-59c.ebuild
index 09bf32351049..2921a6d7f5c8 100644
--- a/app-shells/mksh/mksh-59c.ebuild
+++ b/app-shells/mksh/mksh-59c.ebuild
@@ -1,4 +1,4 @@
-# Copyright 1999-2022 Gentoo Authors
+# Copyright 1999-2024 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=7
@@ -10,6 +10,7 @@ if [[ ${PV} == *9999 ]] ; then
ECVS_MODULE="mksh"
ECVS_USER="_anoncvs"
ECVS_AUTH="ext"
+ ECVS_SSH_EXTRA_OPTS=( "-oHostKeyAlgorithms=+ssh-rsa" )
inherit cvs
else
SRC_URI="https://www.mirbsd.org/MirOS/dist/mir/mksh/${PN}-R${PV}.tgz"
@@ -19,6 +20,7 @@ fi
DESCRIPTION="MirBSD Korn Shell"
# Host is TLSv1.0-only, keep to http for compatibility with modern browsers
HOMEPAGE="http://mirbsd.de/mksh"
+S="${WORKDIR}/${PN}"
# See http://www.mirbsd.org/TaC-mksh.txt or ${S}/www/files/TaC-mksh.txt
# MirOS for most of it
@@ -37,8 +39,6 @@ DEPEND="
)
"
-S="${WORKDIR}/${PN}"
-
src_prepare() {
default
if use lksh; then
diff --git a/app-shells/mksh/mksh-9999.ebuild b/app-shells/mksh/mksh-9999.ebuild
new file mode 100644
index 000000000000..5c43ce0c33a5
--- /dev/null
+++ b/app-shells/mksh/mksh-9999.ebuild
@@ -0,0 +1,90 @@
+# Copyright 1999-2024 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+inherit toolchain-funcs
+
+if [[ ${PV} == *9999 ]] ; then
+ ECVS_SERVER="anoncvs.mirbsd.org:/cvs"
+ ECVS_MODULE="mksh"
+ ECVS_USER="_anoncvs"
+ ECVS_AUTH="ext"
+ ECVS_SSH_EXTRA_OPTS=( "-oHostKeyAlgorithms=+ssh-rsa" )
+ inherit cvs
+else
+ SRC_URI="https://www.mirbsd.org/MirOS/dist/mir/mksh/${PN}-R${PV}.tgz"
+ KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~riscv ~sparc ~x86 ~amd64-linux ~x86-linux"
+fi
+
+DESCRIPTION="MirBSD Korn Shell"
+# Host is TLSv1.0-only, keep to http for compatibility with modern browsers
+HOMEPAGE="http://mirbsd.de/mksh"
+S="${WORKDIR}/${PN}"
+
+# See http://www.mirbsd.org/TaC-mksh.txt or ${S}/www/files/TaC-mksh.txt
+# MirOS for most of it
+# BSD for when strlcpy(3) is absent, such as with glibc
+# unicode for some included Unicode data
+# ISC if the printf builtin is used, not currently the case
+LICENSE="MirOS BSD unicode"
+SLOT="0"
+IUSE="lksh static test"
+RESTRICT="!test? ( test )"
+
+DEPEND="
+ test? (
+ dev-lang/perl
+ sys-apps/ed
+ )
+"
+
+src_prepare() {
+ default
+ if use lksh; then
+ cp -pr "${S}" "${S}"_lksh || die
+ fi
+}
+
+src_compile() {
+ tc-export CC
+ use static && export LDSTATIC="-static"
+ export CPPFLAGS="${CPPFLAGS} -DMKSH_DEFAULT_PROFILEDIR=\\\"${EPREFIX}/etc\\\""
+
+ if use lksh; then
+ pushd "${S}"_lksh >/dev/null || die
+ CPPFLAGS="${CPPFLAGS} -DMKSH_BINSHPOSIX -DMKSH_BINSHREDUCED" \
+ sh Build.sh -r -L || die
+ popd >/dev/null || die
+ fi
+
+ sh Build.sh -r || die
+ sh FAQ2HTML.sh || die
+}
+
+src_test() {
+ einfo "Testing regular mksh."
+ ./mksh test.sh -v || die
+
+ if use lksh; then
+ einfo "Testing lksh, POSIX long-bit mksh."
+ pushd "${S}"_lksh >/dev/null || die
+ ./lksh test.sh -v || die
+ popd >/dev/null || die
+ fi
+}
+
+src_install() {
+ into /
+ dobin mksh
+ dosym mksh /bin/rmksh
+ doman mksh.1
+ dodoc dot.mkshrc
+ dodoc FAQ.htm
+
+ if use lksh; then
+ dobin "${S}"_lksh/lksh
+ dosym lksh /bin/rlksh
+ doman "${S}"_lksh/lksh.1
+ fi
+}
--
2.47.0
^ permalink raw reply related [flat|nested] 6+ messages in thread
end of thread, other threads:[~2024-10-17 16:10 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-10-17 5:58 [gentoo-dev] [PATCH 1/4] cvs.eclass: Add local declarations and die statements throughout Ulrich Müller
2024-10-17 5:58 ` [gentoo-dev] [PATCH 2/4] cvs.eclass: Rewrite the ssh wrapper script in bash Ulrich Müller
2024-10-17 5:58 ` [gentoo-dev] [PATCH 3/4] cvs.eclass: New eclass variable ECVS_SSH_EXTRA_OPTS Ulrich Müller
2024-10-17 14:50 ` Mike Gilbert
2024-10-17 16:10 ` Ulrich Müller
2024-10-17 5:58 ` [gentoo-dev] [PATCH 4/4] app-shells/mksh: Restore live ebuild Ulrich Müller
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox