Skip to content

Commit

Permalink
ports: Cumulative package update
Browse files Browse the repository at this point in the history
  • Loading branch information
mintsuki committed Feb 7, 2025
1 parent 804d6a0 commit 9d77048
Show file tree
Hide file tree
Showing 95 changed files with 1,113 additions and 383 deletions.
29 changes: 29 additions & 0 deletions host-recipes/file
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
#! /bin/sh

name=file
from_source=file
revision=1
imagedeps="file build-essential"

configure() {
CFLAGS="$HOST_CFLAGS" \
CXXFLAGS="$HOST_CXXFLAGS" \
LDFLAGS="$HOST_LDFLAGS" \
"${source_dir}"/configure \
--prefix=${prefix} \
--sysconfdir=/etc \
--localstatedir=/var \
--disable-nls \
--disable-static
}

build() {
make -j${parallelism}
}

package() {
DESTDIR="${dest_dir}" make install

strip_command=strip \
post_package_strip
}
244 changes: 221 additions & 23 deletions patches/bash/jinx-working-patch.patch
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
diff --git bash-clean/arrayfunc.c bash-workdir/arrayfunc.c
index 2c05d15..3904c76 100644
index 4125622..eecd550 100644
--- bash-clean/arrayfunc.c
+++ bash-workdir/arrayfunc.c
@@ -208,7 +208,10 @@ bind_assoc_var_internal (entry, hash, key, value, flags)
Expand All @@ -14,6 +14,14 @@ index 2c05d15..3904c76 100644
else
assoc_insert (hash, key, newval);

@@ -985,6 +988,7 @@ quote_compound_array_word (w, type)
if (t != w+ind)
free (t);
strcpy (nword + i, value);
+ free (value);

return nword;
}
diff --git bash-clean/bashline.c bash-workdir/bashline.c
index c85b05b..bd7548c 100644
--- bash-clean/bashline.c
Expand All @@ -27,7 +35,7 @@ index c85b05b..bd7548c 100644
return 1;
}
diff --git bash-clean/builtins/evalstring.c bash-workdir/builtins/evalstring.c
index df3dd68..20c6a4a 100644
index 53a7c0b..e43caa2 100644
--- bash-clean/builtins/evalstring.c
+++ bash-workdir/builtins/evalstring.c
@@ -461,6 +461,8 @@ parse_and_execute (string, from_file, flags)
Expand All @@ -39,28 +47,65 @@ index df3dd68..20c6a4a 100644
reset_parser ();
break;
}
@@ -762,6 +764,8 @@ open_redir_file (r, fnp)
diff --git bash-clean/builtins/read.def bash-workdir/builtins/read.def
index ddd91d3..53b4bd8 100644
--- bash-clean/builtins/read.def
+++ bash-workdir/builtins/read.def
@@ -130,7 +130,7 @@ static void set_readline_timeout PARAMS((sh_timer *t, time_t, long));
#endif
static SHELL_VAR *bind_read_variable PARAMS((char *, char *, int));
#if defined (HANDLE_MULTIBYTE)
-static int read_mbchar PARAMS((int, char *, int, int, int));
+static int read_mbchar PARAMS((int, char *, int, int, int, int));
#endif
static void ttyrestore PARAMS((struct ttsave *));

if (fnp)
*fnp = fn;
+ else
+ free (fn);
return fd;
}
@@ -806,7 +806,7 @@ add_char:
else
# endif
if (locale_utf8locale == 0 || ((c & 0x80) != 0))
- i += read_mbchar (fd, input_string, i, c, unbuffered_read);
+ i += read_mbchar (fd, input_string, i, c, delim, unbuffered_read);
}
#endif

@@ -1064,10 +1064,10 @@ bind_read_variable (name, value, flags)

