Add grep and coreutils to Requires(post). (#821957)

This commit is contained in:
Akira TAGOH 2012-05-16 12:22:17 +09:00
parent 89aa83ab30
commit 5fb5f5f480
2 changed files with 86 additions and 1 deletions

View File

@ -0,0 +1,75 @@
From 92ac054ce5e270f22a4f81a09522c3f03b76c876 Mon Sep 17 00:00:00 2001
From: Akira TAGOH <akira@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

View File

@ -3,7 +3,7 @@
Summary: Font configuration and customization library Summary: Font configuration and customization library
Name: fontconfig Name: fontconfig
Version: 2.9.0 Version: 2.9.0
Release: 1%{?dist} Release: 2%{?dist}
License: MIT License: MIT
Group: System Environment/Libraries Group: System Environment/Libraries
Source: http://fontconfig.org/release/fontconfig-%{version}.tar.gz Source: http://fontconfig.org/release/fontconfig-%{version}.tar.gz
@ -11,6 +11,7 @@ URL: http://fontconfig.org
Source1: 25-no-bitmap-fedora.conf Source1: 25-no-bitmap-fedora.conf
Patch0: fontconfig-2.8.0-sleep-less.patch Patch0: fontconfig-2.8.0-sleep-less.patch
Patch1: fontconfig-2.9.0-result.patch
BuildRequires: expat-devel BuildRequires: expat-devel
BuildRequires: freetype-devel >= %{freetype_version} BuildRequires: freetype-devel >= %{freetype_version}
@ -19,6 +20,7 @@ BuildRequires: fontpackages-devel
Requires: fontpackages-filesystem Requires: fontpackages-filesystem
Requires(pre): freetype Requires(pre): freetype
Requires(post): grep coreutils
%description %description
Fontconfig is designed to locate fonts within the Fontconfig is designed to locate fonts within the
@ -42,6 +44,7 @@ will use fontconfig.
%prep %prep
%setup -q %setup -q
%patch0 -p1 -b .sleep-less %patch0 -p1 -b .sleep-less
%patch1 -p1 -b .result
%build %build
# update autotools stuff to avoid rpath definition. # update autotools stuff to avoid rpath definition.
@ -121,6 +124,13 @@ fi
%{_mandir}/man3/* %{_mandir}/man3/*
%changelog %changelog
* Wed may 16 2012 Akira TAGOH <tagoh@redhat.com> - 2.9.0-2
- Add grep and coreutils to Requires(post). (#821957)
* Fri Mar 23 2012 Akira TAGOH <tagoh@redhat.com>
- backport patch to make 'result' from FcFontMatch() and FcFontSort()
more reliable.
* Wed Mar 21 2012 Akira TAGOH <tagoh@redhat.com> - 2.9.0-1 * Wed Mar 21 2012 Akira TAGOH <tagoh@redhat.com> - 2.9.0-1
- New upstream release (#803559) - New upstream release (#803559)
- Update ks.orth (#790471) - Update ks.orth (#790471)