Skip to content

Commit a2ced80

Browse files
authored
Coreutils: improved patch for uniq command (#5376)
1 parent b9a94fd commit a2ced80

File tree

5 files changed

+13
-10
lines changed

5 files changed

+13
-10
lines changed

recipes/recipes_emscripten/coreutils/patches/0001-sethostname-not-static.patch

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
From 3be6c9919b55f181cfd1140fd1d21a0b08f76832 Mon Sep 17 00:00:00 2001
1+
From 4bf31f3390514402df802edf29a8821951257026 Mon Sep 17 00:00:00 2001
22
From: Ian Thomas <ianthomas23@gmail.com>
33
Date: Mon, 30 Mar 2026 12:54:02 +0100
44
Subject: [PATCH 1/4] sethostname not static

recipes/recipes_emscripten/coreutils/patches/0002-Don-t-build-tests-or-man-pages.patch

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
From 12d3754d9ee4fca12408e01d7d3e0aff9b16b2e6 Mon Sep 17 00:00:00 2001
1+
From e1db156025682ae478d5b30b7ed5c2b64f751ba5 Mon Sep 17 00:00:00 2001
22
From: Ian Thomas <ianthomas23@gmail.com>
33
Date: Mon, 30 Mar 2026 12:55:33 +0100
44
Subject: [PATCH 2/4] Don't build tests or man pages

recipes/recipes_emscripten/coreutils/patches/0003-Avoid-use-of-freopen-in-uniq.patch

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
1-
From e614de13b330a70915852bfe160927a5acfe28d4 Mon Sep 17 00:00:00 2001
1+
From 4d0f268f8c18201c87335ba532d7f5ffcd012568 Mon Sep 17 00:00:00 2001
22
From: Ian Thomas <ianthomas23@gmail.com>
33
Date: Wed, 1 Apr 2026 13:54:05 +0100
44
Subject: [PATCH 3/4] Avoid use of freopen in uniq
55

66
---
77
lib/closeout.c | 8 +++++++-
88
lib/closeout.h | 3 +++
9-
src/uniq.c | 50 +++++++++++++++++++++++++++++++-------------------
10-
3 files changed, 41 insertions(+), 20 deletions(-)
9+
src/uniq.c | 52 +++++++++++++++++++++++++++++++-------------------
10+
3 files changed, 42 insertions(+), 21 deletions(-)
1111

1212
diff --git a/lib/closeout.c b/lib/closeout.c
1313
index a41758e..9655cec 100644
@@ -50,7 +50,7 @@ index 689f06c..5a1cda7 100644
5050
# ifdef __cplusplus
5151
}
5252
diff --git a/src/uniq.c b/src/uniq.c
53-
index eebff4b..346c16d 100644
53+
index eebff4b..d764dc6 100644
5454
--- a/src/uniq.c
5555
+++ b/src/uniq.c
5656
@@ -71,6 +71,8 @@ static bool output_later_repeated = false;
@@ -71,9 +71,12 @@ index eebff4b..346c16d 100644
7171
{
7272
if (! (linecount == 0 ? output_unique
7373
: !match ? output_first_repeated
74-
@@ -326,7 +328,7 @@ writeline (struct linebuffer const *line,
74+
@@ -324,9 +326,9 @@ writeline (struct linebuffer const *line,
75+
return;
76+
7577
if (count_occurrences)
76-
printf ("%7jd ", linecount + 1);
78+
- printf ("%7jd ", linecount + 1);
79+
+ fprintf (out, "%7jd ", linecount + 1);
7780

7881
- if (fwrite (line->buffer, sizeof (char), line->length, stdout)
7982
+ if (fwrite (line->buffer, sizeof (char), line->length, out)

recipes/recipes_emscripten/coreutils/patches/0004-Avoid-use-of-fd_reopen-in-touch.patch

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
From 541081b4132f94fc3e81fb65c49a031ca27eebcc Mon Sep 17 00:00:00 2001
1+
From d9bb13ec7eb969c6330359085815582865c59715 Mon Sep 17 00:00:00 2001
22
From: Ian Thomas <ianthomas23@gmail.com>
33
Date: Wed, 1 Apr 2026 13:55:25 +0100
44
Subject: [PATCH 4/4] Avoid use of fd_reopen in touch

recipes/recipes_emscripten/coreutils/recipe.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ source:
1616
- patches/0004-Avoid-use-of-fd_reopen-in-touch.patch
1717

1818
build:
19-
number: 1
19+
number: 2
2020

2121
requirements:
2222
build:

0 commit comments

Comments
 (0)