From f9d86930876bd8ceae8f66cee348b7496801a000 Mon Sep 17 00:00:00 2001 From: Bruno Haible Date: Wed, 7 Apr 2021 01:37:51 +0200 Subject: [PATCH] libtextstyle: Fix the set of exported symbols on Alpine Linux. * 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 | 3 ++- libtextstyle/build-aux/join-v-1 | 43 +++++++++++++++++++++++++++++++++ libtextstyle/lib/Makefile.am | 4 +-- 3 files changed, 47 insertions(+), 3 deletions(-) create mode 100755 libtextstyle/build-aux/join-v-1 diff --git a/libtextstyle/Makefile.am b/libtextstyle/Makefile.am index 318c0320f..27d631b2f 100644 --- a/libtextstyle/Makefile.am +++ b/libtextstyle/Makefile.am @@ -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 index 000000000..d1948ac3b --- /dev/null +++ b/libtextstyle/build-aux/join-v-1 @@ -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 . + +# 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 . + 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 diff --git a/libtextstyle/lib/Makefile.am b/libtextstyle/lib/Makefile.am index 1a06fa497..cb7375ae6 100644 --- a/libtextstyle/lib/Makefile.am +++ b/libtextstyle/lib/Makefile.am @@ -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 \ -- 2.47.3