new upstream release 9.4

- enable integration with systemd
- fix the license field

Resolves: rhbz#2235759
This commit is contained in:
Lukáš Zaoral 2023-09-15 15:52:15 +02:00
parent 21acecbf27
commit bf0817f5a5
No known key found for this signature in database
GPG Key ID: 39157506DD67752D
7 changed files with 524 additions and 759 deletions

View File

@ -1,276 +0,0 @@
From eca8f2dd212de534778c874a52ca079659e30140 Mon Sep 17 00:00:00 2001
From: Kamil Dudka <kdudka@redhat.com>
Date: Tue, 18 Apr 2023 17:57:42 +0200
Subject: [PATCH] Revert "strtol, strtoll, strtoul, strtoull: Make ISO C 23
compliant."
This reverts commit 4e38f4a0c65d4d19883b404a84169088b84b60d2.
---
gnulib-tests/test-strtoll.c | 62 ------------------------------------
gnulib-tests/test-strtoull.c | 62 ------------------------------------
lib/strtol.c | 14 ++------
m4/strtoll.m4 | 19 +++--------
m4/strtoull.m4 | 19 +++--------
5 files changed, 11 insertions(+), 165 deletions(-)
diff --git a/gnulib-tests/test-strtoll.c b/gnulib-tests/test-strtoll.c
index 24cb4eb..ecedbe6 100644
--- a/gnulib-tests/test-strtoll.c
+++ b/gnulib-tests/test-strtoll.c
@@ -239,67 +239,5 @@ main (void)
ASSERT (errno == 0);
}
- /* Binary integer syntax. */
- {
- const char input[] = "0b111010";
- char *ptr;
- long long result;
- errno = 0;
- result = strtoll (input, &ptr, 10);
- ASSERT (result == 0LL);
- ASSERT (ptr == input + 1);
- ASSERT (errno == 0);
- }
- {
- const char input[] = "0b111010";
- char *ptr;
- long long result;
- errno = 0;
- result = strtoll (input, &ptr, 2);
- ASSERT (result == 58LL);
- ASSERT (ptr == input + 8);
- ASSERT (errno == 0);
- }
- {
- const char input[] = "0b111010";
- char *ptr;
- long long result;
- errno = 0;
- result = strtoll (input, &ptr, 0);
- ASSERT (result == 58LL);
- ASSERT (ptr == input + 8);
- ASSERT (errno == 0);
- }
- {
- const char input[] = "0b";
- char *ptr;
- long long result;
- errno = 0;
- result = strtoll (input, &ptr, 10);
- ASSERT (result == 0LL);
- ASSERT (ptr == input + 1);
- ASSERT (errno == 0);
- }
- {
- const char input[] = "0b";
- char *ptr;
- long long result;
- errno = 0;
- result = strtoll (input, &ptr, 2);
- ASSERT (result == 0LL);
- ASSERT (ptr == input + 1);
- ASSERT (errno == 0);
- }
- {
- const char input[] = "0b";
- char *ptr;
- long long result;
- errno = 0;
- result = strtoll (input, &ptr, 0);
- ASSERT (result == 0LL);
- ASSERT (ptr == input + 1);
- ASSERT (errno == 0);
- }
-
return 0;
}
diff --git a/gnulib-tests/test-strtoull.c b/gnulib-tests/test-strtoull.c
index 7b0027f..dd6ec2a 100644
--- a/gnulib-tests/test-strtoull.c
+++ b/gnulib-tests/test-strtoull.c
@@ -238,67 +238,5 @@ main (void)
ASSERT (errno == 0);
}
- /* Binary integer syntax. */
- {
- const char input[] = "0b111010";
- char *ptr;
- unsigned long long result;
- errno = 0;
- result = strtoull (input, &ptr, 10);
- ASSERT (result == 0ULL);
- ASSERT (ptr == input + 1);
- ASSERT (errno == 0);
- }
- {
- const char input[] = "0b111010";
- char *ptr;
- unsigned long long result;
- errno = 0;
- result = strtoull (input, &ptr, 2);
- ASSERT (result == 58ULL);
- ASSERT (ptr == input + 8);
- ASSERT (errno == 0);
- }
- {
- const char input[] = "0b111010";
- char *ptr;
- unsigned long long result;
- errno = 0;
- result = strtoull (input, &ptr, 0);
- ASSERT (result == 58ULL);
- ASSERT (ptr == input + 8);
- ASSERT (errno == 0);
- }
- {
- const char input[] = "0b";
- char *ptr;
- unsigned long long result;
- errno = 0;
- result = strtoull (input, &ptr, 10);
- ASSERT (result == 0ULL);
- ASSERT (ptr == input + 1);
- ASSERT (errno == 0);
- }
- {
- const char input[] = "0b";
- char *ptr;
- unsigned long long result;
- errno = 0;
- result = strtoull (input, &ptr, 2);
- ASSERT (result == 0ULL);
- ASSERT (ptr == input + 1);
- ASSERT (errno == 0);
- }
- {
- const char input[] = "0b";
- char *ptr;
- unsigned long long result;
- errno = 0;
- result = strtoull (input, &ptr, 0);
- ASSERT (result == 0ULL);
- ASSERT (ptr == input + 1);
- ASSERT (errno == 0);
- }
-
return 0;
}
diff --git a/lib/strtol.c b/lib/strtol.c
index b93483d..d11269b 100644
--- a/lib/strtol.c
+++ b/lib/strtol.c
@@ -288,11 +288,6 @@ INTERNAL (strtol) (const STRING_TYPE *nptr, STRING_TYPE **endptr,
s += 2;
base = 16;
}
- else if ((base == 0 || base == 2) && TOUPPER (s[1]) == L_('B'))
- {
- s += 2;
- base = 2;
- }
else if (base == 0)
base = 8;
}
@@ -383,14 +378,11 @@ INTERNAL (strtol) (const STRING_TYPE *nptr, STRING_TYPE **endptr,
noconv:
/* We must handle a special case here: the base is 0 or 16 and the
first two characters are '0' and 'x', but the rest are no
- hexadecimal digits. Likewise when the base is 0 or 2 and the
- first two characters are '0' and 'b', but the rest are no binary
- digits. This is no error case. We return 0 and ENDPTR points to
- the 'x' or 'b'. */
+ hexadecimal digits. This is no error case. We return 0 and
+ ENDPTR points to the 'x'. */
if (endptr != NULL)
{
- if (save - nptr >= 2
- && (TOUPPER (save[-1]) == L_('X') || TOUPPER (save[-1]) == L_('B'))
+ if (save - nptr >= 2 && TOUPPER (save[-1]) == L_('X')
&& save[-2] == L_('0'))
*endptr = (STRING_TYPE *) &save[-1];
else
diff --git a/m4/strtoll.m4 b/m4/strtoll.m4
index ec09609..ede630c 100644
--- a/m4/strtoll.m4
+++ b/m4/strtoll.m4
@@ -1,4 +1,4 @@
-# strtoll.m4 serial 10
+# strtoll.m4 serial 9
dnl Copyright (C) 2002, 2004, 2006, 2008-2023 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
@@ -24,26 +24,15 @@ AC_DEFUN([gl_FUNC_STRTOLL],
if (term != input + 1)
result |= 1;
}
- /* This test fails on pre-C23 platforms. */
- {
- const char input[] = "0b1";
- (void) strtoll (input, &term, 2);
- if (term != input + 3)
- result |= 2;
- }
return result;
]])
],
[gl_cv_func_strtoll_works=yes],
[gl_cv_func_strtoll_works=no],
[case "$host_os" in
- # Guess no on native Windows.
- mingw*) gl_cv_func_strtoll_works="guessing no" ;;
- # Guess no on glibc systems.
- *-gnu* | gnu*) gl_cv_func_strtoll_works="guessing no" ;;
- # Guess no on musl systems.
- *-musl* | midipix*) gl_cv_func_strtoll_works="guessing no" ;;
- *) gl_cv_func_strtoll_works="$gl_cross_guess_normal" ;;
+ # Guess no on native Windows.
+ mingw*) gl_cv_func_strtoll_works="guessing no" ;;
+ *) gl_cv_func_strtoll_works="$gl_cross_guess_normal" ;;
esac
])
])
diff --git a/m4/strtoull.m4 b/m4/strtoull.m4
index 4f895c7..a9b0ddf 100644
--- a/m4/strtoull.m4
+++ b/m4/strtoull.m4
@@ -1,4 +1,4 @@
-# strtoull.m4 serial 10
+# strtoull.m4 serial 9
dnl Copyright (C) 2002, 2004, 2006, 2008-2023 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
@@ -24,26 +24,15 @@ AC_DEFUN([gl_FUNC_STRTOULL],
if (term != input + 1)
result |= 1;
}
- /* This test fails on pre-C23 platforms. */
- {
- const char input[] = "0b1";
- (void) strtoull (input, &term, 2);
- if (term != input + 3)
- result |= 2;
- }
return result;
]])
],
[gl_cv_func_strtoull_works=yes],
[gl_cv_func_strtoull_works=no],
[case "$host_os" in
- # Guess no on native Windows.
- mingw*) gl_cv_func_strtoull_works="guessing no" ;;
- # Guess no on glibc systems.
- *-gnu* | gnu*) gl_cv_func_strtoull_works="guessing no" ;;
- # Guess no on musl systems.
- *-musl* | midipix*) gl_cv_func_strtoull_works="guessing no" ;;
- *) gl_cv_func_strtoull_works="$gl_cross_guess_normal" ;;
+ # Guess no on native Windows.
+ mingw*) gl_cv_func_strtoull_works="guessing no" ;;
+ *) gl_cv_func_strtoull_works="$gl_cross_guess_normal" ;;
esac
])
])
--
2.39.2

