Browse code

tcsh: fix makecheck issues

- create a user to run make check. tcsh tests expect to have '>' prompt
rather then '#'
- fix regexp in tests - use patch from fedora repo

Change-Id: I01740515a121dc4e312facf1cdea29982be5c792
Reviewed-on: http://photon-jenkins.eng.vmware.com:8082/2880
Tested-by: gerrit-photon <photon-checkins@vmware.com>
Reviewed-by: Chang Lee <changlee@vmware.com>

Alexey Makhalov authored on 2017/06/07 08:04:35
Showing 4 changed files
1 1
deleted file mode 100644
... ...
@@ -1,17 +0,0 @@
1
-diff -rauN tcsh-6.19.00/tc.alloc.c tcsh-6.19.00-patch-calloc-gcc-5/tc.alloc.c
2
-+++ tcsh-6.19.00-patch-calloc-gcc-5/tc.alloc.c	2015-07-10 09:46:35.896959230 +0200
3
-@@ -348,10 +348,12 @@
4
- {
5
- #ifndef lint
6
-     char *cp;
7
-+    volatile size_t k;
8
- 
9
-     i *= j;
10
-     cp = xmalloc(i);
11
--    memset(cp, 0, i);
12
-+    k = i;
13
-+    memset(cp, 0, k);
14
- 
15
-     return ((memalign_t) cp);
16
- #else
17 1
new file mode 100644
... ...
@@ -0,0 +1,39 @@
0
+From 2ad4fc1705893207598ed5cd21713ddf3f17bba0 Mon Sep 17 00:00:00 2001
1
+From: zoulasc <christos@zoulas.com>
2
+Date: Thu, 23 Feb 2017 11:55:33 -0500
3
+Subject: [PATCH] 
4
+ https://github.com/tcsh-org/tcsh/pull/1#issuecomment-282035528
5
+
6
+---
7
+ tests/lexical.at | 6 +++---
8
+ 1 file changed, 3 insertions(+), 3 deletions(-)
9
+
10
+diff --git a/tests/lexical.at b/tests/lexical.at
11
+index 7b7da4e..3dc6024 100644
12
+--- a/tests/lexical.at
13
+@@ -567,10 +567,10 @@ run=3
14
+ ]])
15
+ AT_DATA([uniformity_test.csh],
16
+ [[
17
+-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'`
18
++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'`
19
+ echo -n "$SERVICE_NAME_LOG" > ./output1
20
+ 
21
+-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
22
++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
23
+ 
24
+ diff -uprN ./output1 ./output2 >& /dev/null
25
+ 
26
+@@ -587,7 +587,7 @@ AT_DATA([quoting_result_test.csh],
27
+ echo "(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP\)(HOST=db\)(PORT=1521\)\)(CONNECT_DATA=(SERVER=DEDICATED\)(SERVICE_NAME=bns03\)\)\)" > ./expected_result
28
+ 
29
+ set string = "jdbc_url=jdbc:oracle:thin:@(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=db)(PORT=1521))(CONNECT_DATA=(SERVER=DEDICATED)(SERVICE_NAME=bns03)))"
30
+-set SERVICE_NAME_LOG  = `echo "$string" | grep '^jdbc_url' | sed -ne 's/^[^=]*=[^@]*@[:blank:]*\([^$]*\)$/\1/p' | perl -pe 's/\)/\\\)/g'`
31
++set SERVICE_NAME_LOG  = `echo "$string" | grep '^jdbc_url' | sed -ne 's/^[^=]*=[^@]*@[[:blank:]]*\([^$]*\)$/\1/p' | perl -pe 's/\)/\\\)/g'`
32
+ 
33
+ echo "$SERVICE_NAME_LOG" > ./actual_result
34
+ 
35
+-- 
36
+2.9.3
37
+
0 38
deleted file mode 100644
... ...
@@ -1,21 +0,0 @@
1
-Proposed patch from Debian bug tracker by Aurelien Jarno <aurel32@debian.org>
2
-
3
-diff --git a/sh.proc.c b/sh.proc.c
4
-index ad07250..5c68409 100644
5
-+++ b/sh.proc.c
6
-@@ -47,11 +47,11 @@ RCSID("$tcsh$")
7
- # define HZ 16
8
- #endif /* aiws */
9
- 
10
--#if defined(_BSD) || (defined(IRIS4D) && __STDC__) || defined(__lucid) || defined(__linux__) || defined(__GNU__) || defined(__GLIBC__)
11
--# if !defined(__ANDROID__)
12
-+#if defined(_BSD) || (defined(IRIS4D) && __STDC__) || defined(__lucid) || defined(__linux__) || defined(__GLIBC__)
13
-+# if !defined(__ANDROID__) && !defined(__GLIBC__)
14
- #  define BSDWAIT
15
- # endif
16
--#endif /* _BSD || (IRIS4D && __STDC__) || __lucid || glibc */
17
-+#endif /* _BSD || (IRIS4D && __STDC__) || __lucid || gnu-linux */
18
- #ifndef WTERMSIG
19
- # define WTERMSIG(w)	(((union wait *) &(w))->w_termsig)
20
- # ifndef BSDWAIT
... ...
@@ -2,13 +2,13 @@
2 2
 Summary:        An enhanced version of csh, the C shell
3 3
 Name:           tcsh
4 4
 Version:        6.20.00
5
-Release:        2%{?dist}
5
+Release:        3%{?dist}
6 6
 License:        BSD
7 7
 Group:          System Environment/Shells
8 8
 Source:         http://www.sfr-fresh.com/unix/misc/%{name}-%{version}.tar.xz
9 9
 %define sha1    tcsh=a52deb0181e32583dbe666474c9c2e784357feba
10
-Patch0:         tcsh-6.19.00-calloc-gcc-5.patch
11
-Patch1:         tcsh.glibc-2.24.patch
10
+# patch origin http://pkgs.fedoraproject.org/cgit/rpms/tcsh.git/
11
+Patch0:         tcsh-6.20.00-009-fix-regexp-for-backlash-quoting-tests.patch
12 12
 URL:            http://www.tcsh.org/
13 13
 Vendor:         VMware, Inc.
14 14
 Distribution:   Photon
... ...
@@ -29,6 +29,7 @@ like syntax.
29 29
 
30 30
 %prep
31 31
 %setup -q
32
+%patch0 -p1
32 33
 
33 34
 %build
34 35
 sed -i -e 's|\$\*|#&|' -e 's|fR/g|&m|' tcsh.man2html &&
... ...
@@ -66,7 +67,10 @@ uk ukrainian
66 66
 _EOF
67 67
 
68 68
 %check
69
-make check
69
+# tcsh expect nonroot user to run a tests
70
+chmod g+w . -R
71
+useradd test -G root -m
72
+sudo -u test make check && userdel test -r -f
70 73
 
71 74
 %clean
72 75
 rm -rf %{buildroot}
... ...
@@ -111,6 +115,8 @@ fi
111 111
 %{_mandir}/man1/*.1*
112 112
 
113 113
 %changelog
114
+*   Tue Jun 6 2017 Alexey Makhalov <amakhalov@vmware.com> 6.20.00-3
115
+-   Fix make check issues.
114 116
 *   Tue Apr 25 2017 Priyesh Padmavilasom <ppadmavilasom@vmware.com> 6.20.00-2
115 117
 -   Ensure non empty debuginfo
116 118
 *   Tue Mar 28 2017 Xiaolin Li <xiaolinl@vmware.com> 6.20.00-1