[fontconfig] Add grep and coreutils to Requires(post). (#821957)
Akira TAGOH
tagoh at fedoraproject.org
Wed May 16 03:22:21 UTC 2012
commit 5fb5f5f4808520a0cdddc8d748be49a53bcd51bb
Author: Akira TAGOH <tagoh at redhat.com>
Date: Wed May 16 12:22:17 2012 +0900
Add grep and coreutils to Requires(post). (#821957)
fontconfig-2.9.0-result.patch | 75 +++++++++++++++++++++++++++++++++++++++++
fontconfig.spec | 12 ++++++-
2 files changed, 86 insertions(+), 1 deletions(-)
---
diff --git a/fontconfig-2.9.0-result.patch b/fontconfig-2.9.0-result.patch
new file mode 100644
index 0000000..666cea1
--- /dev/null
+++ b/fontconfig-2.9.0-result.patch
@@ -0,0 +1,75 @@
+From 92ac054ce5e270f22a4f81a09522c3f03b76c876 Mon Sep 17 00:00:00 2001
+From: Akira TAGOH <akira at tagoh.org>
+Date: Thu, 22 Mar 2012 19:15:27 +0900
+Subject: [PATCH] fcmatch: Set FcResultMatch at the end if the return value is
+ valid.
+
+In the previous code, the result of 'result' in the argument for
+FcFontSetSort() and FcFontSetMatch() wasn't predictable and not reliable to
+check if the return value is valid or not. this change is to ensure if it's
+performed successfully.
+---
+ src/fcmatch.c | 19 ++++++++++++++-----
+ 1 files changed, 14 insertions(+), 5 deletions(-)
+
+diff --git a/src/fcmatch.c b/src/fcmatch.c
+index 422bc38..92e4a66 100644
+--- a/src/fcmatch.c
++++ b/src/fcmatch.c
+@@ -501,11 +501,11 @@ FcFontSetMatchInternal (FcConfig *config,
+ printf ("\n");
+ FcPatternPrint (best);
+ }
+- if (!best)
+- {
+- *result = FcResultNoMatch;
+- return 0;
+- }
++ /* assuming that 'result' is initialized with FcResultNoMatch
++ * outside this function */
++ if (best)
++ *result = FcResultMatch;
++
+ return best;
+ }
+
+@@ -522,6 +522,8 @@ FcFontSetMatch (FcConfig *config,
+ assert (p != NULL);
+ assert (result != NULL);
+
++ *result = FcResultNoMatch;
++
+ if (!config)
+ {
+ config = FcConfigGetCurrent ();
+@@ -547,6 +549,8 @@ FcFontMatch (FcConfig *config,
+ assert (p != NULL);
+ assert (result != NULL);
+
++ *result = FcResultNoMatch;
++
+ if (!config)
+ {
+ config = FcConfigGetCurrent ();
+@@ -826,6 +830,9 @@ FcFontSetSort (FcConfig *config,
+ printf ("First font ");
+ FcPatternPrint (ret->fonts[0]);
+ }
++ if (ret->nfont > 0)
++ *result = FcResultMatch;
++
+ return ret;
+
+ bail2:
+@@ -849,6 +856,8 @@ FcFontSort (FcConfig *config,
+ assert (p != NULL);
+ assert (result != NULL);
+
++ *result = FcResultNoMatch;
++
+ if (!config)
+ {
+ config = FcConfigGetCurrent ();
+--
+1.7.7.6
+
diff --git a/fontconfig.spec b/fontconfig.spec
index e266bbd..a7bfcc7 100644
--- a/fontconfig.spec
+++ b/fontconfig.spec
@@ -3,7 +3,7 @@
Summary: Font configuration and customization library
Name: fontconfig
Version: 2.9.0
-Release: 1%{?dist}
+Release: 2%{?dist}
License: MIT
Group: System Environment/Libraries
Source: http://fontconfig.org/release/fontconfig-%{version}.tar.gz
@@ -11,6 +11,7 @@ URL: http://fontconfig.org
Source1: 25-no-bitmap-fedora.conf
Patch0: fontconfig-2.8.0-sleep-less.patch
+Patch1: fontconfig-2.9.0-result.patch
BuildRequires: expat-devel
BuildRequires: freetype-devel >= %{freetype_version}
@@ -19,6 +20,7 @@ BuildRequires: fontpackages-devel
Requires: fontpackages-filesystem
Requires(pre): freetype
+Requires(post): grep coreutils
%description
Fontconfig is designed to locate fonts within the
@@ -42,6 +44,7 @@ will use fontconfig.
%prep
%setup -q
%patch0 -p1 -b .sleep-less
+%patch1 -p1 -b .result
%build
# update autotools stuff to avoid rpath definition.
@@ -121,6 +124,13 @@ fi
%{_mandir}/man3/*
%changelog
+* Wed may 16 2012 Akira TAGOH <tagoh at redhat.com> - 2.9.0-2
+- Add grep and coreutils to Requires(post). (#821957)
+
+* Fri Mar 23 2012 Akira TAGOH <tagoh at redhat.com>
+- backport patch to make 'result' from FcFontMatch() and FcFontSort()
+ more reliable.
+
* Wed Mar 21 2012 Akira TAGOH <tagoh at redhat.com> - 2.9.0-1
- New upstream release (#803559)
- Update ks.orth (#790471)
More information about the scm-commits
mailing list