From cdd610770f8589736caa388452fbd24ff4d00afdc039606f9522e9563a667b1f Mon Sep 17 00:00:00 2001 From: "Dr. Werner Fink" Date: Tue, 9 Apr 2019 07:33:31 +0000 Subject: [PATCH] bsc#1129112 OBS-URL: https://build.opensuse.org/package/show/shells/tcsh?expand=0&rev=75 --- complete.tcsh | 2 ++ tcsh-6.20.00-postcmd.patch | 54 ++++++++++++++++++++++++++++++++++++++ tcsh-6.20.00.dif | 44 +++++++++++++++++++++---------- tcsh.changes | 6 +++++ tcsh.spec | 5 +++- 5 files changed, 96 insertions(+), 15 deletions(-) create mode 100644 tcsh-6.20.00-postcmd.patch diff --git a/complete.tcsh b/complete.tcsh index 717f742..18a9c94 100644 --- a/complete.tcsh +++ b/complete.tcsh @@ -444,6 +444,8 @@ skip_mh: complete acroread 'p/*/f:*.{pdf,fdf,PDF,FDF}/' complete xpdf 'p/*/f:*.{pdf,fdf,PDF,FDF}/' complete kpdf 'p/*/f:*.{pdf,fdf,PDF,FDF}/' + complete qpdf 'p/*/f:*.{pdf,fdf,PDF,FDF}/' + complete evince 'p/*/f:*.{pdf,fdf,PDF,FDF}/' complete apachectl 'c/*/(start stop restart fullstatus status graceful \ configtest help)/' complete appletviewer 'p/*/f:*.class/' diff --git a/tcsh-6.20.00-postcmd.patch b/tcsh-6.20.00-postcmd.patch new file mode 100644 index 0000000..ada2298 --- /dev/null +++ b/tcsh-6.20.00-postcmd.patch @@ -0,0 +1,54 @@ +https://bugs.astron.com/view.php?id=74#c3238 + +Avoid trouble with e.g. + + alias postcmd false + set counter=1 + while ($counter > ) + @ counter-- + echo $counter + end + +and similar scriptlets, maybe there is a better solution to +protect dowhile(), nevertheless this works. + +--- + tcsh-6.20.00/sh.c | 13 +++++++++++-- + 1 file changed, 11 insertions(+), 2 deletions(-) + +--- tcsh-6.20.00/sh.c 2017-07-19 12:29:15.512471750 +0200 ++++ tcsh-6.20.00/sh.c 2019-04-08 13:35:32.462771640 +0200 +@@ -2028,6 +2028,7 @@ process(int catch) + getexit(osetexit); + omark = cleanup_push_mark(); + for (;;) { ++ const struct wordent *p; + struct command *t; + int hadhist, old_pintr_disabled; + +@@ -2178,7 +2179,9 @@ process(int catch) + /* + * Parse the words of the input into a parse tree. + */ +- t = syntax(paraml.next, ¶ml, 0); ++ p = paraml.next; ++ t = syntax(p, ¶ml, 0); ++ + /* + * We cannot cleanup push here, because cd /blah; echo foo + * would rewind t on the chdir error, and free the rest of the command +@@ -2188,7 +2191,13 @@ process(int catch) + stderror(ERR_OLD); + } + +- postcmd(); ++ /* ++ * The potential aliasrun() might destroy the parse tree, ++ * that is that the dowhile() would be never reached again. ++ */ ++ if (srchx(p->word) != TC_WHILE) ++ postcmd(); ++ + /* + * Execute the parse tree From: Michael Schroeder + * was execute(t, tpgrp); diff --git a/tcsh-6.20.00.dif b/tcsh-6.20.00.dif index 89ff80f..0d0f92f 100644 --- a/tcsh-6.20.00.dif +++ b/tcsh-6.20.00.dif @@ -1,18 +1,19 @@ --- - config/linux | 10 ++++++++++ - config_f.h | 11 ++++++++--- - configure | 2 +- - configure.ac | 2 +- - glob.h | 3 ++- - pathnames.h | 2 +- - sh.c | 3 +++ - tc.alloc.c | 10 ++++++---- - tc.func.c | 8 ++++++-- - tc.str.c | 2 +- - tc.who.c | 3 +++ - tcsh.man | 2 +- - tw.h | 4 ++++ - 13 files changed, 47 insertions(+), 15 deletions(-) + config/linux | 10 ++++++++++ + config_f.h | 11 ++++++++--- + configure | 2 +- + configure.ac | 2 +- + glob.h | 3 ++- + pathnames.h | 2 +- + sh.c | 3 +++ + tc.alloc.c | 10 ++++++---- + tc.func.c | 8 ++++++-- + tc.str.c | 2 +- + tc.who.c | 3 +++ + tcsh.man | 2 +- + tw.h | 4 ++++ + tests/lexical.at | 4 ++-- + 14 files changed, 49 insertions(+), 17 deletions(-) --- config/linux +++ config/linux 2016-11-25 09:07:12.893851835 +0000 @@ -250,3 +251,18 @@ #define TW_PATH 0x1000 #define TW_ZERO 0x0fff +--- tests/lexical.at ++++ tests/lexical.at 2019-04-08 14:27:27.452829093 +0200 +@@ -567,10 +567,10 @@ run=3 + ]]) + AT_DATA([uniformity_test.csh], + [[ +-set SERVICE_NAME_LOG = `cat batchsystem.properties | grep '^jdbc_url' | sed -ne 's/^[^=]*=[^@]*@[:blank:]*\([^$]*\)$/\1/p' | perl -pe 's/\s//g' | perl -pe 's/\)/\\\)/g' | perl -pe 's/\(/\\\(/g'` ++set SERVICE_NAME_LOG = `cat batchsystem.properties | grep '^jdbc_url' | sed -ne 's/^[^=]*=[^@]*@[[:blank:]]*\([^$]*\)$/\1/p' | perl -pe 's/\s//g' | perl -pe 's/\)/\\\)/g' | perl -pe 's/\(/\\\(/g'` + echo -n "$SERVICE_NAME_LOG" > ./output1 + +-cat batchsystem.properties | grep '^jdbc_url' | sed -ne 's/^[^=]*=[^@]*@[:blank:]*\([^$]*\)$/\1/p' | perl -pe 's/\s//g' | perl -pe 's/\)/\\\)/g' | perl -pe 's/\(/\\\(/g' > ./output2 ++cat batchsystem.properties | grep '^jdbc_url' | sed -ne 's/^[^=]*=[^@]*@[[:blank:]]*\([^$]*\)$/\1/p' | perl -pe 's/\s//g' | perl -pe 's/\)/\\\)/g' | perl -pe 's/\(/\\\(/g' > ./output2 + + diff -uprN ./output1 ./output2 >& /dev/null + diff --git a/tcsh.changes b/tcsh.changes index 407655f..fcceab5 100644 --- a/tcsh.changes +++ b/tcsh.changes @@ -1,3 +1,9 @@ +------------------------------------------------------------------- +Tue Apr 9 07:26:37 UTC 2019 - Dr. Werner Fink + +- Add patch tcsh-6.20.00-postcmd.patch as workaround for bsc#1129112 +- Modify tcsh-6.20.00.dif to fix sed syntax for test case lexical.at + ------------------------------------------------------------------- Wed Jul 19 10:25:40 UTC 2017 - werner@suse.de diff --git a/tcsh.spec b/tcsh.spec index 9507c54..dedf8b0 100644 --- a/tcsh.spec +++ b/tcsh.spec @@ -1,7 +1,7 @@ # # spec file for package tcsh # -# Copyright (c) 2017 SUSE LINUX GmbH, Nuernberg, Germany. +# Copyright (c) 2019 SUSE LINUX GmbH, Nuernberg, Germany. # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -47,6 +47,8 @@ Patch14: tcsh-6.20.00-8bit-cmdkeys.patch Patch15: tcsh-closem.patch # PATCH-FIX-SUSE Aoid dot locking as patch 9 and 11 do the job better Patch16: tcsh-6.20.00-avoid-dotlock-for-fcntl.patch +# PATCH-FIX-SUSE Do not destroy parse tree due set postcmd alias +Patch17: tcsh-6.20.00-postcmd.patch BuildRequires: autoconf BuildRequires: fdupes BuildRequires: ncurses-devel @@ -80,6 +82,7 @@ correction, a history mechanism, job control, and a C-like syntax. %patch14 -p0 -b .8bit %patch15 -p0 -b .nss %patch16 -p0 -b .nodtlck +%patch17 -p1 -b .postcmd %patch0 -b .0 %build