sort: remove NLS support

NLS support for sort(1) is:
1/ incomplete: many error string are not using nls
2/ only covers hu_HU.ISO8859-2
This commit is contained in:
Baptiste Daroussin 2022-10-12 16:18:59 +02:00
parent ecc3c29167
commit ed990a7a2f
8 changed files with 4 additions and 71 deletions

View file

@ -52,6 +52,9 @@
# xargs -n1 | sort | uniq -d;
# done
# 20221012: remove nls support from sort
OLD_FILES+=usr/share/nls/hu_HU.ISO8859-2/sort.cat
# 20221003: ip6protosw.h removed
OLD_FILES+=usr/include/netinet6/ip6protosw.h

View file

@ -6361,7 +6361,6 @@ OLD_DIRS+=usr/share/nls/hu_HU.ISO8859-2
OLD_FILES+=usr/share/nls/hu_HU.ISO8859-2/ee.cat
OLD_FILES+=usr/share/nls/hu_HU.ISO8859-2/grep.cat
OLD_FILES+=usr/share/nls/hu_HU.ISO8859-2/libc.cat
OLD_FILES+=usr/share/nls/hu_HU.ISO8859-2/sort.cat
OLD_DIRS+=usr/share/nls/hr_HR.UTF-8
OLD_DIRS+=usr/share/nls/hu_HU.UTF-8
OLD_DIRS+=usr/share/nls/hy_AM.ARMSCII-8

View file

@ -21,18 +21,6 @@ LIBADD= md
MAN_SUB+= -e 's|%%THREADS%%|\.\\"|g'
.endif
.if ${MK_NLS} != "no"
NLS+= hu_HU.ISO8859-2
NLSSRCFILES= ${NLS:S@$@.msg@}
MAN_SUB+= -e 's|%%NLS%%||g'
.for lang in ${NLS}
NLSSRCDIR_${lang}= ${.CURDIR}/nls
.endfor
.else
CFLAGS+= -DWITHOUT_NLS
MAN_SUB+= -e 's|%%NLS%%|\.\\"|g'
.endif
HAS_TESTS=
SUBDIR.${MK_TESTS}+= tests

View file

@ -1,16 +0,0 @@
$ $FreeBSD$
$
$set 1
$quote "
1 "mutually exclusive flags"
2 "extra argument not allowed with -c"
3 "Unknown feature"
4 "Wrong memory buffer specification"
5 "0 field in key specs"
6 "0 column in key specs"
7 "Wrong file mode"
8 "Cannot open file for reading"
9 "Radix sort cannot be used with these sort options"
10 "The chosen sort method cannot be used with stable and/or unique sort"
11 "Invalid key position"
12 "Usage: %s [-bcCdfigMmnrsuz] [-kPOS1[,POS2] ... ] [+POS1 [-POS2]] [-S memsize] [-T tmpdir] [-t separator] [-o outfile] [--batch-size size] [--files0-from file] [--heapsort] [--mergesort] [--radixsort] [--qsort] [--nthreads thread_no] [--human-numeric-sort] [--version-sort] [--random-sort [--random-source file]] [--compress-program program] [file ...]\n"

View file

@ -1,16 +0,0 @@
$ $FreeBSD$
$
$set 1
$quote "
1 "egymást kizáró opciók"
2 "extra argumentum a -%c opcióval"
3 "Ismeretlen funkció\n"
4 "Rossz memória puffer érték"
5 "0 mező a kulcsspecifikációban\n"
6 "0 oszlop a kulcsspecifikációban\n"
7 "Helytelen fájl mód"
8 "A fájl nem nyitható meg olvasásra"
9 "A radix rendezés nem használható a megadott rendezési opciókkal"
10 "A választott rendezési mód nem használható a --stable és --unique opciókkal"
11 "Érvénytelen kulcs pozíció"
12 "Használat: %s [-bcCdfigMmnrsuz] [-kPOS1[,POS2] ... ] [+POS1 [-POS2]] [-S memóriaméret] [-T ideiglenes_könyvtár] [-t elválasztó] [-o kimeneti_fájl] [--batch-size méret] [--files0-from fájl] [--heapsort] [--mergesort] [--radixsort] [--qsort] [--nthreads szálak_száma] [--human-numeric-sort] [--version-sort] [--random-sort [--random-source fájl]] [--compress-program program] [fájl ...]\n"

View file

@ -527,8 +527,6 @@ Used as a last resort to determine different kinds of locale-specific
behavior if neither the respective environment variable, nor
.Ev LC_ALL
are set.
%%NLS%%.It Ev NLSPATH
%%NLS%%Path to NLS catalogs.
.It Ev TMPDIR
Path to the directory in which temporary files will be stored.
Note that

View file

@ -55,11 +55,6 @@ __FBSDID("$FreeBSD$");
#include "file.h"
#include "sort.h"
#ifndef WITHOUT_NLS
#include <nl_types.h>
nl_catd catalog = (nl_catd)-1;
#endif
#define OPTIONS "bcCdfghik:Mmno:RrsS:t:T:uVz"
static bool need_random;
@ -67,8 +62,7 @@ static bool need_random;
MD5_CTX md5_ctx;
/*
* Default messages to use when NLS is disabled or no catalogue
* is found.
* Default messages to use
*/
const char *nlsstr[] = { "",
/* 1*/"mutually exclusive flags",
@ -1011,10 +1005,6 @@ main(int argc, char **argv)
set_tmpdir();
set_sort_opts();
#ifndef WITHOUT_NLS
catalog = catopen("sort", NL_CAT_LOCALE);
#endif
fix_obsolete_keys(&argc, argv);
while (((c = getopt_long(argc, argv, OPTIONS, long_options, NULL))
@ -1339,10 +1329,5 @@ main(int argc, char **argv)
sort_free(outfile);
#ifndef WITHOUT_NLS
if (catalog != (nl_catd)-1)
catclose(catalog);
#endif
return (result);
}

View file

@ -43,15 +43,7 @@
#define VERSION "2.3-FreeBSD"
#ifdef WITHOUT_NLS
#define getstr(n) nlsstr[n]
#else
#include <nl_types.h>
extern nl_catd catalog;
#define getstr(n) \
(catalog == (nl_catd)-1 ? nlsstr[n] : catgets(catalog, 1, n, nlsstr[n]))
#endif
extern const char *nlsstr[];