]> git.ipfire.org Git - thirdparty/gettext.git/commitdiff
libtextstyle: Fix the set of exported symbols on Alpine Linux.
authorBruno Haible <bruno@clisp.org>
Tue, 6 Apr 2021 23:37:51 +0000 (01:37 +0200)
committerBruno Haible <bruno@clisp.org>
Sun, 9 Oct 2022 07:30:42 +0000 (09:30 +0200)
* libtextstyle/build-aux/join-v-1: New file, from GNU libunistring.
* libtextstyle/Makefile.am (EXTRA_DIST): Add it.
* libtextstyle/lib/Makefile.am (config.h): Use it instead of 'join -v 1'.

libtextstyle/Makefile.am
libtextstyle/build-aux/join-v-1 [new file with mode: 0755]
libtextstyle/lib/Makefile.am

index 318c0320fae7e3de4855233e2be89752356e0d91..27d631b2f900ca09a9210eb8bade15bc702a0680 100644 (file)
@@ -1,5 +1,5 @@
 ## Makefile for the toplevel directory of GNU libtextstyle
-## Copyright (C) 1995-2019 Free Software Foundation, Inc.
+## Copyright (C) 1995-2021 Free Software Foundation, Inc.
 ##
 ## This program is free software: you can redistribute it and/or modify
 ## it under the terms of the GNU General Public License as published by
@@ -190,6 +190,7 @@ EXTRA_DIST = \
   gnulib-local/tests/test-term-ostream-xterm-solaris10.out \
   gnulib-local/tests/test-term-ostream-xterm-xf86-v32.out \
   build-aux/moopp \
+  build-aux/join-v-1 \
   build-aux/texi2html \
   build-aux/run-test \
   build-aux/test-driver.diff \
diff --git a/libtextstyle/build-aux/join-v-1 b/libtextstyle/build-aux/join-v-1
new file mode 100755 (executable)
index 0000000..d1948ac
--- /dev/null
@@ -0,0 +1,43 @@
+#!/bin/sh
+# join-v-1 - Filter out a set of items from another set of items.
+
+# Copyright (C) 2021 Free Software Foundation, Inc.
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program.  If not, see <https://www.gnu.org/licenses/>.
+
+# Usage: join-v-1 FILE1 FILE2
+# Produces on stdout a list of items that are contained in FILE1 but not
+# contained in FILE2.  The items are strings without whitespace.
+# FILE1 and FILE2 contain such items, one per line, sorted according to
+# the current locale.
+# FILE1 or FILE2 can be specified as '-', which denotes standard input.
+
+# The 'join' program does not exist on all platforms.  Where it exists,
+# we can use it.
+if (type join) >/dev/null 2>&1; then
+  join -v 1 "$1" "$2"
+else
+  # Two solutions based on awk, by Bernhard Voelker <mail@bernhard-voelker.de>.
+  if true; then
+    awk -v keyfile="$2" '
+      BEGIN { while ((getline < keyfile) > 0) k[$1]=1 }
+      !k[$1]
+      ' "$1"
+  else
+    awk '
+      keys { k[$1]=1; next }
+      !k[$1]
+      ' keys=1 "$2" keys=0 "$1"
+  fi
+fi
index 1a06fa497ccea1642927be607c6a91c7e45c56ba..cb7375ae6978bf3927a1dc935d67ba170af9fd06 100644 (file)
@@ -1,5 +1,5 @@
 ## Makefile for the lib subdirectory of GNU libtextstyle.
-## Copyright (C) 2009-2020 Free Software Foundation, Inc.
+## Copyright (C) 2009-2021 Free Software Foundation, Inc.
 ##
 ## This program is free software: you can redistribute it and/or modify
 ## it under the terms of the GNU General Public License as published by
@@ -237,7 +237,7 @@ config.h: $(BUILT_SOURCES) libtextstyle.sym
              done; \
            } 5>&1 1>&2 \
              | sed -e 's,.* ,,' | grep -v '@' | LC_ALL=C sort | LC_ALL=C uniq \
-             | LC_ALL=C join -v 1 - libtextstyle.sym \
+             | $(top_srcdir)/build-aux/join-v-1 - libtextstyle.sym \
              | sed -e 's,^\(.*\)$$,#define \1 libtextstyle_\1,' > config.h-t; \
          } 6>&1 && \
          if test -f config.h; then \