diff --git a/.gitignore b/.gitignore index 689fab4..b46f75e 100644 --- a/.gitignore +++ b/.gitignore @@ -67,3 +67,4 @@ INIT.2010-07-01.tgz /ksh-1.0.3.tar.gz /ksh-1.0.4.tar.gz /ksh-1.0.6.tar.gz +/ksh-1.0.7.tar.gz diff --git a/ksh-1.0.6-fix-strict-c99-compatibilty.patch b/ksh-1.0.6-fix-strict-c99-compatibilty.patch deleted file mode 100644 index 5fc6a77..0000000 --- a/ksh-1.0.6-fix-strict-c99-compatibilty.patch +++ /dev/null @@ -1,129 +0,0 @@ -From da983e28d4fd2793c0cc06f5fd012c2e287b3875 Mon Sep 17 00:00:00 2001 -From: Johnothan King -Date: Sat, 9 Sep 2023 14:40:20 -0700 -Subject: [PATCH] Fix problems in relation to Fedora's C99 instrumentation - (#665) - -This commit applies the necessary changes to the ksh codebase to -fix C99 compilation when using Red Hat's instrumented GCC[*], -though note that a patch to redhat-rpm-config is also required and -must be applied separately[*2]. - -[*1] https://fedoraproject.org/wiki/Toolchain/PortingToModernC -[*2] https://github.com/ksh93/ksh/issues/664#issuecomment-1608870665 - -src/lib/libast/comp/conf.tab: -- Add include directives to fix implicit function declarations that - cause the PID_MAX test to silently fail. This compile error - occurs on all platforms when compiling with strict C99, but - wasn't exposed even after setting IFFEFLAGS to -d1 or -d2 (that's - likely a separate bug in conf.sh that'll need fixing). As a - consequence, it could cause following bug in the getconf builtin - (now fixed as of this commit): - $ /opt/ast/bin/getconf PID_MAX - 30000 # Wrong, should be the platform value (e.g., 4194304) - -src/lib/libast/{features/lib,sfio/sfhdr.h}: -- Delete the lib_poll_fd_2 feature test and associated code, which - allowed ksh to used non-compliant implementations of poll(3). - This feature test fails on POSIX-compliant systems with - int-conversion errors, which is the expected result. However, the - C99 instrumentation used by Red Hat marks the entire build as a - failure because of the fact those errors exist at all, even - though the build proceeds as normal. Fortunately, the operating - systems supported by ksh (AFAIK) all have proper, POSIX-compliant - versions of poll() and thus don't need this test. To work around - the flawed instrumentation, the unnecessary test has been - jettisoned. - -Cherry-picked-by: Lukáš Zaoral -Upstream-commit: da983e28d4fd2793c0cc06f5fd012c2e287b3875 - ---- - src/lib/libast/comp/conf.tab | 3 +++ - src/lib/libast/features/lib | 24 +----------------------- - src/lib/libast/sfio/sfhdr.h | 9 --------- - 3 files changed, 4 insertions(+), 32 deletions(-) - -diff --git a/src/lib/libast/comp/conf.tab b/src/lib/libast/comp/conf.tab -index cd50e8bf78bc..4124752412ea 100644 ---- a/src/lib/libast/comp/conf.tab -+++ b/src/lib/libast/comp/conf.tab -@@ -390,6 +390,9 @@ PBS_MESSAGE POSIX SC 2 FUW - PBS_TRACK POSIX SC 2 FUW - PHYS_PAGES SUN SC 1 0 - PID_MAX SVID SC 1 LMU 30000 cc{ -+ #include -+ #include -+ #include - int main(void) - { - long v; -diff --git a/src/lib/libast/features/lib b/src/lib/libast/features/lib -index d8307ad0aa78..7e68e89075cc 100644 ---- a/src/lib/libast/features/lib -+++ b/src/lib/libast/features/lib -@@ -68,7 +68,7 @@ tst tst_errno note{ errno can be assigned }end link{ - int main(void) { errno = 0; error(); strerror(); return 0; } - }end - --tst lib_poll_fd_1 note{ fd is first arg to poll() }end execute{ -+tst lib_poll note{ poll() args comply with the POSIX standard }end execute{ - #include - #include - extern int pipe(int*); -@@ -87,28 +87,6 @@ tst lib_poll_fd_1 note{ fd is first arg to poll() }end execute{ - } - }end - --tst lib_poll_fd_2 note{ fd is second arg to poll() }end execute{ -- #include -- #include -- extern int pipe(int*); -- int -- main(void) -- { int rw[2]; -- struct pollfd fd; -- if (pipe(rw) < 0) return 1; -- fd.fd = rw[0]; -- fd.events = POLLIN; -- fd.revents = 0; -- return poll(1, &fd, 0) < 0; -- if (poll(1, &fd, 0) < 0 || fd.revents != 0) return 1; -- if (write(rw[1], "x", 1) != 1) return 1; -- if (poll(1, &fd, 0) < 0 || fd.revents == 0) return 1; -- return 0; -- } --}end -- --exp _lib_poll _lib_poll_fd_1||_lib_poll_fd_2 -- - tst lib_poll_notimer note{ poll with no fds ignores timeout }end execute{ - #include - #include -diff --git a/src/lib/libast/sfio/sfhdr.h b/src/lib/libast/sfio/sfhdr.h -index 755bb2add8e1..64ee68ed5eba 100644 ---- a/src/lib/libast/sfio/sfhdr.h -+++ b/src/lib/libast/sfio/sfhdr.h -@@ -103,21 +103,12 @@ - #if _sys_select - #include - #endif --#else --#if _lib_poll_fd_1 || _lib_poll_fd_2 --#define _lib_poll 1 --#endif - #endif /*_lib_select_*/ - - #if _lib_poll - #include -- --#if _lib_poll_fd_1 - #define SFPOLL(pfd,n,tm) poll((pfd),(ulong)(n),(tm)) --#else --#define SFPOLL(pfd,n,tm) poll((ulong)(n),(pfd),(tm)) - #endif --#endif /*_lib_poll*/ - - #if _stream_peek - #include diff --git a/ksh.spec b/ksh.spec index c1037dc..7a5ed41 100644 --- a/ksh.spec +++ b/ksh.spec @@ -3,25 +3,23 @@ Summary: The Original ATT Korn Shell URL: http://www.kornshell.com/ License: EPL-2.0 Epoch: 3 -Version: 1.0.6 -Release: 3%{?dist} +Version: 1.0.7 +Release: 1%{?dist} Source0: https://github.com/ksh93/%{name}/archive/v%{version}/%{name}-%{version}.tar.gz Source1: kshcomp.conf Source2: kshrc.rhs Source3: dotkshrc -# ksh: Porting to C99 (#2144903) -Patch1: ksh-1.0.6-fix-strict-c99-compatibilty.patch - Conflicts: pdksh Requires: coreutils, diffutils BuildRequires: gcc BuildRequires: bison -# regression test suite uses 'ps' from procps, 'script' from util-linux and -# 'tput' from ncurses +# regression test suite requirements +BuildRequires: glibc-langpack-ja BuildRequires: ncurses BuildRequires: procps +BuildRequires: tzdata BuildRequires: util-linux Requires(post): grep, coreutils, systemd @@ -140,6 +138,9 @@ fi %config(noreplace) %{_sysconfdir}/binfmt.d/kshcomp.conf %changelog +* Fri Sep 22 2023 Lukáš Zaoral - 3:1.0.7-1 +- new upstream release (rhbz#2239214) + * Wed Sep 13 2023 Lukáš Zaoral - 3:1.0.6-3 - fix building with strict C99 (rhbz#2144903) diff --git a/sources b/sources index b53951c..6124157 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (ksh-1.0.6.tar.gz) = df21b44981701a8e309776bae20df85d5e805bbd4e565259298ebbae1f3ef2c2e9a6e7bd485a8c9ed8a8e41818cedd75a722898f26b8430d830cc199df120dab +SHA512 (ksh-1.0.7.tar.gz) = 0ffaf7734d0efe8306def343acdd523be9f2bbff48933a8e0e987af1e8b1238283feee8df3d31a9184138110ed49aaa07c44e9acf4e0ca371e11b422ed885a7b