diff --git a/tcsh-6.20.00-tcsh-posix-status.patch b/tcsh-6.20.00-tcsh-posix-status.patch new file mode 100644 index 0000000000000000000000000000000000000000..fe5b96ca577c109e642ef024c57657495e6255b1 --- /dev/null +++ b/tcsh-6.20.00-tcsh-posix-status.patch @@ -0,0 +1,147 @@ +From c4ec43cec37ea82af6c0ba6bb0a3e8c3e85411ce Mon Sep 17 00:00:00 2001 +From: Pavel Raiskup +Date: Mon, 28 Jul 2014 14:47:33 +0200 +Subject: [PATCH] downstream: implement variable tcsh_posix_status + + This patch partially reverts the dist-git commit e0b2d458fda4 - + because we *don't* really want to drop upstream-supported '$anyerror' + variable. And we can't drop $tcsh_posix_status neither, as we already + support that in RHEL5+ as a downstream patch. + + So from now, if "!defined(anyerror) || defined(tcsh_posix_status)", + tcsh behaves, with regards to pipelines, same way as POSIX-like shells. + + NOTE: This feature is left undocumented intentionaly, just to push + people use the upstream supported $anyerror. + + Resolves: #1129703 + Related: #759132 +--- + sh.c | 2 ++ + sh.h | 1 + + sh.proc.c | 2 +- + sh.set.c | 5 +++++ + tc.const.c | 2 ++ + tests/variables.at | 32 ++++++++++++++++++++++++++++++++ + 6 files changed, 43 insertions(+), 1 deletion(-) + +diff --git a/sh.c b/sh.c +index e9dfa81..38d073a 100644 +--- a/sh.c ++++ b/sh.c +@@ -356,6 +356,8 @@ main(int argc, char **argv) + anyerror = 1; /* for compatibility */ + setcopy(STRanyerror, STRNULL, VAR_READWRITE); + ++ tcsh_posix_status = 0; ++ + /* Default history size to 100 */ + setcopy(STRhistory, str2short("100"), VAR_READWRITE); + sethistory(100); +diff --git a/sh.h b/sh.h +index 95f439d..a41e2e0 100644 +--- a/sh.h ++++ b/sh.h +@@ -576,6 +576,7 @@ EXTERN int editing IZERO; /* doing filename expansion and line editing */ + EXTERN int noediting IZERO; /* initial $term defaulted to noedit */ + EXTERN int bslash_quote IZERO;/* PWP: tcsh-style quoting? (in sh.c) */ + EXTERN int anyerror IZERO; /* propagate errors from pipelines/backq */ ++EXTERN int tcsh_posix_status IZERO; /* negation for anyerror */ + EXTERN int compat_expr IZERO;/* csh-style expressions? */ + EXTERN int isoutatty IZERO; /* is SHOUT a tty */ + EXTERN int isdiagatty IZERO;/* is SHDIAG a tty */ +diff --git a/sh.proc.c b/sh.proc.c +index 0af5e03..ac6ef5d 100644 +--- a/sh.proc.c ++++ b/sh.proc.c +@@ -560,7 +560,7 @@ pjwait(struct process *pp) + do { + /* In case of pipelines only the result of the last + * command should be taken in account */ +- if (!anyerror && !(fp->p_flags & PBRACE) ++ if ((!anyerror || tcsh_posix_status) && !(fp->p_flags & PBRACE) + && ((fp->p_flags & PPOU) || (fp->p_flags & PBACKQ))) + continue; + if (fp->p_reason) +diff --git a/sh.set.c b/sh.set.c +index cf831b2..c155619 100644 +--- a/sh.set.c ++++ b/sh.set.c +@@ -113,6 +113,9 @@ update_vars(Char *vp) + else if (eq(vp, STRanyerror)) { + anyerror = 1; + } ++ else if (eq(vp, STRtcsh_posix_status)) { ++ tcsh_posix_status = 1; ++ } + else if (eq(vp, STRsymlinks)) { + Char *pn = varval(vp); + +@@ -783,6 +786,8 @@ unset(Char **v, struct command *c) + loginsh = 0; + if (adrof(STRanyerror) == 0) + anyerror = 0; ++ if (adrof(STRtcsh_posix_status) == 0) ++ tcsh_posix_status = 0; + if (adrof(STRwordchars) == 0) + word_chars = STR_WORD_CHARS; + if (adrof(STRedit) == 0) +diff --git a/tc.const.c b/tc.const.c +index cb39ab9..4fed182 100644 +--- a/tc.const.c ++++ b/tc.const.c +@@ -41,6 +41,8 @@ Char STRrootdefautologout[] = { '1', '5', '\0' }; + Char STRautomatic[] = { 'a', 'u', 't', 'o', 'm', 'a', 't', 'i', 'c', + '\0' }; + Char STRanyerror[] = { 'a', 'n', 'y', 'e', 'r', 'r', 'o', 'r', '\0' }; ++Char STRtcsh_posix_status[] = {'t', 'c', 's', 'h', '_', 'p', 'o', 's', 'i', 'x', ++ '_', 's', 't', 'a', 't', 'u', 's', '\0' }; + Char STRhangup[] = { 'h', 'a', 'n', 'g', 'u', 'p', '\0' }; + Char STRaout[] = { 'a', '.', 'o', 'u', 't', '\0' }; + Char STRtty[] = { 't', 't', 'y', '\0' }; +diff --git a/tests/variables.at b/tests/variables.at +index ffa0da2..5fa9239 100644 +--- a/tests/variables.at ++++ b/tests/variables.at +@@ -1490,6 +1490,38 @@ AT_CHECK([tcsh -f -c 'echo $?tcsh'], , + AT_CLEANUP() + + ++dnl ++dnl $ tcsh_posix_status ++dnl ++ ++AT_SETUP([$ tcsh_posix_status]) ++ ++AT_DATA([exit_status.csh], ++[[echo $?tcsh_posix_status ++false | true ; echo $? ++set tcsh_posix_status = 1 ; echo $?tcsh_posix_status $tcsh_posix_status ++false | true ; echo $? ++set tcsh_posix_status = 0 ; echo $?tcsh_posix_status $tcsh_posix_status ++# Note it is still set! ++false | true ; echo $? ++unset tcsh_posix_status ; echo $?tcsh_posix_status ++false | true ; echo $? ++]]) ++ ++AT_CHECK([tcsh -f exit_status.csh],, ++[0 ++1 ++1 1 ++0 ++1 0 ++0 ++0 ++1 ++]) ++ ++AT_CLEANUP() ++ ++ + dnl + dnl $ term + dnl +-- +2.7.4 + diff --git a/tcsh-6.24.07-manpage-memoryuse.patch b/tcsh-6.24.07-manpage-memoryuse.patch new file mode 100644 index 0000000000000000000000000000000000000000..b718b476ff9ae4789056f80c2938841cc797c695 --- /dev/null +++ b/tcsh-6.24.07-manpage-memoryuse.patch @@ -0,0 +1,25 @@ +From 2a431ea9318111535d37112daeeeccdc4df249ee Mon Sep 17 00:00:00 2001 +From: rpm-build +Date: Fri, 13 Jan 2023 09:02:11 +0100 +Subject: [PATCH] Inform about no support for 'limit memoryuse' in manpage + +Related: #247637 +--- + tcsh.man.in | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/tcsh.man.in b/tcsh.man.in +index 24a9629..d405a70 100644 +--- a/tcsh.man.in ++++ b/tcsh.man.in +@@ -5960,6 +5960,7 @@ Maximum amount of swap space reserved or used for this user. + Maximum number of threads for this process. + . + .It Ic vmemoryuse ++NOTE: Changing this value has no effect. Support has been removed from Linux kernel v2.6 and newer. + Maximum amount of virtual memory a process + may have allocated to it at a given time (address space). + . +-- +2.39.0 + diff --git a/tcsh-6.24.07.tar.gz b/tcsh-6.24.07.tar.gz deleted file mode 100644 index 1375a3e9ec8116329f51a465d301fa4a38eff362..0000000000000000000000000000000000000000 Binary files a/tcsh-6.24.07.tar.gz and /dev/null differ diff --git a/tcsh-6.24.10.tar.gz b/tcsh-6.24.10.tar.gz new file mode 100644 index 0000000000000000000000000000000000000000..4b90c0ac94f29eecdc35aed73c636c5d3a942563 Binary files /dev/null and b/tcsh-6.24.10.tar.gz differ diff --git a/tcsh.spec b/tcsh.spec index b80be3a7493002b8805f838ce5889524e2c7777d..9c52248785ef727045d1539cd75ef6bcd843cdf0 100644 --- a/tcsh.spec +++ b/tcsh.spec @@ -4,9 +4,9 @@ Name: tcsh Summary: An enhanced version of csh, the C shell -Version: 6.24.07 +Version: 6.24.10 Release: %{anolis_release}%{?dist} -License: BSD +License: BSD-3-Clause URL: http://www.tcsh.org/ Source0: http://ftp.funet.fi/pub/mirrors/ftp.astron.com/pub/%{name}/%{name}-%{version}.tar.gz @@ -26,6 +26,9 @@ BuildRequires: autoconf BuildRequires: gettext-devel BuildRequires: ncurses-devel +Patch100: tcsh-6.24.07-manpage-memoryuse.patch +Patch200: tcsh-6.20.00-tcsh-posix-status.patch + %description Tcsh is an enhanced but completely compatible version of csh, the C shell. Tcsh is a command language interpreter which can be used both as an interactive login @@ -138,5 +141,8 @@ fi %doc FAQ Fixes README.md complete.tcsh %changelog +* Wed Feb 26 2024 Weisson - 6.24.10-1 +- Refer to CentOS Stream tcsh-6.24.10-5 (tdawson@redhat.com) + * Mon Mar 27 2023 Yuanhong Peng - 6.24.07-1 - Init from upstream