[packages/ash] Rel 13

arekm arekm at pld-linux.org
Sun May 17 01:13:57 CEST 2026


commit 53b75fb8ae72cbcf9c22bccb21fa60b48f435c62
Author: Arkadiusz Miśkiewicz <arekm at maven.pl>
Date:   Sun May 17 01:13:43 2026 +0200

    Rel 13

 ash-modernc.patch | 88 +++++++++++++++++++++++++++++++++++++++++++++++++++++++
 ash.spec          | 16 +++++-----
 2 files changed, 97 insertions(+), 7 deletions(-)
---
diff --git a/ash.spec b/ash.spec
index 8a8bb8e..48fab14 100644
--- a/ash.spec
+++ b/ash.spec
@@ -22,7 +22,7 @@ Summary(zh_CN.UTF-8):	[系统]Berkeley的微型Bourne Shell
 Summary(zh_TW.UTF-8):	[-A系$)B統]Berkeley的-A微$)B型Bourne Shell
 Name:		ash
 Version:	0.4.0
-Release:	12
+Release:	13
 License:	BSD
 Group:		Applications/Shells
 Source0:	%{name}-%{version}.tar.gz
@@ -50,6 +50,7 @@ Patch19:	%{name}-freebsd.patch
 Patch20:	%{name}-sighup.patch
 Patch21:	%{name}-dietlibc.patch
 Patch22:	%{name}-extern.patch
+Patch23:	%{name}-modernc.patch
 BuildRequires:	byacc
 %{?with_dietlibc:BuildRequires:	dietlibc-devel}
 BuildRequires:	flex
@@ -176,28 +177,29 @@ avantajına sahiptir.
 %patch -P20 -p1
 %{?_with_dietlibc:%patch21 -p1}
 %patch -P22 -p1
+%patch -P23 -p1
 
 %build
 %if %{with static}
-%{__make} \
+%{__make} -j1 \
 %if %{with dietlibc}
 	CC="diet %{__cc}" \
 %else
 %if %{with uClibc}
-	CC="%{_target_cpu}-uclibc-gcc"\
+	CC="%{_target_cpu}-uclibc-gcc" \
 %else
-	CC="%{__cc}"
+	CC="%{__cc}" \
 %endif
 %endif
-	OPT_FLAGS="%{rpmcflags} -Os" \
+	OPT_FLAGS="%{rpmcflags} -Os -std=gnu89" \
 	LDFLAGS="-static %{rpmldflags}"
 
 mv -f sh ash.static
 %endif
 
-%{__make} \
+%{__make} -j1 \
 	CC="%{__cc}" \
-	OPT_FLAGS="%{rpmcflags}" \
+	OPT_FLAGS="%{rpmcflags} -std=gnu89" \
 	LDFLAGS="%{rpmldflags}"
 
 %install
diff --git a/ash-modernc.patch b/ash-modernc.patch
new file mode 100644
index 0000000..6c4298c
--- /dev/null
+++ b/ash-modernc.patch
@@ -0,0 +1,88 @@
+Real-bug fixes that no language-standard pin can address.
+
+- jobs.c: glibc 2.32+ removed `sys_siglist[]`; use POSIX `strsignal()`
+  instead.  Add `#include <string.h>` for its prototype.
+- output.c: `open_memstream()` writes a `size_t` into its second arg,
+  but `memout.bufsize` is `int`.  Use a `size_t` temporary and copy
+  back.
+- eval.c / var.h / var.c: `commandname` was defined twice (header +
+  source) and `localvars` was a tentative definition in the header.
+  GCC 10+ defaults to `-fno-common`, which makes both link errors.
+  Move definitions to .c and make header entries `extern`.
+
+--- ash-0.4.0/jobs.c
++++ ash-0.4.0/jobs.c
+@@ -48,6 +48,7 @@
+ #include <fcntl.h>
+ #include <signal.h>
+ #include <errno.h>
++#include <string.h>
+ #include <unistd.h>
+ #include <stdlib.h>
+ #include <paths.h>
+@@ -410,8 +411,8 @@
+ 				else /* WIFSIGNALED(ps->status) */
+ #endif
+ 					i = WTERMSIG(ps->status);
+-				if ((i & 0x7F) < NSIG && sys_siglist[i & 0x7F])
+-					scopy(sys_siglist[i & 0x7F], s);
++				if ((i & 0x7F) < NSIG && strsignal(i & 0x7F))
++					scopy(strsignal(i & 0x7F), s);
+ 				else
+ 					fmtstr(s, 64, "Signal %d", i & 0x7F);
+ 				if (WCOREDUMP(ps->status))
+@@ -942,8 +943,8 @@
+ 				outfmt(out2, "%%%ld ",
+ 				    (long)(job - jobtab + 1));
+ #endif
+-			if (sig < NSIG && sys_siglist[sig])
+-				out2str(sys_siglist[sig]);
++			if (sig < NSIG && strsignal(sig))
++				out2str(strsignal(sig));
+ 			else
+ 				outfmt(out2, "Signal %d", sig);
+ 			if (core)
+--- ash-0.4.0/output.c
++++ ash-0.4.0/output.c
+@@ -620,7 +620,9 @@
+
+ void
+ openmemout() {
+-	memout.stream = open_memstream(&memout.buf, &memout.bufsize);
++	size_t bufsize;
++	memout.stream = open_memstream(&memout.buf, &bufsize);
++	memout.bufsize = bufsize;
+ }
+
+
+--- ash-0.4.0/eval.c
++++ ash-0.4.0/eval.c
+@@ -89,7 +89,6 @@
+ int funcnest;			/* depth of function calls */
+
+
+-char *commandname;
+ struct strlist *cmdenviron;
+ int exitstatus;			/* exit status of last command */
+ int oexitstatus;		/* saved exit status */
+--- ash-0.4.0/var.h
++++ ash-0.4.0/var.h
+@@ -70,7 +70,7 @@
+ };
+
+
+-struct localvar *localvars;
++extern struct localvar *localvars;
+
+ #if ATTY
+ extern struct var vatty;
+--- ash-0.4.0/var.c
++++ ash-0.4.0/var.c
+@@ -90,6 +90,7 @@
+ struct var vhistsize;
+ struct var vterm;
+ #endif
++struct localvar *localvars;
+ struct var vifs;
+ struct var vmail;
+ struct var vmpath;
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/packages/ash.git/commitdiff/53b75fb8ae72cbcf9c22bccb21fa60b48f435c62



More information about the pld-cvs-commit mailing list