tcsh: Update to 6.20.00 release

Fix segfaults on musl

Signed-off-by: Khem Raj <raj.khem@gmail.com>
This commit is contained in:
Khem Raj
2017-03-22 19:26:44 -07:00
committed by Martin Jansa
parent c142219d33
commit 4ecaaf8c1d
15 changed files with 134 additions and 261 deletions
@@ -1,16 +0,0 @@
Author: Franz Pletz <fpletz@franz-pletz.org>
Description: Original comment: Fix build
Not sure why we have this patch. Let's keep it for compatibility.
--- a/pathnames.h
+++ b/pathnames.h
@@ -92,6 +92,10 @@
# define _PATH_TCSHELL "/local/bin/tcsh" /* use ram disk */
#endif /* _MINIX && !_PATH_TCSHELL */
+#ifndef _PATH_TCSHELL
+# define _PATH_TCSHELL "/bin/tcsh" /* Debian */
+#endif /* !_PATH_TCSHELL */
+
#if defined(__EMX__) && !defined(_PATH_DEVNULL)
# define _PATH_DEVNULL "nul"
#endif /* __EMX__ && !_PATH_DEVNULL */
@@ -1,13 +0,0 @@
Author: Franz Pletz <fpletz@franz-pletz.org>
Description: Update manpage.
--- a/tcsh.man
+++ b/tcsh.man
@@ -578,7 +578,7 @@ Repeating \fIdabbrev-expand\fR without a
changes to the next previous word etc., skipping identical matches
much like \fIhistory-search-backward\fR does.
.TP 8
-.B delete-char \fR(not bound)
+.B delete-char \fR(bound to `Del' if using the standard \fI/etc/csh.cshrc\fR)
Deletes the character under the cursor.
See also \fIdelete-char-or-list-or-eof\fR.
.TP 8
@@ -1,13 +0,0 @@
Author: Franz Pletz <fpletz@franz-pletz.org>
Description: Enable NODOT
--- a/config_f.h
+++ b/config_f.h
@@ -98,7 +98,7 @@
/*
* NODOT Don't put "." in the default path, for security reasons
*/
-#undef NODOT
+#define NODOT
/*
* AUTOLOGOUT tries to determine if it should set autologout depending
@@ -1,24 +0,0 @@
Author: Franz Pletz <fpletz@franz-pletz.org>
Description: Don't die on unknown LS_COLORS values
Removing the patch causes a segfault when dircolors is set by coreutils' dircolors.
Debian-Bug: #592089
--- a/tw.color.c
+++ b/tw.color.c
@@ -239,13 +239,10 @@ parseLS_COLORS(const Char *value)
if ((Char)variables[i].variable[0] == (v[0] & CHAR) &&
(Char)variables[i].variable[1] == (v[1] & CHAR))
break;
- if (i < nvariables) {
- v += 3;
+ v += 3;
+ if (i < nvariables)
getstring(&c, &v, &variables[i].color, ':');
- continue;
- }
- else
- stderror(ERR_BADCOLORVAR, v[0], v[1]);
+ continue;
}
break;
}
@@ -1,14 +0,0 @@
Author: Lucas Nussbaum <lucas@debian.org>
Description: do not strip binary
Stripping should be handled by dh_strip instead, so DEB_BUILD_OPTIONS=nostrip works.
Closes: #438109, #411607
--- a/Makefile.in
+++ b/Makefile.in
@@ -596,7 +596,6 @@ install: tcsh$(EXEEXT)
-mkdir -p ${DESTBIN}
-mv -f ${DESTBIN}/tcsh$(EXEEXT) ${DESTBIN}/tcsh.old
cp tcsh$(EXEEXT) ${DESTBIN}/tcsh$(EXEEXT)
- -strip ${DESTBIN}/tcsh$(EXEEXT)
chmod 755 ${DESTBIN}/tcsh$(EXEEXT)
install.man: tcsh.man
@@ -1,14 +0,0 @@
Author: Lucas Nussbaum <lucas@debian.org>
Description: disable syntactically incorrect test
--- a/tests/lexical.at
+++ b/tests/lexical.at
@@ -172,9 +172,6 @@
AT_DATA([nohist.csh],
[echo ! space ! tab != "!(" newline !
])
-AT_CHECK([tcsh -f nohist.csh], ,
-[[! space ! tab != !( newline !
-]])
AT_CLEANUP
@@ -1,30 +0,0 @@
--- a/tests/lexical.at
+++ b/tests/lexical.at
@@ -27,27 +27,6 @@ AT_CHECK([tcsh -f oneword.csh], ,
AT_CLEANUP
-
-AT_SETUP([Comments])
-
-AT_CHECK([echo 'echo OK@%:@comment' | tcsh -f], , [OK
-])
-
-AT_CHECK([tcsh -f -c 'echo @%:@no comment'], ,
-[@%:@no comment
-])
-
-AT_DATA([comment2.csh],
-[[echo testing...@%:@\
-OK
-]])
-AT_CHECK([tcsh -f comment2.csh], ,
-[testing... OK
-])
-
-AT_CLEANUP
-
-
AT_SETUP([Escaping special characters])
AT_DATA([nosplit.csh],
@@ -1,23 +0,0 @@
Author: Lucas Nussbaum <lucas@debian.org>
Description: disable test that fails on the buildd with
"setpriority: Permission denied".
--- a/tests/commands.at
+++ b/tests/commands.at
@@ -888,17 +888,6 @@ TCSH_UNTESTED([migrate])
TCSH_UNTESTED([newgrp])
-AT_SETUP([nice])
-
-# Nothing really tested
-AT_CHECK([tcsh -f -c 'nice set var=1; echo $?var'], ,
-[0
-])
-
-
-AT_CLEANUP
-
-
AT_SETUP([nohup])
AT_DATA([nohup.csh],
@@ -1,30 +0,0 @@
From: Lucas Nussbaum <lucas@debian.org>
Description: Those tests fail when running the testsuite without a tty. Disabling them.
--- a/tests/commands.at
+++ b/tests/commands.at
@@ -1203,11 +1203,6 @@ AT_SETUP([source])
AT_DATA([script.csh],
[[set var=$1
]])
-AT_CHECK([[tcsh -f -c 'source -h script.csh foo; history' \
- | sed 's/ [^ ]* / TIME /']], ,
-[ 1 TIME source -h script.csh foo ; history
- 2 TIME set var=$1
-])
AT_CHECK([tcsh -f -c 'source -h script.csh foo; echo $var'], 1, [],
[var: Undefined variable.
--- a/tests/variables.at
+++ b/tests/variables.at
@@ -319,10 +319,6 @@ AT_CLEANUP
AT_SETUP([$ edit])
-AT_CHECK([TERM=something tcsh -f -c 'echo $?edit'], ,
-[1
-])
-
AT_CHECK([TERM=dumb tcsh -f -c 'echo $?edit'], ,
[0
])
@@ -1,11 +0,0 @@
--- tcsh-6.18.01/sh.proc.c.orig 2016-06-08 16:11:02.902326725 +0000
+++ tcsh-6.18.01/sh.proc.c 2016-06-08 16:38:22.150304901 +0000
@@ -48,7 +48,7 @@
#endif /* aiws */
#if defined(_BSD) || (defined(IRIS4D) && __STDC__) || defined(__lucid) || defined(__linux__) || defined(__GNU__) || defined(__GLIBC__)
-# if !defined(__ANDROID__)
+# if !defined(__ANDROID__) && !defined(__GLIBC__)
# define BSDWAIT
# endif
#endif /* _BSD || (IRIS4D && __STDC__) || __lucid || glibc */
@@ -1,18 +0,0 @@
Author: Jean-Luc Leger <reiga@dspnet.fr.eu.org>
Description: fix broken globbing expansion
Debian-Bug: #603545
Index: tcsh-6.18.01/tc.str.c
===================================================================
--- tcsh-6.18.01.orig/tc.str.c 2012-01-10 13:34:31.000000000 -0800
+++ tcsh-6.18.01/tc.str.c 2013-02-26 13:12:13.429153489 -0800
@@ -122,8 +122,9 @@
#else
ret = mbtowc(&tmp, s, n);
#endif
- if (ret > 0) {
+ if (ret >= 0)
*pwc = tmp;
+ if (ret >= 0) {
#if defined(UTF16_STRINGS) && defined(HAVE_MBRTOWC)
if (tmp >= 0xd800 && tmp <= 0xdbff) {
/* UTF-16 surrogate pair. Fetch second half and compute
@@ -0,0 +1,30 @@
From 0553455813a1f717ef50cc911e4db73da3d23c32 Mon Sep 17 00:00:00 2001
From: Khem Raj <raj.khem@gmail.com>
Date: Wed, 22 Mar 2017 18:47:40 -0700
Subject: [PATCH 1/2] Enable system malloc on all linux
Dont trigger on being just android or glibc
internal malloc falls flat on musl based systems
as well. So switch to using system malloc
Signed-off-by: Khem Raj <raj.khem@gmail.com>
---
config_f.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/config_f.h b/config_f.h
index 6a632a5..0a66960 100644
--- a/config_f.h
+++ b/config_f.h
@@ -139,7 +139,7 @@
* This can be much slower and no memory statistics will be
* provided.
*/
-#if defined(__MACHTEN__) || defined(PURIFY) || defined(MALLOC_TRACE) || defined(_OSD_POSIX) || defined(__MVS__) || defined (__CYGWIN__) || defined(__GLIBC__) || defined(__OpenBSD__) || defined(__APPLE__) || defined (__ANDROID__)
+#if defined(__MACHTEN__) || defined(PURIFY) || defined(MALLOC_TRACE) || defined(_OSD_POSIX) || defined(__MVS__) || defined (__CYGWIN__) || defined(__linux__) || defined(__OpenBSD__) || defined(__APPLE__)
# define SYSMALLOC
#else
# undef SYSMALLOC
--
2.12.1
@@ -0,0 +1,60 @@
From 60271713025f6b17dda29721be012a8428e77185 Mon Sep 17 00:00:00 2001
From: Khem Raj <raj.khem@gmail.com>
Date: Wed, 22 Mar 2017 18:56:49 -0700
Subject: [PATCH 2/2] Add debian csh scripts
Signed-off-by: Khem Raj <raj.khem@gmail.com>
---
csh.cshrc | 15 +++++++++++++++
csh.login | 8 ++++++++
csh.logout | 1 +
3 files changed, 24 insertions(+)
create mode 100644 csh.cshrc
create mode 100644 csh.login
create mode 100644 csh.logout
diff --git a/csh.cshrc b/csh.cshrc
new file mode 100644
index 0000000..29c934a
--- /dev/null
+++ b/csh.cshrc
@@ -0,0 +1,15 @@
+# /etc/csh.cshrc: system-wide .cshrc file for csh(1) and tcsh(1)
+
+if ($?tcsh && $?prompt) then
+
+ bindkey "\e[1~" beginning-of-line # Home
+ bindkey "\e[7~" beginning-of-line # Home rxvt
+ bindkey "\e[2~" overwrite-mode # Ins
+ bindkey "\e[3~" delete-char # Delete
+ bindkey "\e[4~" end-of-line # End
+ bindkey "\e[8~" end-of-line # End rxvt
+
+ set autoexpand
+ set autolist
+ set prompt = "%U%m%u:%B%~%b%# "
+endif
diff --git a/csh.login b/csh.login
new file mode 100644
index 0000000..2455c3c
--- /dev/null
+++ b/csh.login
@@ -0,0 +1,8 @@
+# /etc/csh.login: system-wide .login file for csh(1) and tcsh(1)
+
+# allow for other packages/system admins to customize the shell environment
+if (-e /etc/csh/login.d && `/bin/ls /etc/csh/login.d` != "") then
+ foreach FILE (`/bin/ls /etc/csh/login.d/*`)
+ source $FILE;
+ end;
+endif
diff --git a/csh.logout b/csh.logout
new file mode 100644
index 0000000..a207eba
--- /dev/null
+++ b/csh.logout
@@ -0,0 +1 @@
+# /etc/csh.logout: system-wide .logout file for csh(1) and tcsh(1)
--
2.12.1
@@ -1,55 +0,0 @@
DESCRIPTION = "TENEX C Shell, an enhanced version of Berkeley csh \
The TENEX C Shell is an enhanced version of the Berkeley Unix C shell. \
It includes all features of 4.4BSD C shell, plus a command-line editor, \
programmable word completion, spelling correction and more."
HOMEPAGE = "http://www.tcsh.org/"
LICENSE = "BSD"
LIC_FILES_CHKSUM = "file://Copyright;md5=1cf29be62df2be1a3763118b25b4c780"
SECTION = "base"
DEPENDS = "ncurses gettext-native"
SRC_URI = " \
${DEBIAN_MIRROR}/main/t/tcsh/tcsh_${PV}.orig.tar.gz;name=tarball \
${DEBIAN_MIRROR}/main/t/tcsh/tcsh_${PV}-2.diff.gz;name=diffs2 \
${DEBIAN_MIRROR}/main/t/tcsh/tcsh_${PV}-5.diff.gz;name=diffs5 \
file://01_build.1.patch \
file://01_build.2.patch \
file://01_build.3.patch \
file://15_no-strip.patch \
file://disable-test-notty.patch \
file://disable-test-nice.patch \
file://disable-lexical.at-31.patch \
file://12_unknown_lscolors.patch \
file://tcsh-6.17.02-multibyte.patch \
file://disable-broken-test.patch \
file://fix-gcc6-wait-union.patch \
"
SRC_URI[tarball.md5sum] = "6eed09dbd4223ab5b6955378450d228a"
SRC_URI[tarball.sha256sum] = "d81ca27851f3e8545666399b4bcf25433e602a195113b3f7c73886fef84c9fa8"
SRC_URI[diffs2.md5sum] = "ea39b818b624aca49ebf2cd2708d6ff9"
SRC_URI[diffs2.sha256sum] = "95b0c1a339b745c47c5d2f9d02c22a71597462e2e882b51614a9d1f75bd3d16c"
SRC_URI[diffs5.md5sum] = "d536c12a02dc48c332cc472b86927319"
SRC_URI[diffs5.sha256sum] = "7548d64bf996548bfbc13f3e0959fd2e8455f8375381a31da67d79554aabc7af"
inherit autotools
do_install_append () {
oe_runmake install.man DESTDIR=${D}
install -d ${D}${base_bindir}
ln -s /usr/bin/tcsh ${D}${base_bindir}/tcsh
install -d ${D}${sysconfdir}/csh/login.d
install -m 0644 ${S}/debian/csh.cshrc ${S}/debian/csh.login ${S}/debian/csh.logout ${S}/complete.tcsh ${D}${sysconfdir}
install -D -m 0644 ${S}/csh-mode.el ${D}${datadir}/emacs/site-lisp/csh-mode.el
}
FILES_${PN} += "${datadir}/emacs/site-lisp/csh-mode.el"
pkg_postinst_${PN} () {
#!/bin/sh -e
echo /usr/bin/tcsh >> $D/etc/shells
}
PNBLACKLIST[tcsh] ?= "Doesn't respect CC variable and fails with HOSTTOOLS http://errors.yoctoproject.org/Errors/Details/138244/"
@@ -0,0 +1,44 @@
DESCRIPTION = "TENEX C Shell, an enhanced version of Berkeley csh \
The TENEX C Shell is an enhanced version of the Berkeley Unix C shell. \
It includes all features of 4.4BSD C shell, plus a command-line editor, \
programmable word completion, spelling correction and more."
HOMEPAGE = "http://www.tcsh.org/"
LICENSE = "BSD-3-Clause"
LIC_FILES_CHKSUM = "file://Copyright;md5=575cf2715c3bf894e1f79aec1d4eaaf5"
SECTION = "base"
DEPENDS = "ncurses gettext-native"
SRC_URI = " \
http://ftp.funet.fi/pub/mirrors/ftp.astron.com/pub/tcsh/${BP}.tar.gz \
file://0001-Enable-system-malloc-on-all-linux.patch \
file://0002-Add-debian-csh-scripts.patch \
"
SRC_URI[md5sum] = "59d40ef40a68e790d95e182069431834"
SRC_URI[sha256sum] = "b89de7064ab54dac454a266cfe5d8bf66940cb5ed048d0c30674ea62e7ecef9d"
EXTRA_OEMAKE += "CC_FOR_GETHOST='${BUILD_CC}'"
inherit autotools
do_compile_prepend() {
oe_runmake CC_FOR_GETHOST='${BUILD_CC}' CFLAGS='${BUILD_CFLAGS}' gethost
}
do_install_append () {
oe_runmake install.man DESTDIR=${D}
install -d ${D}${base_bindir}
ln -s /usr/bin/tcsh ${D}${base_bindir}/tcsh
ln -s /usr/bin/tcsh ${D}${base_bindir}/csh
install -d ${D}${sysconfdir}/csh/login.d
install -m 0644 ${S}/csh.cshrc ${S}/csh.login ${S}/csh.logout ${S}/complete.tcsh ${D}${sysconfdir}
install -D -m 0644 ${S}/csh-mode.el ${D}${datadir}/emacs/site-lisp/csh-mode.el
}
FILES_${PN} += "${datadir}/emacs/site-lisp/csh-mode.el"
pkg_postinst_${PN} () {
#!/bin/sh -e
echo /usr/bin/tcsh >> $D/etc/shells
echo /usr/bin/csh >> $D/etc/shells
}