rpms/tcsh/F-11 tcsh-6.15.00-printexitvalue-backquotes.patch, NONE, 1.1 tcsh.spec, 1.60, 1.61

vcrhonek vcrhonek at fedoraproject.org
Thu Jan 21 16:34:08 UTC 2010


Author: vcrhonek

Update of /cvs/pkgs/rpms/tcsh/F-11
In directory cvs1.fedora.phx.redhat.com:/tmp/cvs-serv13007

Modified Files:
	tcsh.spec 
Added Files:
	tcsh-6.15.00-printexitvalue-backquotes.patch 
Log Message:
Fix tcsh obeys printexitvalue for back-ticks

tcsh-6.15.00-printexitvalue-backquotes.patch:
 sh.glob.c |    4 ++++
 sh.sem.c  |   22 +++++++++++-----------
 2 files changed, 15 insertions(+), 11 deletions(-)

--- NEW FILE tcsh-6.15.00-printexitvalue-backquotes.patch ---
diff --git a/sh.glob.c b/sh.glob.c
index a7215f3..e542b95 100644
--- a/sh.glob.c
+++ b/sh.glob.c
@@ -775,6 +775,10 @@ backeval(struct blk_buf *bb, struct Strbuf *word, Char *cp, int literal)
 	    alias(&paraml);
 	    t = syntax(paraml.next, &paraml, 0);
 	    cleanup_push(t, syntax_cleanup);
+	    /* The F_BACKQ flag must set so the job output is correct if
+	     * printexitvalue is set.  If it's not set, the job output
+	     * will have "Exit N" appended where N is the exit status. */
+	    t->t_dflg = F_BACKQ;
 	    if (seterr)
 		stderror(ERR_OLD);
 #ifdef SIGTSTP
diff --git a/sh.sem.c b/sh.sem.c
index 0ae1502..84f1e23 100644
--- a/sh.sem.c
+++ b/sh.sem.c
@@ -657,31 +657,31 @@ execute(struct command *t, volatile int wanttty, int *pipein, int *pipeout,
 #endif /* !CLOSE_ON_EXEC */
 	didfds = 0;
 	wanttty = -1;
-	t->t_dspr->t_dflg |= t->t_dflg & F_NOINTERRUPT;
+	t->t_dspr->t_dflg |= t->t_dflg & (F_NOINTERRUPT | F_BACKQ);
 	execute(t->t_dspr, wanttty, NULL, NULL, do_glob);
 	exitstat();
 
     case NODE_PIPE:
 #ifdef BACKPIPE
 	t->t_dcdr->t_dflg |= F_PIPEIN | (t->t_dflg &
-			(F_PIPEOUT | F_AMPERSAND | F_NOFORK | F_NOINTERRUPT));
+	    (F_PIPEOUT | F_AMPERSAND | F_NOFORK | F_NOINTERRUPT | F_BACKQ));
 	execute(t->t_dcdr, wanttty, pv, pipeout, do_glob);
-	t->t_dcar->t_dflg |= F_PIPEOUT |
-	    (t->t_dflg & (F_PIPEIN | F_AMPERSAND | F_STDERR | F_NOINTERRUPT));
+	t->t_dcar->t_dflg |= F_PIPEOUT | (t->t_dflg &
+	    (F_PIPEIN | F_AMPERSAND | F_STDERR | F_NOINTERRUPT | F_BACKQ));
 	execute(t->t_dcar, wanttty, pipein, pv, do_glob);
 #else /* !BACKPIPE */
