tcsh-6.19.00-031-always-send-prusage-to-stdout.patch added

This patch should fix regression in:
  tcsh-6.19.00-026-quote-backslashes-properly.patch

  More info: <http://mx.gw.com/pipermail/tcsh-bugs/2016-June/001067.html>
This commit is contained in:
David Kaspar [Dee'Kej] 2016-07-18 13:06:04 +02:00
parent 7f398b17c0
commit 4aac049647
2 changed files with 120 additions and 1 deletions

View File

@ -0,0 +1,113 @@
From bd339ea54ce5bd0a4925ae47856cf4bee8174f44 Mon Sep 17 00:00:00 2001
From: christos <christos>
Date: Sat, 9 Jul 2016 00:45:29 +0000
Subject: [PATCH 1/2] Always send rusage output to stdout (David Kaspar)
---
Fixes | 1 +
sh.time.c | 5 +++++
2 files changed, 6 insertions(+)
diff --git a/Fixes b/Fixes
index 981d676..ce17ff9 100644
--- a/Fixes
+++ b/Fixes
@@ -1,3 +1,4 @@
+ 13. always send prusage to stdout.
12. PR/526: Fix double \\ printing from previous fix in history expansion.
10. PR/526: Quote backslashes properly so they can be preserved in ``
expansions
diff --git a/sh.time.c b/sh.time.c
index 23fc7d7..5767ae7 100644
--- a/sh.time.c
+++ b/sh.time.c
@@ -293,6 +293,7 @@ prusage(struct tms *bs, struct tms *es, clock_t e, clock_t b)
# endif /* _SEQUENT_ */
#endif /* BSDTIMES */
{
+ int ohaderr = haderr;
#ifdef BSDTIMES
time_t t =
(r1->ru_utime.tv_sec - r0->ru_utime.tv_sec) * 100 +
@@ -334,12 +335,14 @@ prusage(struct tms *bs, struct tms *es, clock_t e, clock_t b)
((e->tv_sec - b->tv_sec) * 100 + (e->tv_usec - b->tv_usec) / 10000);
cp = "%Uu %Ss %E %P %X+%Dk %I+%Oio %Fpf+%Ww";
+ haderr = 0;
#else /* !BSDTIMES */
# ifdef _SEQUENT_
int ms = (int)
((e->tv_sec - b->tv_sec) * 100 + (e->tv_usec - b->tv_usec) / 10000);
cp = "%Uu %Ss %E %P %I+%Oio %Fpf+%Ww";
+ haderr = 0;
# else /* !_SEQUENT_ */
# ifndef POSIX
time_t ms = ((time_t)((e - b) / HZ) * 100) +
@@ -350,6 +353,7 @@ prusage(struct tms *bs, struct tms *es, clock_t e, clock_t b)
# endif /* POSIX */
cp = "%Uu %Ss %E %P";
+ haderr = 0;
/*
* the tms stuff is not very precise, so we fudge it.
@@ -678,6 +682,7 @@ prusage(struct tms *bs, struct tms *es, clock_t e, clock_t b)
break;
}
xputchar('\n');
+ haderr = ohaderr;
}
#if defined(BSDTIMES) || defined(_SEQUENT_)
--
2.5.5
From fa50bfd63c4b6c68a75b52da9b0284f0f1fcbd89 Mon Sep 17 00:00:00 2001
From: christos <christos>
Date: Sat, 9 Jul 2016 00:49:28 +0000
Subject: [PATCH 2/2] add new test for time output.
---
tests/commands.at | 20 ++++++++++++++++++++
1 file changed, 20 insertions(+)
diff --git a/tests/commands.at b/tests/commands.at
index b78fb26..cf0fcf0 100644
--- a/tests/commands.at
+++ b/tests/commands.at
@@ -1470,6 +1470,7 @@ OK
AT_CLEANUP
+
AT_SETUP([jobs output])
AT_DATA([jobs_stdout.csh],
@@ -1487,3 +1488,22 @@ endif
AT_CHECK([tcsh -f jobs_stdout.csh], 0, [ignore])
AT_CLEANUP
+
+AT_SETUP([time output])
+
+
+AT_DATA([time_output.csh],
+[[
+set time_output=`time sleep 1 > /dev/null`
+echo $time_output > ./output_result
+
+if ( -z ./output_result) then
+ echo "FAIL: 'time' output is not being displayed to stdout!"
+ exit 1
+else
+ exit 0
+endif
+]])
+AT_CHECK([tcsh -f time_output.csh], 0, [ignore])
+
+AT_CLEANUP
--
2.5.5

View File

@ -1,7 +1,7 @@
Name: tcsh
Summary: An enhanced version of csh, the C shell
Version: 6.19.00
Release: 11%{?dist}
Release: 12%{?dist}
License: BSD
Group: System Environment/Shells
URL: http://www.tcsh.org/
@ -59,6 +59,7 @@ Patch027: tcsh-6.19.00-027-fix-memory-leak-when-cdpath-fails.patch
Patch028: tcsh-6.19.00-028-fix-wrong-ifdef.patch
Patch029: tcsh-6.19.00-029-do-not-print-jobs-to-stderr.patch
Patch030: tcsh-6.19.00-030-new-testcases-for-testsuite.patch
Patch031: tcsh-6.19.00-031-always-send-prusage-to-stdout.patch
# Downstream patches -- these should be always included when doing rebase:
@ -181,6 +182,11 @@ fi
%changelog
* Mon Jul 18 2016 David Kaspar [Dee'Kej] <dkaspar@redhat.com> - 6.19.00-12
- Added tcsh-6.19.00-031-always-send-prusage-to-stdout.patch,
to fix regression in: tcsh-6.19.00-026-quote-backslashes-properly.patch
See <http://mx.gw.com/pipermail/tcsh-bugs/2016-June/001067.html> for more info.
* Tue May 31 2016 David Kaspar [Dee'Kej] <dkaspar@redhat.com> - 6.19.00-11
- Deprecated tcsh-6.19.00-tcsh_posix_status-deprecated.patch removed