[arch-commits] Commit in enchant/repos/testing-x86_64 (3 files)

Jan Steffens heftig at archlinux.org
Fri Nov 24 09:51:47 UTC 2017


    Date: Friday, November 24, 2017 @ 09:51:46
  Author: heftig
Revision: 310775

archrelease: copy trunk to testing-x86_64

Added:
  enchant/repos/testing-x86_64/0001-voikko-Avoid-crashing-when-there-are-no-languages.patch
    (from rev 310774, enchant/trunk/0001-voikko-Avoid-crashing-when-there-are-no-languages.patch)
  enchant/repos/testing-x86_64/PKGBUILD
    (from rev 310774, enchant/trunk/PKGBUILD)
Deleted:
  enchant/repos/testing-x86_64/PKGBUILD

--------------------------------------------------------------+
 0001-voikko-Avoid-crashing-when-there-are-no-languages.patch |   46 +++++
 PKGBUILD                                                     |   90 +++++-----
 2 files changed, 94 insertions(+), 42 deletions(-)

Copied: enchant/repos/testing-x86_64/0001-voikko-Avoid-crashing-when-there-are-no-languages.patch (from rev 310774, enchant/trunk/0001-voikko-Avoid-crashing-when-there-are-no-languages.patch)
===================================================================
--- 0001-voikko-Avoid-crashing-when-there-are-no-languages.patch	                        (rev 0)
+++ 0001-voikko-Avoid-crashing-when-there-are-no-languages.patch	2017-11-24 09:51:46 UTC (rev 310775)
@@ -0,0 +1,46 @@
+From 5d1257041e6e84b16ee9adc8d1ec6495adc26103 Mon Sep 17 00:00:00 2001
+Message-Id: <5d1257041e6e84b16ee9adc8d1ec6495adc26103.1511516301.git.jan.steffens at gmail.com>
+From: "Jan Alexander Steffens (heftig)" <jan.steffens at gmail.com>
+Date: Fri, 24 Nov 2017 10:34:01 +0100
+Subject: [PATCH] voikko: Avoid crashing when there are no languages
+
+voikko_provider_list_dicts returned NULL in this case. Fix this and use
+voikkoListSupportedSpellingLanguages directly, which always returns a
+valid pointer and also avoids copying.
+---
+ providers/enchant_voikko.c | 15 +++++++++------
+ 1 file changed, 9 insertions(+), 6 deletions(-)
+
+diff --git a/providers/enchant_voikko.c b/providers/enchant_voikko.c
+index 7af9db4c18580872..d6df8baa9a49c859 100644
+--- a/providers/enchant_voikko.c
++++ b/providers/enchant_voikko.c
+@@ -111,16 +111,19 @@ static int
+ voikko_provider_dictionary_exists (struct str_enchant_provider * me _GL_UNUSED_PARAMETER,
+                                    const char *const tag)
+ {
+-	size_t i, n_dicts;
+-	char ** existing_dicts = voikko_provider_list_dicts (NULL, &n_dicts);
++	size_t i;
++	int exists = 0;
++	char ** voikko_langs = voikkoListSupportedSpellingLanguages (NULL);
+ 
+-	for (i = 0; existing_dicts[i] != NULL; i++) {
+-		if (strncmp (tag, existing_dicts[i], strlen (tag)) == 0) {
+-			return 1;
++	for (i = 0; voikko_langs[i] != NULL; i++) {
++		if (strncmp (tag, voikko_langs[i], strlen (tag)) == 0) {
++			exists = 1;
++			break;
+ 		}
+ 	}
++	voikkoFreeCstrArray(voikko_langs);
+ 
+-	return 0;
++	return exists;
+ }
+ 
+ static EnchantDict *
+-- 
+2.15.0
+

Deleted: PKGBUILD
===================================================================
--- PKGBUILD	2017-11-24 09:51:10 UTC (rev 310774)
+++ PKGBUILD	2017-11-24 09:51:46 UTC (rev 310775)
@@ -1,42 +0,0 @@
-# $Id$
-# Maintainer: Felix Yan <felixonmars at gmail.com>
-# Contributor: Andrea Scarpino <andrea at archlinux.org>
-# Contributor: dorphell <dorphell at archlinux.org>
-
-pkgname=enchant
-pkgver=2.1.2
-pkgrel=1
-pkgdesc="A wrapper library for generic spell checking"
-arch=('x86_64')
-url="https://abiword.github.io/enchant/"
-license=('LGPL')
-depends=('aspell' 'hunspell' 'hspell' 'libvoikko' 'glib2')
-makedepends=('git')
-_commit=9889e6350eb645feca2b0c061f719ca4188984d5  # tags/v2.1.2
-source=("git+https://github.com/AbiWord/enchant.git#commit=$_commit")
-sha256sums=('SKIP')
-
-pkgver() {
-  cd $pkgname
-  git describe --tags | sed 's/^v//;s/-/\./g'
-}
-
-prepare() {
-  cd $pkgname
-  ./bootstrap
-}
-
-build() {
-  cd $pkgname
-  ./configure --prefix=/usr \
-    --disable-static \
-    --disable-ispell \
-    --with-myspell-dir=/usr/share/myspell
-  sed -i -e 's/ -shared / -Wl,-O1,--as-needed\0/g' libtool
-  make
-}
-
-package() {
-  cd $pkgname
-  make DESTDIR="${pkgdir}" install
-}

Copied: enchant/repos/testing-x86_64/PKGBUILD (from rev 310774, enchant/trunk/PKGBUILD)
===================================================================
--- PKGBUILD	                        (rev 0)
+++ PKGBUILD	2017-11-24 09:51:46 UTC (rev 310775)
@@ -0,0 +1,48 @@
+# $Id$
+# Maintainer: Felix Yan <felixonmars at gmail.com>
+# Contributor: Andrea Scarpino <andrea at archlinux.org>
+# Contributor: dorphell <dorphell at archlinux.org>
+
+pkgname=enchant
+pkgver=2.1.2
+pkgrel=2
+pkgdesc="A wrapper library for generic spell checking"
+arch=('x86_64')
+url="https://abiword.github.io/enchant/"
+license=('LGPL')
+depends=('aspell' 'hunspell' 'hspell' 'libvoikko' 'glib2')
+makedepends=('git')
+_commit=9889e6350eb645feca2b0c061f719ca4188984d5  # tags/v2.1.2
+source=("git+https://github.com/AbiWord/enchant.git#commit=$_commit"
+        0001-voikko-Avoid-crashing-when-there-are-no-languages.patch)
+sha256sums=('SKIP'
+            'b30f9ff749a050515a4eb39686b2e3e5e7f2bc84eff26b3611fe3885785166ec')
+
+pkgver() {
+  cd $pkgname
+  git describe --tags | sed 's/^v//;s/-/\./g'
+}
+
+prepare() {
+  cd $pkgname
+
+  # https://github.com/AbiWord/enchant/pull/161
+  patch -Np1 -i ../0001-voikko-Avoid-crashing-when-there-are-no-languages.patch
+
+  ./bootstrap
+}
+
+build() {
+  cd $pkgname
+  ./configure --prefix=/usr \
+    --disable-static \
+    --disable-ispell \
+    --with-myspell-dir=/usr/share/myspell
+  sed -i -e 's/ -shared / -Wl,-O1,--as-needed\0/g' libtool
+  make
+}
+
+package() {
+  cd $pkgname
+  make DESTDIR="${pkgdir}" install
+}



More information about the arch-commits mailing list