[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Work around BSD `join` bug
From: |
Avinash Sonawane |
Subject: |
Work around BSD `join` bug |
Date: |
Wed, 10 Jan 2024 23:05:35 +0530 |
Hello!
BSD `join` has a bug where if one of the input file contains blank
lines then `join` fails.[0] Confirmed on FreeBSD and NetBSD.
This patch removes blank lines before performing `join`:
From cbf07f14b090a44981a94510753b68633eb46b72 Mon Sep 17 00:00:00 2001
From: Avinash Sonawane <rootkea@gmail.com>
Date: Wed, 10 Jan 2024 21:40:30 +0530
Subject: [PATCH] Work around BSD `join` bug.
* gnulib-tool (func_update_ignorelist): Remove blank lines as BSD
`join` fails if one of the file contains empty lines.
Copyright-paperwork-exempt: Yes
---
ChangeLog | 5 +++++
gnulib-tool | 2 +-
2 files changed, 6 insertions(+), 1 deletion(-)
diff --git a/ChangeLog b/ChangeLog
index 6187ed43a4..bc3e5ed22f 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2024-01-10 Avinash Sonawane <rootkea@gmail.com>
+
+ * gnulib-tool (func_update_ignorelist): Remove blank lines as BSD
+ `join` fails if one of the file contains empty lines.
+
2024-01-10 Bruno Haible <bruno@clisp.org>
jit/cache tests: Fix for arm CPUs with GCC target arm-linux-gnueabihf.
diff --git a/gnulib-tool b/gnulib-tool
index b909a81f7a..8d2f7984f3 100755
--- a/gnulib-tool
+++ b/gnulib-tool
@@ -6216,7 +6216,7 @@ s,//*$,/,'
fi
if test -f "$destdir/$dir$ignore"; then
if test -n "$dir_added" || test -n "$dir_removed"; then
- sed -e "s|^$anchor||" < "$destdir/$dir$ignore" | LC_ALL=C sort >
"$tmp"/ignore
+ sed -e "s|^$anchor||" -e '/^$/d' < "$destdir/$dir$ignore" |
LC_ALL=C sort > "$tmp"/ignore
(echo "$dir_added" | sed -e '/^$/d' | LC_ALL=C sort -u \
| LC_ALL=C join -v 1 - "$tmp"/ignore > "$tmp"/ignore-added
echo "$dir_removed" | sed -e '/^$/d' | LC_ALL=C sort -u \
--
2.39.3 (Apple Git-145)
[0] https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D232405
Regards,
Avinash Sonawane
https://www.rootkea.me
- Work around BSD `join` bug,
Avinash Sonawane <=