View File

@ -0,0 +1,28 @@
From 2616c6be1c244424617997151c67bcab2dacbcfe Mon Sep 17 00:00:00 2001
From: rpm-build <rpm-build>
Date: Thu, 31 Aug 2023 14:34:05 +0200
Subject: [PATCH] coreutils-9.4-systemd-coredump.patch
Cherry picked from gnulib upstream commits:
* 1e6a26f9312bb47e070f94b17b14dc1a6ffbb74f ("readutmp: fix core dump if --enable-systemd")
* 3af1d7b0ce3a8e3ae565e7cea10cee6fd7cb8109 ("readutmp: Fix memory leak introduced by last commit.")
---
lib/readutmp.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/lib/readutmp.c b/lib/readutmp.c
index 0173b7e..ec09feb 100644
--- a/lib/readutmp.c
+++ b/lib/readutmp.c
@@ -795,7 +795,7 @@ read_utmp_from_systemd (idx_t *n_entries, STRUCT_UTMP **utmp_buf, int options)
{
char **sessions;
int num_sessions = sd_get_sessions (&sessions);
- if (num_sessions >= 0)
+ if (num_sessions >= 0 && sessions != NULL)
{
char **session_ptr;
for (session_ptr = sessions; *session_ptr != NULL; session_ptr++)
--
2.41.0

View File

@ -53,16 +53,16 @@ index 48025b9..c8efa5b 100644
static struct option const long_options[] =
{
{"all", no_argument, NULL, 'a'},
{"block-size", required_argument, NULL, 'B'},
+ {"direct", no_argument, NULL, DIRECT_OPTION},
{"inodes", no_argument, NULL, 'i'},
{"human-readable", no_argument, NULL, 'h'},
{"si", no_argument, NULL, 'H'},
{"all", no_argument, nullptr, 'a'},
{"block-size", required_argument, nullptr, 'B'},
+ {"direct", no_argument, nullptr, DIRECT_OPTION},
{"inodes", no_argument, nullptr, 'i'},
{"human-readable", no_argument, nullptr, 'h'},
{"si", no_argument, nullptr, 'H'},
@@ -583,7 +588,10 @@ get_header (void)
for (col = 0; col < ncolumns; col++)
{
char *cell = NULL;
char *cell = nullptr;
- char const *header = _(columns[col]->caption);
+ char const *header = (columns[col]->field == TARGET_FIELD
+ && direct_statfs)?

File diff suppressed because it is too large Load Diff

View File

@ -1,6 +1,6 @@
From d70ddb3eb845c494280e7365e2b889242e7e1bb9 Mon Sep 17 00:00:00 2001
From 88ba186955add2b230c017749d5622f7a0d62177 Mon Sep 17 00:00:00 2001
From: rpm-build <rpm-build>
Date: Mon, 4 Oct 2021 08:45:53 +0200
Date: Wed, 30 Aug 2023 17:19:58 +0200
Subject: [PATCH] coreutils-selinux.patch
---
@ -9,19 +9,19 @@ Subject: [PATCH] coreutils-selinux.patch
2 files changed, 29 insertions(+), 2 deletions(-)
diff --git a/src/cp.c b/src/cp.c
index c97a675..89fb8ec 100644
index 04a5cbe..7a364e5 100644
--- a/src/cp.c
+++ b/src/cp.c
@@ -952,7 +952,7 @@ main (int argc, char **argv)
@@ -989,7 +989,7 @@ main (int argc, char **argv)
selinux_enabled = (0 < is_selinux_enabled ());
cp_option_init (&x);
- while ((c = getopt_long (argc, argv, "abdfHilLnprst:uvxPRS:TZ",
+ while ((c = getopt_long (argc, argv, "abcdfHilLnprst:uvxPRS:TZ",
long_opts, NULL))
long_opts, nullptr))
!= -1)
{
@@ -1000,6 +1000,23 @@ main (int argc, char **argv)
@@ -1041,6 +1041,23 @@ main (int argc, char **argv)
copy_contents = true;
break;
@ -46,19 +46,19 @@ index c97a675..89fb8ec 100644
x.preserve_links = true;
x.dereference = DEREF_NEVER;
diff --git a/src/install.c b/src/install.c
index c9456fe..2b1bee9 100644
index 31a48f1..ce9fa2d 100644
--- a/src/install.c
+++ b/src/install.c
@@ -794,7 +794,7 @@ main (int argc, char **argv)
@@ -807,7 +807,7 @@ main (int argc, char **argv)
dir_arg = false;
umask (0);
- while ((optc = getopt_long (argc, argv, "bcCsDdg:m:o:pt:TvS:Z", long_options,
+ while ((optc = getopt_long (argc, argv, "bcCsDdg:m:o:pPt:TvS:Z", long_options,
NULL)) != -1)
nullptr))
!= -1)
{
switch (optc)
@@ -855,6 +855,9 @@ main (int argc, char **argv)
@@ -872,6 +872,9 @@ main (int argc, char **argv)
no_target_directory = true;
break;
@ -68,7 +68,7 @@ index c9456fe..2b1bee9 100644
case PRESERVE_CONTEXT_OPTION:
if (! selinux_enabled)
{
@@ -862,6 +865,13 @@ main (int argc, char **argv)
@@ -879,6 +882,13 @@ main (int argc, char **argv)
"this kernel is not SELinux-enabled"));
break;
}
@ -83,5 +83,5 @@ index c9456fe..2b1bee9 100644
use_default_selinux_context = false;
break;
--
2.31.1
2.41.0

View File

@ -1,8 +1,9 @@
Summary: A set of basic GNU tools commonly used in shell scripts
Name: coreutils
Version: 9.3
Release: 2%{?dist}
License: GPL-3.0-or-later
Version: 9.4
Release: 1%{?dist}
# some used parts of gnulib are under various variants of LGPL
License: GPL-3.0-or-later AND GFDL-1.3-no-invariants-or-later AND LGPL-2.1-or-later AND LGPL-3.0-or-later
Url: https://www.gnu.org/software/coreutils/
Source0: https://ftp.gnu.org/gnu/%{name}/%{name}-%{version}.tar.xz
Source1: https://ftp.gnu.org/gnu/%{name}/%{name}-%{version}.tar.xz.sig
@ -13,9 +14,6 @@ Source50: supported_utils
Source105: coreutils-colorls.sh
Source106: coreutils-colorls.csh
# revert a gnulib patch that broke the build
Patch1: coreutils-9.3-gnulib-strtol.patch
# do not make coreutils-single depend on /usr/bin/coreutils
%global __requires_exclude ^%{_bindir}/coreutils$
@ -31,6 +29,9 @@ Patch102: coreutils-8.32-DIR_COLORS.patch
# df --direct
Patch104: coreutils-df-direct.patch
# fix crash with --enable-systemd
Patch105: coreutils-9.4-systemd-coredump.patch
# (sb) lin18nux/lsb compliance - multibyte functionality patch
Patch800: coreutils-i18n.patch
@ -176,6 +177,7 @@ for type in separate single; do
--cache-file=../config.cache \
--enable-install-program=arch \
--enable-no-install-program=kill,uptime \
--enable-systemd \
--with-tty-group \
DEFAULT_POSIX2_VERSION=200112 alternative=199209 || :
%make_build all V=1
@ -254,6 +256,11 @@ rm -f $RPM_BUILD_ROOT%{_infodir}/dir
%license COPYING
%changelog
* Fri Sep 15 2023 Lukáš Zaoral <lzaoral@redhat.com> - 9.4-1
- new upstream release 9.4 (#2235759)
- enable integration with systemd
- fix the license field
* Wed Jul 19 2023 Fedora Release Engineering <releng@fedoraproject.org> - 9.3-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_39_Mass_Rebuild

View File

@ -1,2 +1,2 @@
SHA512 (coreutils-9.3.tar.xz) = 242271f212a6860bdc6c8d7e5c4f85ce66c1b48ef781aca9daa56e0fe7c2b7809ef72b4392120219fe5b687637c83ce89ceef8bb35f6274f43f8f968a6901694
SHA512 (coreutils-9.3.tar.xz.sig) = 522a2072f8ef940228ccdd856a4041c3c16b98e309168ccf2066fe7c1013685ba6cdea8a7317dfa1f4507b37ca016ecedaf54438d4a5007927b0e1a8fd223eb5
SHA512 (coreutils-9.4.tar.xz) = 7c55ee23b685a0462bbbd118b04d25278c902604a0dcf3bf4f8bf81faa0500dee5a7813cba6f586d676c98e520cafd420f16479619305e94ea6798d8437561f5
SHA512 (coreutils-9.4.tar.xz.sig) = 9674f783f592c4f3e5c708ff31426ac009bf132fd0005019571bf39c8a1627efb5351c6cecc7faecb1eff8fa2970318666593bffc0eda9c750159e174ef42524