-	t->t_dcar->t_dflg |= F_PIPEOUT |
-	    (t->t_dflg & (F_PIPEIN | F_AMPERSAND | F_STDERR | F_NOINTERRUPT));
+	t->t_dcar->t_dflg |= F_PIPEOUT | (t->t_dflg &
+	    (F_PIPEIN | F_AMPERSAND | F_STDERR | F_NOINTERRUPT | F_BACKQ));
 	execute(t->t_dcar, wanttty, pipein, pv, do_glob);
 	t->t_dcdr->t_dflg |= F_PIPEIN | (t->t_dflg &
-			(F_PIPEOUT | F_AMPERSAND | F_NOFORK | F_NOINTERRUPT));
+	    (F_PIPEOUT | F_AMPERSAND | F_NOFORK | F_NOINTERRUPT | F_BACKQ));
 	execute(t->t_dcdr, wanttty, pv, pipeout, do_glob);
 #endif /* BACKPIPE */
 	break;
 
     case NODE_LIST:
 	if (t->t_dcar) {
-	    t->t_dcar->t_dflg |= t->t_dflg & F_NOINTERRUPT;
+	    t->t_dcar->t_dflg |= t->t_dflg & (F_NOINTERRUPT | F_BACKQ);
 	    execute(t->t_dcar, wanttty, NULL, NULL, do_glob);
 	    /*
 	     * In strange case of A&B make a new job after A
@@ -692,7 +692,7 @@ execute(struct command *t, volatile int wanttty, int *pipein, int *pipeout,
 	}
 	if (t->t_dcdr) {
 	    t->t_dcdr->t_dflg |= t->t_dflg &
-		(F_NOFORK | F_NOINTERRUPT);
+		(F_NOFORK | F_NOINTERRUPT | F_BACKQ);
 	    execute(t->t_dcdr, wanttty, NULL, NULL, do_glob);
 	}
 	break;
@@ -700,7 +700,7 @@ execute(struct command *t, volatile int wanttty, int *pipein, int *pipeout,
     case NODE_OR:
     case NODE_AND:
 	if (t->t_dcar) {
-	    t->t_dcar->t_dflg |= t->t_dflg & F_NOINTERRUPT;
+	    t->t_dcar->t_dflg |= t->t_dflg & (F_NOINTERRUPT | F_BACKQ);
 	    execute(t->t_dcar, wanttty, NULL, NULL, do_glob);
 	    if ((getn(varval(STRstatus)) == 0) !=
 		(t->t_dtyp == NODE_AND)) {
@@ -709,7 +709,7 @@ execute(struct command *t, volatile int wanttty, int *pipein, int *pipeout,
 	}
 	if (t->t_dcdr) {
 	    t->t_dcdr->t_dflg |= t->t_dflg &
-		(F_NOFORK | F_NOINTERRUPT);
+		(F_NOFORK | F_NOINTERRUPT | F_BACKQ);
 	    execute(t->t_dcdr, wanttty, NULL, NULL, do_glob);
 	}
 	break;


Index: tcsh.spec
===================================================================
RCS file: /cvs/pkgs/rpms/tcsh/F-11/tcsh.spec,v
retrieving revision 1.60
retrieving revision 1.61
diff -u -p -r1.60 -r1.61
--- tcsh.spec	2 Mar 2009 14:11:52 -0000	1.60
+++ tcsh.spec	21 Jan 2010 16:34:07 -0000	1.61
@@ -3,7 +3,7 @@
 Summary: An enhanced version of csh, the C shell
 Name: tcsh
 Version: 6.15
-Release: 8%{?dist}
+Release: 9%{?dist}
 License: BSD with advertising
 Group: System Environment/Shells
 Source: ftp://ftp.astron.com/pub/tcsh/tcsh-%{version}.00.tar.gz
@@ -20,6 +20,7 @@ Patch10: tcsh-6.14.00-octal.patch
 Patch11: tcsh-6.14.00-order.patch
 Patch12: tcsh-6.15.00-wide-str.patch
 Patch13: tcsh-6.15.00-rs-color.patch
+Patch14: tcsh-6.15.00-printexitvalue-backquotes.patch
 Provides: csh = %{version}
 Requires(post): grep
 Requires(postun): coreutils, grep
@@ -50,6 +51,7 @@ like syntax.
 %patch11 -p1 -b .order
 %patch12 -p1 -b .wide-str
 %patch13 -p1 -b .rs-color
+%patch14 -p1 -b .printexitvalue-backquotes
 
 %build
 # For tcsh-6.14.00-tinfo.patch
@@ -117,6 +119,10 @@ fi
 %{_mandir}/*/*
 
 %changelog
+* Thu Jan 21 2010 Vitezslav Crhonek <vcrhonek at redhat.com> - 6.15-9
+- Fix tcsh obeys printexitvalue for back-ticks (patch by Jeff Bastian)
+  Resolves: #531957
+
 * Mon Mar  2 2009 Vitezslav Crhonek <vcrhonek at redhat.com> - 6.15-8
 - Fix tcsh needs to know about new colorls variables
   Resolves: #487783



More information about the scm-commits mailing list