diff --git bash-clean/configure.ac bash-workdir/configure.ac
index 50a6e20..52d4029 100644
--- bash-clean/configure.ac
+++ bash-workdir/configure.ac
@@ -885,7 +885,7 @@ AC_CHECK_DECLS([strtold], [
[AC_COMPILE_IFELSE(
[AC_LANG_PROGRAM(
[[#include <stdlib.h>]],
- [[long double r; char *foo, bar; r = strtold(foo, &bar);]]
+ [[long double r; char *foo, *bar; r = strtold(foo, &bar);]]
)],
[bash_cv_strtold_broken=no],[bash_cv_strtold_broken=yes])
]
#if defined (HANDLE_MULTIBYTE)
static int
-read_mbchar (fd, string, ind, ch, unbuffered)
+read_mbchar (fd, string, ind, ch, delim, unbuffered)
int fd;
char *string;
- int ind, ch, unbuffered;
+ int ind, ch, delim, unbuffered;
{
char mbchar[MB_LEN_MAX + 1];
int i, n, r;
@@ -1101,8 +1101,21 @@ read_mbchar (fd, string, ind, ch, unbuffered)
mbchar[i++] = c;
continue;
}
- else if (ret == (size_t)-1 || ret == (size_t)0 || ret > (size_t)0)
- break;
+ else if (ret == (size_t)-1)
+ {
+ /* If we read a delimiter character that makes this an invalid
+ multibyte character, we can't just add it to the input string
+ and treat it as a byte. We need to push it back so a subsequent
+ zread will pick it up. */
+ if (c == delim)
+ {
+ zungetc (c);
+ mbchar[--i] = '\0'; /* unget the delimiter */
+ }
+ break; /* invalid multibyte character */
+ }
+ else if (ret == (size_t)0 || ret > (size_t)0)
+ break; /* valid multibyte character */
}

mbchar_return:
diff --git bash-clean/examples/loadables/stat.c bash-workdir/examples/loadables/stat.c
index 1e60e7b..ed5c976 100644
--- bash-clean/examples/loadables/stat.c
Expand All @@ -73,6 +118,18 @@ index 1e60e7b..ed5c976 100644
}
return 0;
}
diff --git bash-clean/externs.h bash-workdir/externs.h
index 931dba9..1b70a13 100644
--- bash-clean/externs.h
+++ bash-workdir/externs.h
@@ -536,6 +536,7 @@ extern ssize_t zreadintr PARAMS((int, char *, size_t));
extern ssize_t zreadc PARAMS((int, char *));
extern ssize_t zreadcintr PARAMS((int, char *));
extern ssize_t zreadn PARAMS((int, char *, size_t));
+extern int zungetc PARAMS((int));
extern void zreset PARAMS((void));
extern void zsyncfd PARAMS((int));

diff --git bash-clean/lib/sh/random.c bash-workdir/lib/sh/random.c
index 1eaa71a..27aa87b 100644
--- bash-clean/lib/sh/random.c
Expand All @@ -95,8 +152,149 @@ index 1eaa71a..27aa87b 100644
iv = tv.tv_sec ^ tv.tv_usec ^ getpid () ^ getppid () ^ current_user.uid ^ iv;
return (iv);
}
diff --git bash-clean/lib/sh/zread.c bash-workdir/lib/sh/zread.c
index dafb7f6..7cfbb28 100644
--- bash-clean/lib/sh/zread.c
+++ bash-workdir/lib/sh/zread.c
@@ -41,6 +41,10 @@ extern int errno;
# define ZBUFSIZ 4096
#endif

+#ifndef EOF
+# define EOF -1
+#endif
+
extern int executing_builtin;

extern void check_signals_and_traps (void);
@@ -48,6 +52,11 @@ extern void check_signals (void);
extern int signal_is_trapped (int);
extern int read_builtin_timeout (int);

+int zungetc (int);
+
+/* Provide one character of pushback whether we are using read or zread. */
+static int zpushedchar = -1;
+
/* Read LEN bytes from FD into BUF. Retry the read on EINTR. Any other
error causes the loop to break. */
ssize_t
@@ -59,6 +68,15 @@ zread (fd, buf, len)
ssize_t r;

