aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSören Tempel <soeren+git@soeren-tempel.net>2020-09-29 20:46:08 +0200
committerLeo <thinkabit.ukim@gmail.com>2020-10-11 21:09:19 -0300
commit4eb48259ea47067f52772e7cbf3d7345c3bf988c (patch)
tree5aa90b00d95121f4e41c367b0796f4372fcb551e
parent4e99e3e57672dc19dd735273ca4bee6b31f9f705 (diff)
downloadalpine_aports-4eb48259ea47067f52772e7cbf3d7345c3bf988c.tar.bz2
alpine_aports-4eb48259ea47067f52772e7cbf3d7345c3bf988c.tar.xz
alpine_aports-4eb48259ea47067f52772e7cbf3d7345c3bf988c.zip
community/pdfgrep: prevent crash if LANG is not set explicitly
-rw-r--r--community/pdfgrep/APKBUILD8
-rw-r--r--community/pdfgrep/no-locale.patch31
2 files changed, 36 insertions, 3 deletions
diff --git a/community/pdfgrep/APKBUILD b/community/pdfgrep/APKBUILD
index 16c09427e1..b8de666624 100644
--- a/community/pdfgrep/APKBUILD
+++ b/community/pdfgrep/APKBUILD
@@ -3,7 +3,7 @@
3# Maintainer: André Klitzing <aklitzing@gmail.com> 3# Maintainer: André Klitzing <aklitzing@gmail.com>
4pkgname=pdfgrep 4pkgname=pdfgrep
5pkgver=2.1.2 5pkgver=2.1.2
6pkgrel=4 6pkgrel=5
7pkgdesc="Commandline utility to search text in PDF files" 7pkgdesc="Commandline utility to search text in PDF files"
8url="https://pdfgrep.org/" 8url="https://pdfgrep.org/"
9arch="all" 9arch="all"
@@ -13,7 +13,8 @@ checkdepends="dejagnu texlive"
13subpackages="$pkgname-doc 13subpackages="$pkgname-doc
14 $pkgname-zsh-completion:zshcomp:noarch 14 $pkgname-zsh-completion:zshcomp:noarch
15 $pkgname-bash-completion:bashcomp:noarch" 15 $pkgname-bash-completion:bashcomp:noarch"
16source="https://pdfgrep.org/download/${pkgname}-${pkgver}.tar.gz" 16source="https://pdfgrep.org/download/${pkgname}-${pkgver}.tar.gz
17 no-locale.patch"
17options="!check" # multiple failures 18options="!check" # multiple failures
18builddir="$srcdir/$pkgname-$pkgver" 19builddir="$srcdir/$pkgname-$pkgver"
19 20
@@ -56,4 +57,5 @@ zshcomp() {
56 "$subpkgdir"/usr/share/zsh/site-functions 57 "$subpkgdir"/usr/share/zsh/site-functions
57} 58}
58 59
59sha512sums="27bc4741e5203b2fd265815a22ad8d702b3455b2ae932641b040fc9ce615bc9ff0abef221eb2ec8aa59c79cb139d31184261d076f9731177129a473d62aa4e5c pdfgrep-2.1.2.tar.gz" 60sha512sums="27bc4741e5203b2fd265815a22ad8d702b3455b2ae932641b040fc9ce615bc9ff0abef221eb2ec8aa59c79cb139d31184261d076f9731177129a473d62aa4e5c pdfgrep-2.1.2.tar.gz
610908a622202e7955d529befbbb87e2c521693e150bd3911ea459ce0f870ddea737afd0504a60038c3f2c71630fdb92d64e6401ae6e70e756583fb99c18aedb64 no-locale.patch"
diff --git a/community/pdfgrep/no-locale.patch b/community/pdfgrep/no-locale.patch
new file mode 100644
index 0000000000..d450055abe
--- /dev/null
+++ b/community/pdfgrep/no-locale.patch
@@ -0,0 +1,31 @@
1Don't set locale explicitly. musl supports UTF-8 by default.
2
3With this change pdfgrep fails with:
4
5 terminate called after throwing an instance of 'std::runtime_error'
6 what(): locale::facet::_S_create_c_locale name not valid
7 Aborted
8
9Unless LANG is set explicitly.
10
11Alternative solutions:
12
13 * Use the "C" lang instead of the "" lang?
14 * Catch the error and ignore it?
15
16diff -upr pdfgrep-2.1.2.orig/src/pdfgrep.cc pdfgrep-2.1.2/src/pdfgrep.cc
17--- pdfgrep-2.1.2.orig/src/pdfgrep.cc 2020-09-29 12:33:50.018014326 +0200
18+++ pdfgrep-2.1.2/src/pdfgrep.cc 2020-09-29 12:36:39.827698175 +0200
19@@ -457,10 +457,12 @@ int main(int argc, char** argv)
20 Options options;
21 init_colors(options.outconf.colors);
22
23+#if 0
24 // Set locale to user-preference. If this locale is an UTF-8 locale, the
25 // regex-functions regcomp/regexec become unicode aware, which means
26 // e.g. that '.' will match a unicode character, not a single byte.
27 locale::global(locale(""));
28+#endif
29
30 enum re_engine_type {
31 RE_POSIX = 0,