From de6fcbdb464b70b4b826bf9716e550e5c4a08c0d Mon Sep 17 00:00:00 2001 From: Pavel Raiskup Date: Mon, 28 Jul 2014 15:51:13 +0200 Subject: rebase: to beta version (testing purposes only) Some changes in packaging: - %patch ~> %autosetup (git format-patch diff format) - using upstream version of history file locking - upstream testsuite enabled Version: 6.18.02-1 --- tcsh-6.13.00-memoryuse.patch | 27 ---- tcsh-6.14.00-order.patch | 14 -- tcsh-6.14.00-syntax.patch | 37 ----- tcsh-6.14.00-tinfo.patch | 25 --- tcsh-6.14.00-unprintable.patch | 13 -- tcsh-6.15.00-closem.patch | 28 ---- tcsh-6.15.00-hist-sub.patch | 12 -- tcsh-6.17.00-manpage-spelling.patch | 36 ----- tcsh-6.18.01-elf-interpreter.patch | 223 -------------------------- tcsh-6.18.01-posix-exit-status-value.patch | 105 ------------- tcsh-6.18.01-repeated-words-man.patch | 21 --- tcsh-6.18.02-closem.patch | 43 +++++ tcsh-6.18.02-elf-interpreter.patch | 245 +++++++++++++++++++++++++++++ tcsh-6.18.02-fixgencat.patch | 42 +++++ tcsh-6.18.02-hist-sub.patch | 26 +++ tcsh-6.18.02-memoryuse.patch | 27 ++++ tcsh-6.18.02-order.patch | 28 ++++ tcsh-6.18.02-posix-exit-status-value.patch | 124 +++++++++++++++ tcsh-6.18.02-syntax.patch | 60 +++++++ tcsh-6.18.02-tinfo.patch | 26 +++ tcsh-6.18.02-unprintable.patch | 28 ++++ tcsh.spec | 69 ++++---- 22 files changed, 678 insertions(+), 581 deletions(-) delete mode 100644 tcsh-6.13.00-memoryuse.patch delete mode 100644 tcsh-6.14.00-order.patch delete mode 100644 tcsh-6.14.00-syntax.patch delete mode 100644 tcsh-6.14.00-tinfo.patch delete mode 100644 tcsh-6.14.00-unprintable.patch delete mode 100644 tcsh-6.15.00-closem.patch delete mode 100644 tcsh-6.15.00-hist-sub.patch delete mode 100644 tcsh-6.17.00-manpage-spelling.patch delete mode 100644 tcsh-6.18.01-elf-interpreter.patch delete mode 100644 tcsh-6.18.01-posix-exit-status-value.patch delete mode 100644 tcsh-6.18.01-repeated-words-man.patch create mode 100644 tcsh-6.18.02-closem.patch create mode 100644 tcsh-6.18.02-elf-interpreter.patch create mode 100644 tcsh-6.18.02-fixgencat.patch create mode 100644 tcsh-6.18.02-hist-sub.patch create mode 100644 tcsh-6.18.02-memoryuse.patch create mode 100644 tcsh-6.18.02-order.patch create mode 100644 tcsh-6.18.02-posix-exit-status-value.patch create mode 100644 tcsh-6.18.02-syntax.patch create mode 100644 tcsh-6.18.02-tinfo.patch create mode 100644 tcsh-6.18.02-unprintable.patch diff --git a/tcsh-6.13.00-memoryuse.patch b/tcsh-6.13.00-memoryuse.patch deleted file mode 100644 index e78cda3..0000000 --- a/tcsh-6.13.00-memoryuse.patch +++ /dev/null @@ -1,27 +0,0 @@ -From 4c3740ae5bb48c187f66655f1cddcb55f43566b1 Mon Sep 17 00:00:00 2001 -From: "Vojtech Vitek (V-Teq)" -Date: Thu, 15 Mar 2012 02:21:37 +0100 -Subject: [PATCH] Add memoryuse note in manpage regarding kernel 2.6 and - higher - ---- - tcsh.man | 3 ++- - 1 files changed, 2 insertions(+), 1 deletions(-) - -diff --git a/tcsh.man b/tcsh.man -index 8c6c9e1..b0ea99f 100644 ---- a/tcsh.man -+++ b/tcsh.man -@@ -2941,7 +2941,8 @@ the size of the largest core dump that will be created - .TP - \fImemoryuse\fR - the maximum amount of physical memory a process --may have allocated to it at a given time -+may have allocated to it at a given time (this is not implemented in the 2.6+ kernel, -+so there is no effect introduced by changing this value) - .TP - \fIvmemoryuse\fR - the maximum amount of virtual memory a process --- -1.7.6.5 - diff --git a/tcsh-6.14.00-order.patch b/tcsh-6.14.00-order.patch deleted file mode 100644 index 7bbbe8c..0000000 --- a/tcsh-6.14.00-order.patch +++ /dev/null @@ -1,14 +0,0 @@ -diff -up tcsh-6.15.00/tcsh.man.order tcsh-6.15.00/tcsh.man ---- tcsh-6.15.00/tcsh.man.order 2008-09-03 12:30:44.000000000 +0200 -+++ tcsh-6.15.00/tcsh.man 2008-09-03 12:30:44.000000000 +0200 -@@ -1614,7 +1614,9 @@ They include - .PP - Here the precedence increases to the right, `==' `!=' `=~' and `!~', `<=' - `>=' `<' and `>', `<<' and `>>', `+' and `\-', `*' `/' and `%' being, in --groups, at the same level. The `==' `!=' `=~' and `!~' operators compare -+groups, at the same level. When multiple operators which have same precedence -+are used in one expression, calculation must be done from operator of right -+side. The `==' `!=' `=~' and `!~' operators compare - their arguments as strings; all others operate on numbers. The operators - `=~' and `!~' are like `!=' and `==' except that the right hand side is a - glob-pattern (see \fBFilename substitution\fR) against which the left hand diff --git a/tcsh-6.14.00-syntax.patch b/tcsh-6.14.00-syntax.patch deleted file mode 100644 index 01735d3..0000000 --- a/tcsh-6.14.00-syntax.patch +++ /dev/null @@ -1,37 +0,0 @@ -diff -up tcsh-6.17.00/sh.func.c_old tcsh-6.17.00/sh.func.c ---- tcsh-6.17.00/sh.func.c_old 2009-07-20 14:54:16.000000000 +0200 -+++ tcsh-6.17.00/sh.func.c 2009-07-20 14:55:34.000000000 +0200 -@@ -753,8 +753,6 @@ search(int type, int level, Char *goal) - { - struct Strbuf word = Strbuf_INIT; - Char *cp; -- struct whyle *wp; -- int wlevel = 0; - struct wordent *histent = NULL, *ohistent = NULL; - - Stype = type; -@@ -811,24 +809,13 @@ search(int type, int level, Char *goal) - - case TC_FOREACH: - case TC_WHILE: -- wlevel++; - if (type == TC_BREAK) - level++; - break; - - case TC_END: -- if (type == TC_BRKSW) { -- if (wlevel == 0) { -- wp = whyles; -- if (wp) { -- whyles = wp->w_next; -- wpfree(wp); -- } -- } -- } - if (type == TC_BREAK) - level--; -- wlevel--; - break; - - case TC_SWITCH: diff --git a/tcsh-6.14.00-tinfo.patch b/tcsh-6.14.00-tinfo.patch deleted file mode 100644 index 6488f9f..0000000 --- a/tcsh-6.14.00-tinfo.patch +++ /dev/null @@ -1,25 +0,0 @@ -From 039673bc9e8f3f6b198d1fc68878324a63bd111a Mon Sep 17 00:00:00 2001 -From: "Vojtech Vitek (V-Teq)" -Date: Thu, 15 Mar 2012 02:10:35 +0100 -Subject: [PATCH] Search for tinfo library instead of termcap/(n)curses etc. - ---- - configure.in | 2 +- - 1 files changed, 1 insertions(+), 1 deletions(-) - -diff --git a/configure.in b/configure.in -index 103ab37..9a2afef 100644 ---- a/configure.in -+++ b/configure.in -@@ -299,7 +299,7 @@ fi - dnl Checks for libraries - AC_SEARCH_LIBS(crypt, crypt) - AC_SEARCH_LIBS(getspnam, sec) --AC_SEARCH_LIBS(tgetent, termlib termcap curses ncurses) -+AC_SEARCH_LIBS(tgetent, tinfo) - AC_SEARCH_LIBS(gethostbyname, nsl) - AC_SEARCH_LIBS(connect, socket) - AC_SEARCH_LIBS(catgets, catgets) --- -1.7.6.5 - diff --git a/tcsh-6.14.00-unprintable.patch b/tcsh-6.14.00-unprintable.patch deleted file mode 100644 index 9d49458..0000000 --- a/tcsh-6.14.00-unprintable.patch +++ /dev/null @@ -1,13 +0,0 @@ -diff -up tcsh-6.15.00/tw.parse.c.unprintable tcsh-6.15.00/tw.parse.c ---- tcsh-6.15.00/tw.parse.c.unprintable 2007-03-01 22:21:42.000000000 +0100 -+++ tcsh-6.15.00/tw.parse.c 2008-08-29 12:28:56.000000000 +0200 -@@ -2119,7 +2119,8 @@ print_by_column(Char *dir, Char *items[] - (Strchr(val, 'x') != NULL); - - for (i = 0; i < count; i++) { /* find widest string */ -- maxwidth = max(maxwidth, (unsigned int) NLSStringWidth(items[i])); -+ if (NLSStringWidth(items[i]) != -1) -+ maxwidth = max(maxwidth, (unsigned int) NLSStringWidth(items[i])); - } - - maxwidth += no_file_suffix ? 1 : 2; /* for the file tag and space */ diff --git a/tcsh-6.15.00-closem.patch b/tcsh-6.15.00-closem.patch deleted file mode 100644 index 3a3da89..0000000 --- a/tcsh-6.15.00-closem.patch +++ /dev/null @@ -1,28 +0,0 @@ -diff -up tcsh-6.15.00/sh.misc.c.closem tcsh-6.15.00/sh.misc.c ---- tcsh-6.15.00/sh.misc.c.closem 2006-10-14 19:57:21.000000000 +0200 -+++ tcsh-6.15.00/sh.misc.c 2008-08-29 12:26:41.000000000 +0200 -@@ -255,6 +255,7 @@ void - closem(void) - { - int f, num_files; -+ struct stat st; - - #ifdef NLS_BUGS - #ifdef NLS_CATALOGS -@@ -272,6 +273,16 @@ closem(void) - #ifdef MALLOC_TRACE - && f != 25 - #endif /* MALLOC_TRACE */ -+#ifdef S_ISSOCK -+ /* NSS modules (e.g. Linux nss_ldap) might keep sockets open. -+ * If we close such a socket, both the NSS module and tcsh think -+ * they "own" the descriptor. -+ * -+ * Not closing sockets does not make the cleanup use of closem() -+ * less reliable because tcsh never creates sockets. -+ */ -+ && fstat(f, &st) == 0 && !S_ISSOCK(st.st_mode) -+#endif - ) - { - xclose(f); diff --git a/tcsh-6.15.00-hist-sub.patch b/tcsh-6.15.00-hist-sub.patch deleted file mode 100644 index 6abf000..0000000 --- a/tcsh-6.15.00-hist-sub.patch +++ /dev/null @@ -1,12 +0,0 @@ -diff -up tcsh-6.15.00/tcsh.man.hist-sub tcsh-6.15.00/tcsh.man ---- tcsh-6.15.00/tcsh.man.hist-sub 2007-03-03 21:01:26.000000000 +0100 -+++ tcsh-6.15.00/tcsh.man 2008-08-29 12:29:47.000000000 +0200 -@@ -1035,7 +1035,7 @@ Substitute \fIl\fR for \fIr\fR. - \fIl\fR is simply a string like \fIr\fR, not a regular expression as in - the eponymous \fIed\fR(1) command. - Any character may be used as the delimiter in place of `/'; --a `\\' can be used to quote the delimiter inside \fIl\fR and \fIr\fR. -+a `\\' can be used to quote the delimiter expect `(', `)', `|' and `>' inside \fIl\fR and \fIr\fR. - The character `&' in the \fIr\fR is replaced by \fIl\fR; `\\' also quotes `&'. - If \fIl\fR is empty (``''), the \fIl\fR from a previous substitution or the - \fIs\fR from a previous search or event number in event specification is used. diff --git a/tcsh-6.17.00-manpage-spelling.patch b/tcsh-6.17.00-manpage-spelling.patch deleted file mode 100644 index 76026a6..0000000 --- a/tcsh-6.17.00-manpage-spelling.patch +++ /dev/null @@ -1,36 +0,0 @@ -From 76da82e1683c7b7f000081c4759ff4b742bf95f0 Mon Sep 17 00:00:00 2001 -From: "Vojtech Vitek (V-Teq)" -Date: Sat, 29 Oct 2011 21:18:34 +0200 -Subject: [PATCH] Fix minor man page spelling mistakes - -Changes proposed by John Bradshaw. -rhbz#675137 ---- - tcsh.man | 4 ++-- - 1 files changed, 2 insertions(+), 2 deletions(-) - -diff --git a/tcsh.man b/tcsh.man -index e44e2c2..309071c 100644 ---- a/tcsh.man -+++ b/tcsh.man -@@ -1718,7 +1718,7 @@ rather than to the file to which the link points (+) * - see if it has the specified relationship to the real user. If \fIfile\fR - does not exist or is inaccessible or, for the operators indicated by `*', - if the specified file type does not exist on the current system, --then all enquiries return false, i.e., `0'. -+then all inquiries return false, i.e., `0'. - .PP - These operators may be combined for conciseness: `\-\fIxy file\fR' is - equivalent to `\-\fIx file\fR && \-\fIy file\fR'. (+) For example, `\-fx' is true -@@ -3555,7 +3555,7 @@ whenever the environment variable changes the shell changes the corresponding - shell variable to match (unless the shell variable is read-only) and vice - versa. Note that although \fBcwd\fR and \fBPWD\fR have identical meanings, they - are not synchronized in this manner, and that the shell automatically --interconverts the different formats of \fBpath\fR and \fBPATH\fR. -+converts between the different formats of \fBpath\fR and \fBPATH\fR. - .TP 8 - .B addsuffix \fR(+) - If set, filename completion adds `/' to the end of directories and a space --- -1.7.6.2 - diff --git a/tcsh-6.18.01-elf-interpreter.patch b/tcsh-6.18.01-elf-interpreter.patch deleted file mode 100644 index 571f003..0000000 --- a/tcsh-6.18.01-elf-interpreter.patch +++ /dev/null @@ -1,223 +0,0 @@ -diff -upr tcsh-6.18.01_orig/config.h.in tcsh-6.18.01_work/config.h.in ---- tcsh-6.18.01_orig/config.h.in 2013-04-23 14:10:52.181655679 +0200 -+++ tcsh-6.18.01_work/config.h.in 2013-04-23 14:14:33.715035808 +0200 -@@ -36,6 +36,9 @@ - /* Define to 1 if you have the `dup2' function. */ - #undef HAVE_DUP2 - -+/* Define to 1 if you have the header file. */ -+#undef HAVE_ELF_H -+ - /* Define to 1 if you have the header file. */ - #undef HAVE_FEATURES_H - -@@ -96,6 +99,9 @@ - /* Define to 1 if you have the header file. */ - #undef HAVE_PATHS_H - -+/* Define to 1 if you have the `pread' function. */ -+#undef HAVE_PREAD -+ - /* Define to 1 if you have the `sbrk' function. */ - #undef HAVE_SBRK - -diff -upr tcsh-6.18.01_orig/configure.in tcsh-6.18.01_work/configure.in ---- tcsh-6.18.01_orig/configure.in 2013-04-23 14:10:52.157655645 +0200 -+++ tcsh-6.18.01_work/configure.in 2013-04-23 14:13:53.226958044 +0200 -@@ -306,7 +306,7 @@ AC_SEARCH_LIBS(catgets, catgets) - AM_ICONV - - dnl Checks for header files --AC_CHECK_HEADERS([auth.h crypt.h features.h inttypes.h paths.h] dnl -+AC_CHECK_HEADERS([auth.h crypt.h elf.h features.h inttypes.h paths.h] dnl - [shadow.h stdint.h utmp.h utmpx.h]) - AC_CHECK_HEADERS([wchar.h], - [AC_CHECK_SIZEOF([wchar_t], [], [dnl -@@ -388,7 +388,8 @@ AC_CHECK_FUNC([setlocale], [have_setloca - AC_CHECK_FUNC([catgets], [have_catgets=yes], [have_catgets=no]) - AC_CHECK_FUNCS([dup2 getauthid getcwd gethostname getpwent] dnl - [getutent getutxent mallinfo memmove memset mkstemp nice] dnl -- [nl_langinfo sbrk setpgid setpriority strerror strstr sysconf wcwidth]) -+ [nl_langinfo pread sbrk setpgid setpriority strerror strstr] dnl -+ [sysconf wcwidth]) - AC_FUNC_GETPGRP - AC_FUNC_MBRTOWC - if test "x${cross_compiling}" != xyes ; then -diff -upr tcsh-6.18.01_orig/sh.err.c tcsh-6.18.01_work/sh.err.c ---- tcsh-6.18.01_orig/sh.err.c 2013-04-23 14:10:52.160655649 +0200 -+++ tcsh-6.18.01_work/sh.err.c 2013-04-23 14:15:33.347155943 +0200 -@@ -189,7 +189,8 @@ char *seterr = NULL; /* Holds last err - #define ERR_INVALID 133 - #define ERR_BADCOLORVAR 134 - #define ERR_EOF 135 --#define NO_ERRORS 136 -+#define ERR_ELFINTERP 136 -+#define NO_ERRORS 137 - - static const char *elst[NO_ERRORS] INIT_ZERO_STRUCT; - -@@ -367,6 +368,7 @@ errinit(void) - elst[ERR_BADJOB] = CSAVS(1, 136, "No such job (badjob)"); - elst[ERR_BADCOLORVAR] = CSAVS(1, 137, "Unknown colorls variable `%c%c'"); - elst[ERR_EOF] = CSAVS(1, 138, "Unexpected end of file"); -+ elst[ERR_ELFINTERP] = CSAVS(1, 139, "No such ELF interpreter"); - } - - /* Cleanup data. */ -diff -upr tcsh-6.18.01_orig/sh.exec.c tcsh-6.18.01_work/sh.exec.c ---- tcsh-6.18.01_orig/sh.exec.c 2013-04-23 14:10:52.156655643 +0200 -+++ tcsh-6.18.01_work/sh.exec.c 2013-04-23 14:35:43.561578622 +0200 -@@ -40,6 +40,10 @@ RCSID("$tcsh: sh.exec.c,v 3.79 2011/02/2 - #include - #endif /*WINNT_NATIVE*/ - -+#ifdef HAVE_ELF_H -+#include -+#endif /*HAVE_ELF_H*/ -+ - /* - * C shell - */ -@@ -509,6 +513,142 @@ texec(Char *sf, Char **st) - case 0: /* execv fails and returns 0! */ - #endif /* _IBMR2 */ - case ENOENT: -+#ifdef HAVE_ELF_H -+ /* -+ * If dynamically linked ELF binary is not executed and exists, -+ * the real reason ENOENT is that ELF interpreter is missing. -+ * -+ * Written by Ulrich Drepper for bash -+ * adopted by Fridolin Pokorny -+ */ -+ if ((fd = xopen(f, O_RDONLY|O_LARGEFILE)) != -1) { -+ int nread; -+ char *sample; -+ int offset = -1; -+ int sample_size; -+ -+ /* Inspect 32 and 64 ELF */ -+ if (sizeof(Elf64_Ehdr) > sizeof(Elf32_Ehdr)) -+ sample_size = sizeof(Elf64_Ehdr); -+ else -+ sample_size = sizeof(Elf32_Ehdr); -+ -+ sample = xmalloc(sample_size); -+ -+ if (sample != 0 && -+ (nread = xread(fd, sample, sample_size)) == sample_size) { -+ if (memcmp(sample, ELFMAG, SELFMAG) == 0) { -+ if (sample[EI_CLASS] == ELFCLASS32 && -+ sample_size >= sizeof(Elf32_Ehdr)) { -+ Elf32_Ehdr ehdr; -+ Elf32_Phdr *phdr; -+ int nphdr; -+ -+ /* -+ * We have to copy the data since the sample buffer -+ * might not be aligned correctly to be accessed as -+ * an Elf32_Ehdr struct. -+ */ -+ memcpy(&ehdr, sample, sizeof(Elf32_Ehdr)); -+ -+ nphdr = ehdr.e_phnum; -+ phdr = xmalloc(nphdr * ehdr.e_phentsize); -+ if(phdr != NULL) { -+#ifdef HAVE_PREAD -+ nread = pread(fd, phdr, nphdr * ehdr.e_phentsize, -+ ehdr.e_phoff); -+#else /* !HAVE_PREAD */ -+ if (lseek(fd, ehdr.e_phoff, SEEK_SET) != -1) -+ nread = read(fd, phdr, -+ nphdr * ehdr.e_phentsize); -+ else -+ nread = -1; -+#endif /* HAVE_PREAD */ -+ if (nread == nphdr * ehdr.e_phentsize) { -+ while (nphdr-- > 0) { -+ if (phdr[nphdr].p_type == PT_INTERP) { -+ offset = phdr[nphdr].p_offset; -+ break; -+ } -+ } -+ } -+ xfree(phdr); -+ } -+ } else if (sample[EI_CLASS] == ELFCLASS64 && -+ sample_size >= sizeof(Elf64_Ehdr)) { -+ Elf64_Ehdr ehdr; -+ Elf64_Phdr *phdr; -+ int nphdr; -+ -+ /* -+ * We have to copy the data since the sample buffer -+ * might not be aligned correctly to be accessed as -+ * an Elf64_Ehdr struct. -+ */ -+ memcpy(&ehdr, sample, sizeof(Elf64_Ehdr)); -+ -+ nphdr = ehdr.e_phnum; -+ phdr = xmalloc(nphdr * ehdr.e_phentsize); -+ if (phdr != NULL) { -+#ifdef HAVE_PREAD -+ nread = pread (fd, phdr, nphdr * ehdr.e_phentsize, -+ ehdr.e_phoff); -+#else /* !HAVE_PREAD */ -+ if (lseek(fd, ehdr.e_phoff, SEEK_SET) != -1) -+ nread = read (fd, phdr, -+ nphdr * ehdr.e_phentsize); -+ else -+ nread = -1; -+#endif /* HAVE_PREAD */ -+ if (nread == nphdr * ehdr.e_phentsize) { -+ while (nphdr-- > 0) { -+ if (phdr[nphdr].p_type == PT_INTERP) { -+ offset = phdr[nphdr].p_offset; -+ break; -+ } -+ } -+ } -+ xfree (phdr); -+ } -+ } -+ -+ if (offset != -1) { -+ size_t maxlen = 0; -+ size_t actlen = 0; -+ char *interp = NULL; -+ -+ do { -+ if (actlen == maxlen) { -+ char *newinterp = xrealloc(interp, maxlen += 200); -+ if (newinterp == NULL) { -+ actlen = 0; -+ break; -+ } -+ interp = newinterp; -+#ifdef HAVE_PREAD -+ actlen = pread (fd, interp, maxlen, offset); -+#else /* !HAVE_PREAD */ -+ if (lseek (fd, offset, SEEK_SET) != -1) -+ actlen = read (fd, interp, maxlen); -+ else -+ actlen = -1; -+#endif /* HAVE_PREAD */ -+ } -+ } while (actlen > 0 && -+ memchr (interp, '\0', actlen) == NULL); -+ -+ if (actlen > 0) { -+ xclose (fd); -+ xfree (interp); -+ setname(f); -+ stderror(ERR_NAME | ERR_ELFINTERP); -+ } -+ } -+ } -+ } -+ xfree(sample); -+ } -+#endif /* HAVE_ELF_H */ - break; - - default: diff --git a/tcsh-6.18.01-posix-exit-status-value.patch b/tcsh-6.18.01-posix-exit-status-value.patch deleted file mode 100644 index 616b9a3..0000000 --- a/tcsh-6.18.01-posix-exit-status-value.patch +++ /dev/null @@ -1,105 +0,0 @@ -diff --git a/sh.c b/sh.c -index f897317..322a5c6 100644 ---- a/sh.c -+++ b/sh.c -@@ -351,8 +351,6 @@ main(int argc, char **argv) - PRCHROOT = '#'; /* likewise for root */ - word_chars = STR_WORD_CHARS; - bslash_quote = 0; /* PWP: do tcsh-style backslash quoting? */ -- anyerror = 1; /* for compatibility */ -- setcopy(STRanyerror, STRNULL, VAR_READWRITE); - - /* Default history size to 100 */ - setcopy(STRhistory, str2short("100"), VAR_READWRITE); -diff --git a/sh.h b/sh.h -index 4e3f13c..7d31db9 100644 ---- a/sh.h -+++ b/sh.h -@@ -596,7 +596,7 @@ EXTERN int havhash IZERO; /* path hashing is available */ - 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; /* POSIX-like error $status behaviour */ - 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 f2356d1..4e814f8 100644 ---- a/sh.proc.c -+++ b/sh.proc.c -@@ -558,9 +558,9 @@ pjwait(struct process *pp) - reason = 0; - fp = pp; - do { -- /* In case of pipelines only the result of the last -- * command should be taken in account */ -- if (!anyerror && !(fp->p_flags & PBRACE) -+ /* In case of POSIX-like behaviour, only the result of the last -+ * command in pipeline/backq should be taken in account */ -+ if (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 0f98a2b..763a1dc 100644 ---- a/sh.set.c -+++ b/sh.set.c -@@ -106,8 +106,8 @@ update_vars(Char *vp) - else if (eq(vp, STRloginsh)) { - loginsh = 1; - } -- 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); -@@ -766,8 +766,8 @@ unset(Char **v, struct command *c) - HistLit = 0; - if (adrof(STRloginsh) == 0) - 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 641e234..4d0c9e3 100644 ---- a/tc.const.c -+++ b/tc.const.c -@@ -43,7 +43,7 @@ Char STRrootdefautologout[] = { '1', '5', '\0' }; - #endif - 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/tcsh.man b/tcsh.man -index 8cc45c8..3470659 100644 ---- a/tcsh.man -+++ b/tcsh.man -@@ -4356,14 +4356,10 @@ Reset to 1 in login shells. - See also \fBloginsh\fR. - .TP 8 - .B status --The status returned by the last command, unless the variable --.B anyerror --is set, and any error in a pipeline or a backquote expansion will be --propagated (this is the default --.B csh --behavior, and the current --.B tcsh --default). If it terminated -+The status of any error in a pipeline or a backquote expansion that is -+propagated as a result `status', unless `tcsh_posix_status' -+variable is set, and only the last command status is taken in account -+(the latter is default behaviour in POSIX-like shells). If it terminated - abnormally, then 0200 is added to the status. Builtin commands - which fail return exit status `1', all other builtin commands - return status `0'. diff --git a/tcsh-6.18.01-repeated-words-man.patch b/tcsh-6.18.01-repeated-words-man.patch deleted file mode 100644 index e27e0d4..0000000 --- a/tcsh-6.18.01-repeated-words-man.patch +++ /dev/null @@ -1,21 +0,0 @@ -diff -upr tcsh-6.18.01_orig/tcsh.man tcsh-6.18.01_work/tcsh.man ---- tcsh-6.18.01_orig/tcsh.man 2013-04-05 16:22:07.299927566 +0200 -+++ tcsh-6.18.01_work/tcsh.man 2013-04-05 16:22:37.885019969 +0200 -@@ -1401,7 +1401,7 @@ The \fBglobstar\fR shell variable can be - a file glob pattern that matches any string of characters including `/', - recursively traversing any existing sub-directories. For example, - `ls **.c' will list all the .c files in the current directory tree. --If used by itself, it will match match zero or more sub-directories -+If used by itself, it will match zero or more sub-directories - (e.g. `ls /usr/include/**/time.h' will list any file named `time.h' - in the /usr/include directory tree; `ls /usr/include/**time.h' will match - any file in the /usr/include directory tree ending in `time.h'; and -@@ -3887,7 +3887,7 @@ with `.' except for `.' and `..' - If set, the `**' and `***' file glob patterns will match any string of - characters including `/' traversing any existing sub-directories. (e.g. - `ls **.c' will list all the .c files in the current directory tree). --If used by itself, it will match match zero or more sub-directories -+If used by itself, it will match zero or more sub-directories - (e.g. `ls /usr/include/**/time.h' will list any file named `time.h' - in the /usr/include directory tree; whereas `ls /usr/include/**time.h' - will match any file in the /usr/include directory tree ending in `time.h'). diff --git a/tcsh-6.18.02-closem.patch b/tcsh-6.18.02-closem.patch new file mode 100644 index 0000000..b74aa04 --- /dev/null +++ b/tcsh-6.18.02-closem.patch @@ -0,0 +1,43 @@ +From 01f488c11ec1666c90a81ae2f968f04a9419b186 Mon Sep 17 00:00:00 2001 +From: vcrhonek +Date: Thu, 24 Jul 2014 15:38:21 +0200 +Subject: [PATCH 1/8] do not close sockets + +orig dist-git commit: f02674e96a7888a7322611b45f6b63a1f5db0fef + +--- + sh.misc.c | 11 +++++++++++ + 1 file changed, 11 insertions(+) + +diff --git a/sh.misc.c b/sh.misc.c +index 32fc47d..a51dc76 100644 +--- a/sh.misc.c ++++ b/sh.misc.c +@@ -257,6 +257,7 @@ void + closem(void) + { + int f, num_files; ++ struct stat st; + + #ifdef NLS_BUGS + #ifdef NLS_CATALOGS +@@ -274,6 +275,16 @@ closem(void) + #ifdef MALLOC_TRACE + && f != 25 + #endif /* MALLOC_TRACE */ ++#ifdef S_ISSOCK ++ /* NSS modules (e.g. Linux nss_ldap) might keep sockets open. ++ * If we close such a socket, both the NSS module and tcsh think ++ * they "own" the descriptor. ++ * ++ * Not closing sockets does not make the cleanup use of closem() ++ * less reliable because tcsh never creates sockets. ++ */ ++ && fstat(f, &st) == 0 && !S_ISSOCK(st.st_mode) ++#endif + ) + { + xclose(f); +-- +1.9.3 + diff --git a/tcsh-6.18.02-elf-interpreter.patch b/tcsh-6.18.02-elf-interpreter.patch new file mode 100644 index 0000000..b1ee117 --- /dev/null +++ b/tcsh-6.18.02-elf-interpreter.patch @@ -0,0 +1,245 @@ +From df1e58586f48f124079fe81ba1361e12cef2eb1c Mon Sep 17 00:00:00 2001 +From: Fridolin Pokorny +Date: Fri, 25 Jul 2014 08:52:25 +0200 +Subject: [PATCH 7/8] Added tcsh-6.18.01-elf-interpreter.patch to report + missing ELF interpreter + +Resolves: #711066 + +--- + config.h.in | 6 +++ + configure.ac | 5 ++- + sh.err.c | 4 +- + sh.exec.c | 140 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + 4 files changed, 152 insertions(+), 3 deletions(-) + +diff --git a/config.h.in b/config.h.in +index 15c916a..0f3a64d 100644 +--- a/config.h.in ++++ b/config.h.in +@@ -36,6 +36,9 @@ + /* Define to 1 if you have the `dup2' function. */ + #undef HAVE_DUP2 + ++/* Define to 1 if you have the header file. */ ++#undef HAVE_ELF_H ++ + /* Define to 1 if you have the header file. */ + #undef HAVE_FEATURES_H + +@@ -96,6 +99,9 @@ + /* Define to 1 if you have the header file. */ + #undef HAVE_PATHS_H + ++/* Define to 1 if you have the `pread' function. */ ++#undef HAVE_PREAD ++ + /* Define to 1 if you have the `sbrk' function. */ + #undef HAVE_SBRK + +diff --git a/configure.ac b/configure.ac +index c6f9f1a..2d2868f 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -316,7 +316,7 @@ AC_SEARCH_LIBS(catgets, catgets) + AM_ICONV + + dnl Checks for header files +-AC_CHECK_HEADERS([auth.h crypt.h features.h inttypes.h paths.h] dnl ++AC_CHECK_HEADERS([auth.h crypt.h elf.h features.h inttypes.h paths.h] dnl + [shadow.h stdint.h utmp.h utmpx.h]) + AC_CHECK_HEADERS([wchar.h], + [AC_CHECK_SIZEOF([wchar_t], [], [dnl +@@ -398,7 +398,8 @@ AC_CHECK_FUNC([setlocale], [have_setlocale=yes], [have_setlocale=no]) + AC_CHECK_FUNC([catgets], [have_catgets=yes], [have_catgets=no]) + AC_CHECK_FUNCS([dup2 getauthid getcwd gethostname getpwent] dnl + [getutent getutxent mallinfo memmove memset mkstemp nice] dnl +- [nl_langinfo sbrk setpgid setpriority strerror strstr sysconf wcwidth]) ++ [nl_langinfo pread sbrk setpgid setpriority strerror strstr] dnl ++ [sysconf wcwidth]) + AC_FUNC_GETPGRP + AC_FUNC_MBRTOWC + if test "x${cross_compiling}" != xyes ; then +diff --git a/sh.err.c b/sh.err.c +index e157d6a..d39111b 100644 +--- a/sh.err.c ++++ b/sh.err.c +@@ -189,7 +189,8 @@ char *seterr = NULL; /* Holds last error if there was one */ + #define ERR_INVALID 133 + #define ERR_BADCOLORVAR 134 + #define ERR_EOF 135 +-#define NO_ERRORS 136 ++#define ERR_ELFINTERP 136 ++#define NO_ERRORS 137 + + static const char *elst[NO_ERRORS] INIT_ZERO_STRUCT; + +@@ -367,6 +368,7 @@ errinit(void) + elst[ERR_BADJOB] = CSAVS(1, 136, "No such job (badjob)"); + elst[ERR_BADCOLORVAR] = CSAVS(1, 137, "Unknown colorls variable `%c%c'"); + elst[ERR_EOF] = CSAVS(1, 138, "Unexpected end of file"); ++ elst[ERR_ELFINTERP] = CSAVS(1, 139, "No such ELF interpreter"); + } + + /* Cleanup data. */ +diff --git a/sh.exec.c b/sh.exec.c +index 14f9445..13a3cdf 100644 +--- a/sh.exec.c ++++ b/sh.exec.c +@@ -40,6 +40,10 @@ RCSID("$tcsh: sh.exec.c,v 3.80 2014/07/11 14:57:55 christos Exp $") + #include + #endif /*WINNT_NATIVE*/ + ++#ifdef HAVE_ELF_H ++#include ++#endif /*HAVE_ELF_H*/ ++ + /* + * C shell + */ +@@ -509,6 +513,142 @@ texec(Char *sf, Char **st) + case 0: /* execv fails and returns 0! */ + #endif /* _IBMR2 */ + case ENOENT: ++#ifdef HAVE_ELF_H ++ /* ++ * If dynamically linked ELF binary is not executed and exists, ++ * the real reason ENOENT is that ELF interpreter is missing. ++ * ++ * Written by Ulrich Drepper for bash ++ * adopted by Fridolin Pokorny ++ */ ++ if ((fd = xopen(f, O_RDONLY|O_LARGEFILE)) != -1) { ++ int nread; ++ char *sample; ++ int offset = -1; ++ int sample_size; ++ ++ /* Inspect 32 and 64 ELF */ ++ if (sizeof(Elf64_Ehdr) > sizeof(Elf32_Ehdr)) ++ sample_size = sizeof(Elf64_Ehdr); ++ else ++ sample_size = sizeof(Elf32_Ehdr); ++ ++ sample = xmalloc(sample_size); ++ ++ if (sample != 0 && ++ (nread = xread(fd, sample, sample_size)) == sample_size) { ++ if (memcmp(sample, ELFMAG, SELFMAG) == 0) { ++ if (sample[EI_CLASS] == ELFCLASS32 && ++ sample_size >= sizeof(Elf32_Ehdr)) { ++ Elf32_Ehdr ehdr; ++ Elf32_Phdr *phdr; ++ int nphdr; ++ ++ /* ++ * We have to copy the data since the sample buffer ++ * might not be aligned correctly to be accessed as ++ * an Elf32_Ehdr struct. ++ */ ++ memcpy(&ehdr, sample, sizeof(Elf32_Ehdr)); ++ ++ nphdr = ehdr.e_phnum; ++ phdr = xmalloc(nphdr * ehdr.e_phentsize); ++ if(phdr != NULL) { ++#ifdef HAVE_PREAD ++ nread = pread(fd, phdr, nphdr * ehdr.e_phentsize, ++ ehdr.e_phoff); ++#else /* !HAVE_PREAD */ ++ if (lseek(fd, ehdr.e_phoff, SEEK_SET) != -1) ++ nread = read(fd, phdr, ++ nphdr * ehdr.e_phentsize); ++ else ++ nread = -1; ++#endif /* HAVE_PREAD */ ++ if (nread == nphdr * ehdr.e_phentsize) { ++ while (nphdr-- > 0) { ++ if (phdr[nphdr].p_type == PT_INTERP) { ++ offset = phdr[nphdr].p_offset; ++ break; ++ } ++ } ++ } ++ xfree(phdr); ++ } ++ } else if (sample[EI_CLASS] == ELFCLASS64 && ++ sample_size >= sizeof(Elf64_Ehdr)) { ++ Elf64_Ehdr ehdr; ++ Elf64_Phdr *phdr; ++ int nphdr; ++ ++ /* ++ * We have to copy the data since the sample buffer ++ * might not be aligned correctly to be accessed as ++ * an Elf64_Ehdr struct. ++ */ ++ memcpy(&ehdr, sample, sizeof(Elf64_Ehdr)); ++ ++ nphdr = ehdr.e_phnum; ++ phdr = xmalloc(nphdr * ehdr.e_phentsize); ++ if (phdr != NULL) { ++#ifdef HAVE_PREAD ++ nread = pread (fd, phdr, nphdr * ehdr.e_phentsize, ++ ehdr.e_phoff); ++#else /* !HAVE_PREAD */ ++ if (lseek(fd, ehdr.e_phoff, SEEK_SET) != -1) ++ nread = read (fd, phdr, ++ nphdr * ehdr.e_phentsize); ++ else ++ nread = -1; ++#endif /* HAVE_PREAD */ ++ if (nread == nphdr * ehdr.e_phentsize) { ++ while (nphdr-- > 0) { ++ if (phdr[nphdr].p_type == PT_INTERP) { ++ offset = phdr[nphdr].p_offset; ++ break; ++ } ++ } ++ } ++ xfree (phdr); ++ } ++ } ++ ++ if (offset != -1) { ++ size_t maxlen = 0; ++ size_t actlen = 0; ++ char *interp = NULL; ++ ++ do { ++ if (actlen == maxlen) { ++ char *newinterp = xrealloc(interp, maxlen += 200); ++ if (newinterp == NULL) { ++ actlen = 0; ++ break; ++ } ++ interp = newinterp; ++#ifdef HAVE_PREAD ++ actlen = pread (fd, interp, maxlen, offset); ++#else /* !HAVE_PREAD */ ++ if (lseek (fd, offset, SEEK_SET) != -1) ++ actlen = read (fd, interp, maxlen); ++ else ++ actlen = -1; ++#endif /* HAVE_PREAD */ ++ } ++ } while (actlen > 0 && ++ memchr (interp, '\0', actlen) == NULL); ++ ++ if (actlen > 0) { ++ xclose (fd); ++ xfree (interp); ++ setname(f); ++ stderror(ERR_NAME | ERR_ELFINTERP); ++ } ++ } ++ } ++ } ++ xfree(sample); ++ } ++#endif /* HAVE_ELF_H */ + break; + + default: +-- +1.9.3 + diff --git a/tcsh-6.18.02-fixgencat.patch b/tcsh-6.18.02-fixgencat.patch new file mode 100644 index 0000000..0fa4bfb --- /dev/null +++ b/tcsh-6.18.02-fixgencat.patch @@ -0,0 +1,42 @@ +From 8823bf92219d04aa0934abab530fdcf6f18b06bb Mon Sep 17 00:00:00 2001 +From: Pavel Raiskup +Date: Fri, 25 Jul 2014 15:10:50 +0200 +Subject: [PATCH] fix gencat wrapper for LANG=C + +Sorting sets including 'charset' file caused that the file was on +concatenated as the last one which causes build fail when current +locale charset is non-utf8. + +Also avoid generating temporary files for security reasons. +--- + nls/catgen | 10 +++++----- + 1 file changed, 5 insertions(+), 5 deletions(-) + +diff --git a/nls/catgen b/nls/catgen +index 40e652f..f5f0313 100755 +--- a/nls/catgen ++++ b/nls/catgen +@@ -1,7 +1,5 @@ + #!/bin/sh + # Wrapper for gencat +-TMP=/tmp/catgen.$$ +-trap "rm -f $TMP" 0 1 2 3 15 + + sortit() { + awk '/^\$set/ {print $2, FILENAME}' "$@" | sort -n | cut -d ' ' -f 2 +@@ -11,7 +9,9 @@ GENCAT="$1" + shift + OUT="$1" + shift +-cat $(sortit "$@") > "$TMP" ++CHARSET="$1" ++shift + +-echo "$(basename "$OUT" .cat)" +-"${GENCAT}" "$OUT" "$TMP" ++echo " gencat $OUT" ++cat $CHARSET $(sortit "$@") | "${GENCAT}" "$OUT" - ++exit 0 +-- +1.9.3 + diff --git a/tcsh-6.18.02-hist-sub.patch b/tcsh-6.18.02-hist-sub.patch new file mode 100644 index 0000000..4d43ca5 --- /dev/null +++ b/tcsh-6.18.02-hist-sub.patch @@ -0,0 +1,26 @@ +From 06fffcb267c34a7049078d113005f1cce4f1766f Mon Sep 17 00:00:00 2001 +From: Vitezslav Crhonek +Date: Mon, 28 Jul 2014 13:27:16 +0200 +Subject: [PATCH] Fix '\' can not be used to quote all delimiters + +Related: #435421 +--- + tcsh.man | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/tcsh.man b/tcsh.man +index 94de311..6a7bd48 100644 +--- a/tcsh.man ++++ b/tcsh.man +@@ -1047,7 +1047,7 @@ Substitute \fIl\fR for \fIr\fR. + \fIl\fR is simply a string like \fIr\fR, not a regular expression as in + the eponymous \fIed\fR(1) command. + Any character may be used as the delimiter in place of `/'; +-a `\e' can be used to quote the delimiter inside \fIl\fR and \fIr\fR. ++a `\e' can be used to quote the delimiter expect `(', `)', `|' and `>' inside \fIl\fR and \fIr\fR. + The character `&' in the \fIr\fR is replaced by \fIl\fR; `\e' also quotes `&'. + If \fIl\fR is empty (``''), the \fIl\fR from a previous substitution or the + \fIs\fR from a previous search or event number in event specification is used. +-- +1.9.3 + diff --git a/tcsh-6.18.02-memoryuse.patch b/tcsh-6.18.02-memoryuse.patch new file mode 100644 index 0000000..4fca155 --- /dev/null +++ b/tcsh-6.18.02-memoryuse.patch @@ -0,0 +1,27 @@ +From 98c8c0f15673523cfb0e2d26d04b58e445f185e8 Mon Sep 17 00:00:00 2001 +From: "Vojtech Vitek (V-Teq)" +Date: Thu, 15 Mar 2012 02:21:37 +0100 +Subject: [PATCH 5/8] Add memoryuse note in manpage regarding kernel 2.6 and + higher + +--- + tcsh.man | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +diff --git a/tcsh.man b/tcsh.man +index cea5d45..91f6b93 100644 +--- a/tcsh.man ++++ b/tcsh.man +@@ -2944,7 +2944,8 @@ the size of the largest core dump that will be created + .TP + \fImemoryuse\fR + the maximum amount of physical memory a process +-may have allocated to it at a given time ++may have allocated to it at a given time (this is not implemented in the 2.6+ kernel, ++so there is no effect introduced by changing this value) + .TP + \fIvmemoryuse\fR + the maximum amount of virtual memory a process +-- +1.9.3 + diff --git a/tcsh-6.18.02-order.patch b/tcsh-6.18.02-order.patch new file mode 100644 index 0000000..b4fc0fa --- /dev/null +++ b/tcsh-6.18.02-order.patch @@ -0,0 +1,28 @@ +From 2f2cdbb8e1f43b7dcc5a0d56ac19909f11f3ccad Mon Sep 17 00:00:00 2001 +From: vcrhonek +Date: Fri, 25 Jul 2014 08:40:59 +0200 +Subject: [PATCH 6/8] Fix calculation order of operators description in tcsh + manpage + +--- + tcsh.man | 4 +++- + 1 file changed, 3 insertions(+), 1 deletion(-) + +diff --git a/tcsh.man b/tcsh.man +index 91f6b93..94de311 100644 +--- a/tcsh.man ++++ b/tcsh.man +@@ -1645,7 +1645,9 @@ They include + .PP + Here the precedence increases to the right, `==' `!=' `=~' and `!~', `<=' + `>=' `<' and `>', `<<' and `>>', `+' and `\-', `*' `/' and `%' being, in +-groups, at the same level. The `==' `!=' `=~' and `!~' operators compare ++groups, at the same level. When multiple operators which have same precedence ++are used in one expression, calculation must be done from operator of right ++side. The `==' `!=' `=~' and `!~' operators compare + their arguments as strings; all others operate on numbers. The operators + `=~' and `!~' are like `!=' and `==' except that the right hand side is a + glob-pattern (see \fBFilename substitution\fR) against which the left hand +-- +1.9.3 + diff --git a/tcsh-6.18.02-posix-exit-status-value.patch b/tcsh-6.18.02-posix-exit-status-value.patch new file mode 100644 index 0000000..581e825 --- /dev/null +++ b/tcsh-6.18.02-posix-exit-status-value.patch @@ -0,0 +1,124 @@ +From cf6b60106ad8cf3e058cda48249d6379dab3a846 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Jarom=C3=ADr=20Kon=C4=8Dick=C3=BD?= +Date: Fri, 25 Jul 2014 11:41:22 +0200 +Subject: [PATCH 8/8] Changed 'anyerror' variable to 'tcsh_posix_status' + +(with opposite meaning) + +--- + sh.c | 2 -- + sh.h | 2 +- + sh.proc.c | 6 +++--- + sh.set.c | 8 ++++---- + tc.const.c | 2 +- + tcsh.man | 12 ++++-------- + 6 files changed, 13 insertions(+), 19 deletions(-) + +diff --git a/sh.c b/sh.c +index 518d610..a9235b0 100644 +--- a/sh.c ++++ b/sh.c +@@ -350,8 +350,6 @@ main(int argc, char **argv) + PRCHROOT = '#'; /* likewise for root */ + word_chars = STR_WORD_CHARS; + bslash_quote = 0; /* PWP: do tcsh-style backslash quoting? */ +- anyerror = 1; /* for compatibility */ +- setcopy(STRanyerror, STRNULL, VAR_READWRITE); + + /* Default history size to 100 */ + setcopy(STRhistory, str2short("100"), VAR_READWRITE); +diff --git a/sh.h b/sh.h +index 503da25..273751a 100644 +--- a/sh.h ++++ b/sh.h +@@ -562,7 +562,7 @@ EXTERN int havhash IZERO; /* path hashing is available */ + 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; /* POSIX-like error $status behaviour */ + 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 afcf0b9..ef25400 100644 +--- a/sh.proc.c ++++ b/sh.proc.c +@@ -559,9 +559,9 @@ pjwait(struct process *pp) + reason = 0; + fp = pp; + do { +- /* In case of pipelines only the result of the last +- * command should be taken in account */ +- if (!anyerror && !(fp->p_flags & PBRACE) ++ /* In case of POSIX-like behaviour, only the result of the last ++ * command in pipeline/backq should be taken in account */ ++ if (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 b2c44b1..c740d6a 100644 +--- a/sh.set.c ++++ b/sh.set.c +@@ -106,8 +106,8 @@ update_vars(Char *vp) + else if (eq(vp, STRloginsh)) { + loginsh = 1; + } +- 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); +@@ -769,8 +769,8 @@ unset(Char **v, struct command *c) + HistLit = 0; + if (adrof(STRloginsh) == 0) + 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 e49f05a..1361da7 100644 +--- a/tc.const.c ++++ b/tc.const.c +@@ -43,7 +43,7 @@ Char STRrootdefautologout[] = { '1', '5', '\0' }; + #endif + 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/tcsh.man b/tcsh.man +index 94de311..c10655b 100644 +--- a/tcsh.man ++++ b/tcsh.man +@@ -4383,14 +4383,10 @@ Reset to 1 in login shells. + See also \fBloginsh\fR. + .TP 8 + .B status +-The status returned by the last command, unless the variable +-.B anyerror +-is set, and any error in a pipeline or a backquote expansion will be +-propagated (this is the default +-.B csh +-behavior, and the current +-.B tcsh +-default). If it terminated ++The status of any error in a pipeline or a backquote expansion that is ++propagated as a result `status', unless `tcsh_posix_status' ++variable is set, and only the last command status is taken in account ++(the latter is default behaviour in POSIX-like shells). If it terminated + abnormally, then 0200 is added to the status. Builtin commands + which fail return exit status `1', all other builtin commands + return status `0'. +-- +1.9.3 + diff --git a/tcsh-6.18.02-syntax.patch b/tcsh-6.18.02-syntax.patch new file mode 100644 index 0000000..eac52fd --- /dev/null +++ b/tcsh-6.18.02-syntax.patch @@ -0,0 +1,60 @@ +From 182f5748ef86df48710a58e48567fee61b822e6e Mon Sep 17 00:00:00 2001 +From: vcrhonek +Date: Thu, 24 Jul 2014 17:45:18 +0200 +Subject: [PATCH 4/8] while loop counting + +Fix tcsh scripts with multiple case statement with end keywords +break with error. + +TODO: This patch reverts upstream commit a973723e from 2004-05-13. +We should make sure that this is going to be fixed properly +upstream. + +Resolves: #253247 +original dist-git commit: 1bcd8ea591286664483d0aea2601a8729eb6b81f + +--- + sh.func.c | 13 ------------- + 1 file changed, 13 deletions(-) + +diff --git a/sh.func.c b/sh.func.c +index 3e4d576..6afdd01 100644 +--- a/sh.func.c ++++ b/sh.func.c +@@ -754,8 +754,6 @@ search(int type, int level, Char *goal) + { + struct Strbuf word = Strbuf_INIT; + Char *cp; +- struct whyle *wp; +- int wlevel = 0; + struct wordent *histent = NULL, *ohistent = NULL; + + Stype = type; +@@ -821,24 +819,13 @@ search(int type, int level, Char *goal) + + case TC_FOREACH: + case TC_WHILE: +- wlevel++; + if (type == TC_BREAK) + level++; + break; + + case TC_END: +- if (type == TC_BRKSW) { +- if (wlevel == 0) { +- wp = whyles; +- if (wp) { +- whyles = wp->w_next; +- wpfree(wp); +- } +- } +- } + if (type == TC_BREAK) + level--; +- wlevel--; + break; + + case TC_SWITCH: +-- +1.9.3 + diff --git a/tcsh-6.18.02-tinfo.patch b/tcsh-6.18.02-tinfo.patch new file mode 100644 index 0000000..27c813f --- /dev/null +++ b/tcsh-6.18.02-tinfo.patch @@ -0,0 +1,26 @@ +From 47569471c7eb70964ee61e9c38ce45b0f2c206ae Mon Sep 17 00:00:00 2001 +From: "Vojtech Vitek (V-Teq)" +Date: Thu, 15 Mar 2012 02:10:35 +0100 +Subject: [PATCH 2/8] Search for tinfo library instead of termcap/(n)curses + etc. + +--- + configure.ac | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/configure.ac b/configure.ac +index d07b944..c6f9f1a 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -309,7 +309,7 @@ fi + dnl Checks for libraries + AC_SEARCH_LIBS(crypt, crypt) + AC_SEARCH_LIBS(getspnam, sec) +-AC_SEARCH_LIBS(tgetent, termlib termcap curses ncurses) ++AC_SEARCH_LIBS(tgetent, tinfo) + AC_SEARCH_LIBS(gethostbyname, nsl) + AC_SEARCH_LIBS(connect, socket) + AC_SEARCH_LIBS(catgets, catgets) +-- +1.9.3 + diff --git a/tcsh-6.18.02-unprintable.patch b/tcsh-6.18.02-unprintable.patch new file mode 100644 index 0000000..57a85ad --- /dev/null +++ b/tcsh-6.18.02-unprintable.patch @@ -0,0 +1,28 @@ +From 1889ef9407bbe8e3db1f4b88d1bc437b31a7d8d0 Mon Sep 17 00:00:00 2001 +From: vcrhonek +Date: Thu, 24 Jul 2014 17:37:45 +0200 +Subject: [PATCH 3/8] fix unprintable (#233525) + +original dist-git commit: cd7e072c + +--- + tw.parse.c | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +diff --git a/tw.parse.c b/tw.parse.c +index 186fdb5..8af3c50 100644 +--- a/tw.parse.c ++++ b/tw.parse.c +@@ -2169,7 +2169,8 @@ print_by_column(Char *dir, Char *items[], int count, int no_file_suffix) + (Strchr(val, 'x') != NULL); + + for (i = 0; i < count; i++) { /* find widest string */ +- maxwidth = max(maxwidth, (unsigned int) NLSStringWidth(items[i])); ++ if (NLSStringWidth(items[i]) != -1) ++ maxwidth = max(maxwidth, (unsigned int) NLSStringWidth(items[i])); + } + + maxwidth += no_file_suffix ? 1 : 2; /* for the file tag and space */ +-- +1.9.3 + diff --git a/tcsh.spec b/tcsh.spec index 46eb83f..68b1879 100644 --- a/tcsh.spec +++ b/tcsh.spec @@ -1,29 +1,29 @@ Summary: An enhanced version of csh, the C shell Name: tcsh -Version: 6.18.01 -Release: 10%{?dist} +Version: 6.18.02 +Release: 1%{?dist} License: BSD Group: System Environment/Shells Source: http://ftp.funet.fi/pub/unix/shells/tcsh/%{name}-%{version}.tar.gz -Patch1: tcsh-6.15.00-closem.patch -Patch2: tcsh-6.14.00-tinfo.patch -Patch3: tcsh-6.14.00-unprintable.patch -Patch4: tcsh-6.15.00-hist-sub.patch -Patch8: tcsh-6.14.00-syntax.patch -Patch9: tcsh-6.13.00-memoryuse.patch -Patch11: tcsh-6.14.00-order.patch -# Proposed upstream - http://github.com/tcsh-org/tcsh/pull/1 -Patch28: tcsh-6.17.00-manpage-spelling.patch + +# Those patches here should be in git format and are commented inside. + +Patch1: tcsh-6.18.02-closem.patch +Patch2: tcsh-6.18.02-tinfo.patch +Patch3: tcsh-6.18.02-unprintable.patch +Patch4: tcsh-6.18.02-syntax.patch +Patch5: tcsh-6.18.02-memoryuse.patch +Patch6: tcsh-6.18.02-order.patch +Patch7: tcsh-6.18.02-fixgencat.patch +Patch8: tcsh-6.18.02-hist-sub.patch +Patch9: tcsh-6.18.02-elf-interpreter.patch +Patch10: tcsh-6.18.02-posix-exit-status-value.patch + +# TODO: review better upstream file locking # Proposed upstream - http://github.com/tcsh-org/tcsh/pull/2 -Patch31: tcsh-6.18.00-history-file-locking.patch -# Accepted upstream - http://mx.gw.com/pipermail/tcsh-bugs/2012-December/000797.html -#Patch32: tcsh-6.18.00-sigint-while-waiting-for-child.patch -Patch33: tcsh-6.18.00-history-merge.patch -Patch34: tcsh-6.18.01-repeated-words-man.patch -# Proposed upstream - http://mx.gw.com/pipermail/tcsh-bugs/2013-April/000833.html -Patch35: tcsh-6.18.01-elf-interpreter.patch -Patch36: tcsh-6.18.01-posix-exit-status-value.patch -Patch37: tcsh-6.18.01-reverse-history-handling-in-loops.patch +# Patch31: tcsh-6.18.00-history-file-locking.patch +# Patch33: tcsh-6.18.00-history-merge.patch +# Patch37: tcsh-6.18.01-reverse-history-handling-in-loops.patch Provides: csh = %{version} Provides: /bin/tcsh, /bin/csh @@ -42,35 +42,18 @@ spelling correction, a history mechanism, job control and a C language like syntax. %prep -%setup -q -n %{name}-%{version} -%patch1 -p1 -b .closem -%patch2 -p1 -b .tinfo -%patch3 -p1 -b .unprintable -%patch4 -p1 -b .hist-sub -%patch8 -p1 -b .syntax -%patch9 -p1 -b .memoryuse -%patch11 -p1 -b .order -%patch28 -p1 -b .manpage-spelling -%patch31 -p1 -b .history-file-locking -#%%patch32 -p1 -b .sigint-while-waiting-for-child -%patch33 -p1 -b .history-merge -%patch34 -p1 -b .repeated-words-man -%patch35 -p1 -b .elf-interpreter -%patch36 -p1 -b .posix-exit-status-value -%patch37 -p1 -b .reverse-history-handling-in-loops +%autosetup -p1 for i in Fixes WishList; do iconv -f iso-8859-1 -t utf-8 "$i" > "${i}_" && \ touch -r "$i" "${i}_" && \ mv "${i}_" "$i" done +autoreconf %build -# For tcsh-6.14.00-tinfo.patch -autoreconf %configure --without-hesiod -make %{?_smp_mflags} all -make %{?_smp_mflags} -C nls catalogs +make %{?_smp_mflags} %install rm -rf $RPM_BUILD_ROOT @@ -102,6 +85,9 @@ ru russian uk ukrainian _EOF +%check +make check + %clean rm -rf $RPM_BUILD_ROOT @@ -131,6 +117,9 @@ fi %{_mandir}/man1/*.1* %changelog +* Thu Jul 24 2014 Pavel Raiskup - 6.18.02-1 +- rebase to most recent upstream version (beta, prepare for 6.19) + * Sun Jun 08 2014 Fedora Release Engineering - 6.18.01-10 - Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild -- cgit