check_signals (); /* check for signals before a blocking read */
+
+ /* If we pushed a char back, return it immediately */
+ if (zpushedchar != -1)
+ {
+ *buf = (unsigned char)zpushedchar;
+ zpushedchar = -1;
+ return 1;
+ }
+
/* should generalize into a mechanism where different parts of the shell can
`register' timeouts and have them checked here. */
while (((r = read_builtin_timeout (fd)) < 0 || (r = read (fd, buf, len)) < 0) &&
@@ -95,6 +113,14 @@ zreadretry (fd, buf, len)
ssize_t r;
int nintr;

+ /* If we pushed a char back, return it immediately */
+ if (zpushedchar != -1)
+ {
+ *buf = (unsigned char)zpushedchar;
+ zpushedchar = -1;
+ return 1;
+ }
+
for (nintr = 0; ; )
{
r = read (fd, buf, len);
@@ -118,6 +144,15 @@ zreadintr (fd, buf, len)
size_t len;
{
check_signals ();
+
+ /* If we pushed a char back, return it immediately */
+ if (zpushedchar != -1)
+ {
+ *buf = (unsigned char)zpushedchar;
+ zpushedchar = -1;
+ return 1;
+ }
+
return (read (fd, buf, len));
}

@@ -135,6 +170,14 @@ zreadc (fd, cp)
{
ssize_t nr;

+ /* If we pushed a char back, return it immediately */
+ if (zpushedchar != -1 && cp)
+ {
+ *cp = (unsigned char)zpushedchar;
+ zpushedchar = -1;
+ return 1;
+ }
+
if (lind == lused || lused == 0)
{
nr = zread (fd, lbuf, sizeof (lbuf));
@@ -160,6 +203,14 @@ zreadcintr (fd, cp)
{
ssize_t nr;

+ /* If we pushed a char back, return it immediately */
+ if (zpushedchar != -1 && cp)
+ {
+ *cp = (unsigned char)zpushedchar;
+ zpushedchar = -1;
+ return 1;
+ }
+
if (lind == lused || lused == 0)
{
nr = zreadintr (fd, lbuf, sizeof (lbuf));
@@ -186,6 +237,13 @@ zreadn (fd, cp, len)
{
ssize_t nr;

+ if (zpushedchar != -1 && cp)
+ {
+ *cp = zpushedchar;
+ zpushedchar = -1;
+ return 1;
+ }
+
if (lind == lused || lused == 0)
{
if (len > sizeof (lbuf))
@@ -204,6 +262,22 @@ zreadn (fd, cp, len)
return 1;
}

+int
+zungetc (c)
+ int c;
+{
+ if (zpushedchar == -1)
+ {
+ zpushedchar = c;
+ return c;
+ }
+
+ if (c == EOF || lind == 0)
+ return (EOF);
+ lbuf[--lind] = c; /* XXX */
+ return c;
+}
+
void
zreset ()
{
diff --git bash-clean/subst.c bash-workdir/subst.c
index 0dfabfe..d16035e 100644
index 2012e1f..d161517 100644
--- bash-clean/subst.c
+++ bash-workdir/subst.c
@@ -10727,6 +10727,7 @@ comsub:
Expand Down
25 changes: 25 additions & 0 deletions patches/cmatrix/jinx-working-patch.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
diff --git cmatrix-clean/CMakeLists.txt cmatrix-workdir/CMakeLists.txt
index c5548b3..a036a13 100644
--- cmatrix-clean/CMakeLists.txt
+++ cmatrix-workdir/CMakeLists.txt
@@ -14,7 +14,7 @@ set(MKFONTDIR "/usr/bin/mkfontdir")

add_definitions(-DEXCLUDE_CONFIG_H)
add_definitions(-DVERSION="${VERSION}")
-add_definitions(-DUSE_TIOCSTI)
+#add_definitions(-DUSE_TIOCSTI)

include(CheckIncludeFiles)
check_include_files("sys/ioctl.h" HAVE_SYS_IOCTL_H)
diff --git cmatrix-clean/cmatrix.c cmatrix-workdir/cmatrix.c
index 90284cb..eccc278 100644
--- cmatrix-clean/cmatrix.c
+++ cmatrix-workdir/cmatrix.c
@@ -32,6 +32,7 @@
#include <termios.h>
#include <signal.h>
#include <locale.h>
+#include <strings.h>

#ifndef EXCLUDE_CONFIG_H
#include "config.h"
13 changes: 0 additions & 13 deletions patches/fontconfig/jinx-working-patch.patch

This file was deleted.

2 changes: 1 addition & 1 deletion patches/gawk/jinx-working-patch.patch
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
diff --git gawk-clean/Makefile.am gawk-workdir/Makefile.am
index 9f5e40c..beb85d0 100644
index 99e2686..700fd58 100644
--- gawk-clean/Makefile.am
+++ gawk-workdir/Makefile.am
@@ -66,7 +66,7 @@ endif
Expand Down
9 changes: 0 additions & 9 deletions patches/glib/jinx-working-patch.patch
Original file line number Diff line number Diff line change
Expand Up @@ -24,15 +24,6 @@ index 9e97ef1..c089594 100644

static char *
get_mtab_monitor_file (void)
@@ -1502,7 +1502,7 @@ _g_get_unix_mount_points (void)
}

/* QNX {{{2 */
-#elif defined (HAVE_QNX)
+#elif defined (HAVE_QNX) || defined (__vinix__)
static GList *
_g_get_unix_mount_points (void)
{
diff --git glib-clean/glib/giounix.c glib-workdir/glib/giounix.c
index 9d9492b..081a1fe 100644
--- glib-clean/glib/giounix.c
Expand Down
Loading

0 comments on commit 9d77048

Please sign in to comment.