- refresh coreutils-i18n.patch to prevent unexpand from failing on control

characters
- extend psuffix handling to be quilt(1) compatible

OBS-URL: https://build.opensuse.org/package/show/Base:System/coreutils?expand=0&rev=334
This commit is contained in:
Dirk Mueller 2022-08-01 21:17:24 +00:00 committed by Git OBS Bridge
parent 9131b694ed
commit ec54266548
3 changed files with 28 additions and 11 deletions

View File

@ -1,3 +1,9 @@
From 01010419a6499768563e7b2f3fd56cf16edda75e Mon Sep 17 00:00:00 2001
From: rpm-build <rpm-build>
Date: Mon, 4 Oct 2021 08:54:37 +0200
Subject: [PATCH] coreutils-i18n.patch
---
bootstrap.conf | 1 +
configure.ac | 2 +
lib/linebuffer.h | 8 +
@ -13,7 +19,7 @@
src/local.mk | 4 +-
src/pr.c | 443 ++++++++++++++++++--
src/sort.c | 792 +++++++++++++++++++++++++++++++++---
src/unexpand.c | 101 ++++-
src/unexpand.c | 103 ++++-
src/uniq.c | 119 +++++-
tests/Coreutils.pm | 3 +
tests/expand/mb.sh | 183 +++++++++
@ -29,7 +35,7 @@
tests/misc/uniq.pl | 55 +++
tests/pr/pr-tests.pl | 49 +++
tests/unexpand/mb.sh | 172 ++++++++
31 files changed, 3698 insertions(+), 242 deletions(-)
31 files changed, 3700 insertions(+), 242 deletions(-)
create mode 100644 lib/mbfile.c
create mode 100644 lib/mbfile.h
create mode 100644 m4/mbfile.m4
@ -4267,7 +4273,7 @@ index 7d6100f..04cd646 100644
{
/* Go back one column, and force recalculation of the
next tab stop. */
@@ -218,9 +277,9 @@ unexpand (void)
@@ -218,9 +277,11 @@ unexpand (void)
next_tab_column = column;
tab_index -= !!tab_index;
}
@ -4275,11 +4281,13 @@ index 7d6100f..04cd646 100644
+ else if (!mb_iseq (c, '\n'))
{
- column++;
+ column += mb_width (c);
+ /* mb_width() returns 0 for control characters */
+ const int width = mb_width (c);
+ column += (width) ? width : 1;
if (!column)
die (EXIT_FAILURE, 0, _("input line is too long"));
}
@@ -228,8 +287,11 @@ unexpand (void)
@@ -228,8 +289,11 @@ unexpand (void)
if (pending)
{
if (pending > 1 && one_blank_before_tab_stop)
@ -4293,7 +4301,7 @@ index 7d6100f..04cd646 100644
die (EXIT_FAILURE, errno, _("write error"));
pending = 0;
one_blank_before_tab_stop = false;
@@ -239,16 +301,17 @@ unexpand (void)
@@ -239,16 +303,17 @@ unexpand (void)
convert &= convert_entire_line || blank;
}
@ -4483,7 +4491,7 @@ diff --git a/tests/Coreutils.pm b/tests/Coreutils.pm
index fad7ab9..c9021a6 100644
--- a/tests/Coreutils.pm
+++ b/tests/Coreutils.pm
@@ -264,6 +264,9 @@ sub run_tests ($$$$$)
@@ -269,6 +269,9 @@ sub run_tests ($$$$$)
# Yes, this is an arbitrary limit. If it causes trouble,
# consider removing it.
my $max = 30;

View File

@ -1,3 +1,10 @@
-------------------------------------------------------------------
Mon Aug 1 21:16:27 UTC 2022 - Dirk Müller <dmueller@suse.com>
- refresh coreutils-i18n.patch to prevent unexpand from failing on control
characters
- extend psuffix handling to be quilt(1) compatible
-------------------------------------------------------------------
Tue Apr 26 08:21:58 UTC 2022 - Dirk Müller <dmueller@suse.com>

View File

@ -20,12 +20,14 @@
# macros but OBS and the bots that rely on parser information from
# OBS can't deal with all of them
%global flavor @BUILD_FLAVOR@%{nil}
%if "%{flavor}" != ""
%define psuffix -%{flavor}
%if "%{flavor}" == "single"
%global psuffix -single
%elif "%{flavor}" == "testsuite"
%global psuffix -testsuite
%else
%define psuffix %{nil}
%global psuffix %{nil}
%endif
Name: coreutils%{psuffix}
Name: coreutils%{?psuffix}
Version: 9.1
Release: 0
Summary: GNU Core Utilities